Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Compute Cloud
  • Yandex Container Solution
    • Resource relationships
      • Overview
      • Platforms
      • vCPU performance levels
      • Hardware generations
      • Preemptible VMs
      • VM network interfaces
      • Software accelerated network
      • Live migration
      • Placement groups
      • Statuses
      • VM maintenance policies
      • Serial console
      • Resetting Windows VM passwords
    • Graphics processing units (GPUs)
    • GPU VM maintenance
    • Images
    • Dedicated host
    • Reserved instance pools
    • Encryption
    • Backups
    • Quotas and limits
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Compute maintenance policy settings
  • Working with metadata
  • Considerations for different types of VMs
  • Considerations for preemptible VMs
  • Considerations for VMs with GPUs
  • Limitations
  1. Concepts
  2. Virtual machines
  3. VM maintenance policies

Compute maintenance policies

Written by
Yandex Cloud
Updated at October 29, 2026
View in Markdown
  • Compute maintenance policy settings
  • Working with metadata
  • Considerations for different types of VMs
    • Considerations for preemptible VMs
    • Considerations for VMs with GPUs
  • Limitations

Use compute maintenance policies to manage a VM's response to scheduled maintenance and receive maintenance information via metadata.

During maintenance, a VM instance is migrated to a different host. The policy determines how the system migrates the VM instance:

  • Restarts the instance on another host.
  • Performs live migration to another host without restarting the instance.

If the policy is configured, information about upcoming maintenance may be written to the VM instance’s metadata. Stored in the metadata service, maintenance metadata is only accessible from within the VM. Applications running on the VM instance can read it and get ready for maintenance, e.g., by completing active requests or saving state before a restart.

Compute maintenance policy settingsCompute maintenance policy settings

Warning

Before configuring a policy, review these considerations for different VM types. The available policy types and maintenance behavior depend on the VM type.

A VM maintenance policy is defined by two parameters:

  • maintenance_policy: Type of maintenance policy.
  • maintenance_grace_period: Maintenance grace period.

To select how the system migrates the VM to another host, set the relevant maintenance_policy value. To restart the VM, set to RESTART. To perform live migration, specify MIGRATE.

To not specify a policy, set the value to MAINTENANCE_POLICY_UNSPECIFIED. In this case, maintenance information does not appear in the metadata, and there is no grace period before maintenance.

The maintenance_grace_period value defines a delay for the VM restart or migration.

Maximum grace period:

  • Up to one minute for VMs without GPUs.
  • Up to one hour for VMs with GPUs.

Maintenance information appears in the VM metadata only if maintenance_grace_period > 0. If set to zero, the metadata includes no maintenance information, and maintenance is performed without a grace period.

You can configure the maintenance policy when creating and updating a VM instance. You can use the CLI, Terraform, or API to configure both the policy type and grace period, while the management console only allows you to set the policy type.

Working with metadataWorking with metadata

Information about upcoming maintenance is written to the VM metadata under the /instance/maintenance-event key. You can use this key to access maintenance information only from within the VM via the metadata service. For more details on the metadata storage format, see this article.

The following values are written:

  • TERMINATE_ON_HOST_MAINTENANCE before the VM restarts.
  • MIGRATE_ON_HOST_MAINTENANCE before live migration.

You can implement reading metadata from within the VM and have your application react to maintenance.

For example, let’s assume your maintenance policy is RESTART. The system writes TERMINATE_ON_HOST_MAINTENANCE to the metadata and starts the countdown for maintenance_grace_period. The application reads the metadata and uses the grace period to save its state. After the grace period expires, the VM restarts.

To test the maintenance response in your application, simulate a maintenance event.

Considerations for different types of VMsConsiderations for different types of VMs

Considerations for preemptible VMsConsiderations for preemptible VMs

During maintenance, preemptible VMs are stopped and do not migrate. Maintenance information does not appear in the metadata.

Considerations for VMs with GPUsConsiderations for VMs with GPUs

VMs with GPUs do not support live migration.

If the RESTART policy is configured for a non-preemptible VM with a GPU, email notifications about scheduled maintenance are disabled, and maintenance tasks are not created. During scheduled maintenance, the VM automatically restarts following a maintenance_grace_period.

LimitationsLimitations

Metadata events only warn about scheduled maintenance. If a VM fails, it may restart on another host without warning. The system will notify of a failure by email.

Useful linksUseful links

  • Maintenance policy management
  • Getting VM instance metadata

Was the article helpful?

Previous
Statuses
Next
Serial console
© 2026 Direct Cursus Technology L.L.C.