このドキュメントは、Google Distributed Cloud で仮想マシン(VM)を実行するプラットフォーム管理者を対象としています。このドキュメントでは、GDC 上の VM ランタイムを使用する VM がメンテナンス イベント中に他のホストに自動的に移行する方法を制御するエビクション ポリシーの構成方法について説明します。これらの構成設定を使用すると、クラスタをアップグレードしたり、ホストでメンテナンスを行ったりしても、他のホストでは VM を継続して実行できます。
Google Distributed Cloud を使用すると、クラスタをアップグレードしたり、ノードをメンテナンス モードにする際のノードの動作を構成できます。GDC 上の VM ランタイムは、これらのイベント中に実行される VM をクラスタがどのように取り扱うかを制御するエビクション ポリシーを使用します。
有効にすると、GDC 上の VM ランタイムはデフォルトでライブ マイグレーションを使用して VM ワークロードを別のホストに移動します。この動作により、VM ワークロードが中断する可能性を最小限に抑えられます。ライブ マイグレーションでは、ゲスト OS を中断することなく、移行可能な VM をあるホストから別のホストに移動します。
次のエビクション ポリシー設定を構成できます。
プロパティ
デフォルト
有効な値
evictionStrategy
LiveMigrate
LiveMigrate、Restart
maxMigrationAttemptsPerVM
3
[1,5] の範囲内の整数
migrationTargetInitializationTimeout
30s
有効な長さの文字列(1m、2h、1h30m)
evictionStrategy
この値が LiveMigrate に設定されている場合、GDC 上の VM ランタイムは、移行可能な VM をノードから移行して強制排除しようとします。VM はクラスタ内の別のノードに配置され、引き続き実行されます。
この値が Restart に設定されている場合、GDC 上の VM ランタイムは VM の移行を試みません。代わりに、ノードがメンテナンス モードになると VM は停止し、ノードがメンテナンス モードから離れると VM が再起動します。ホスト メンテナンス イベント中は VM が利用できなくなります。
LiveMigrate 戦略を選択すると、GDC 上の VM ランタイムは、移行不能な VM で Restart 戦略にフォールバックします。
maxMigrationAttemptsPerVM
この設定は、Restart 戦略が適用される前に特定の VM に対して実行できる移行の試行の最大数を制御します。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[],[],null,["| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis document is for platform administrators that run virtual machines (VMs) in\nGoogle Distributed Cloud. This document shows you how to configure the eviction policy\nthat controls how VMs that use VM Runtime on GDC can automatically\nmigrate to other hosts during maintenance events. These configuration settings\nlet you VMs continue to run on other hosts when you upgrade a cluster or perform\nmaintenance on a host.\n\nBefore you begin\n\nTo complete this document, you need access to Google Distributed Cloud version 1.12.0\n(`anthosBareMetalVersion: 1.12.0`) or higher cluster. You can use any cluster\ntype capable of running workloads. If needed,\n[try Google Distributed Cloud on Compute Engine](/kubernetes-engine/distributed-cloud/bare-metal/docs/try/gce-vms)\nor see the\n[cluster creation overview](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/creating-clusters/create-clusters-overview).\n\nEviction policy settings\n\nGoogle Distributed Cloud lets you configure node behavior when you perform cluster\nupgrades or place nodes into maintenance mode. VM Runtime on GDC uses\nan *eviction policy* that controls how the cluster handles VMs that run during\nthese events.\n\nWhen enabled, VM Runtime on GDC uses live migration to move VM\nworkloads to another host by default. This behavior minimizes potential\ndisruption to the VM workloads. With live migration, migratable VMs move from\none host to another without disruption to the guest OS.\n| **Note:** If you're upgrading to Google Distributed Cloud 1.12 from a previous version, you can't take advantage of migration-based eviction during the upgrade to version 1.12. Migration-based eviction for cluster upgrades is only supported for Google Distributed Cloud version 1.12 and higher.\n\nThe following eviction policy settings can be configured:\n\n| Property | Default | Valid values |\n|----------------------------------------|---------------|-----------------------------------------------------------|\n| `evictionStrategy` | `LiveMigrate` | `LiveMigrate`, `Restart` |\n| `maxMigrationAttemptsPerVM` | `3` | Integers in the range \\[`1`,`5`\\] |\n| `migrationTargetInitializationTimeout` | `30s` | Any valid duration string, such as `1m`, `2h`, or `1h30m` |\n\n`evictionStrategy`\n\nIf this value is set to `LiveMigrate`, VM Runtime on GDC attempts to\nmigrate any migratable VM away from a node to evict it. The VM is placed on\nanother node in the cluster and continues to run.\n| **Note:** The `VirtualMachineDisk` for a VM must use the `ReadWriteMany` access mode for the VM to use live migration. If the `VirtualMachineDisk` access mode is `ReadWriteOnce`, the VM can't live migrate.\n\nIf this value is set to `Restart`, VM Runtime on GDC makes no attempt\nto migrate VMs. Instead, VMs are stopped when the node is put into maintenance\nmode, and the VMs start again when the node is brought out of maintenance mode.\nThe VM is unavailable during the host maintenance event.\n\nWhen you choose the `LiveMigrate` strategy, VM Runtime on GDC falls\nback to the `Restart` strategy for non-migratable VMs.\n\n`maxMigrationAttemptsPerVM`\n\nThis setting controls the maximum number of migration attempts that can occur\nfor a particular VM before the `Restart` strategy applies.\n\nThis setting is ignored if `evictionStrategy` is set to `Restart`.\n\n`migrationTargetInitializationTimeout`\n\nThis setting controls the maximum amount of time a migration can take to start\nbefore it's considered to have failed. A migration that takes too long to start\ncounts toward the failed migration budget for a VM workload.\n\nThis setting is ignored if `evictionStrategy` is set to `Restart`.\n\nEnable and configure the eviction policy\n\nTo use the eviction policy in VM Runtime on GDC, the\n`evictionPolicy` setting must be defined in your cluster's `VMRuntime` object.\nThis setting is enabled by default. If you upgrade from a previous version, you\nmust enable this setting manually.\n\nAn empty object, such as `evictionPolicy: {}`, enables the eviction policy with\ndefault settings. To change the default behavior, add additional configuration\noptions to the `evictionPolicy` object.\n\nTo enable and configure the eviction policy, complete the following steps:\n\n1. Edit the `VMRuntime` custom resource:\n\n kubectl edit vmruntime vmruntime\n\n2. Add or update the `evictionPolicy` section with an empty object to use\n the default eviction policy settings, or add your desired settings:\n\n apiVersion: vm.cluster.gke.io/v1\n kind: VMRuntime\n metadata:\n name: vmruntime\n spec:\n disableCDIUploadProxyVIP: false\n enabled: true\n evictionPolicy: {}\n useEmulation: false\n\n If the `evictionPolicy` isn't populated, such as `evictionPolicy: null` or\n isn't included in the manifest, no special action is taken. VMs are forcefully\n evicted.\n\n The following example manifests show how to enable live migration of VMs, or\n restart the VMs on the same host after maintenance is complete: \n\n Live migrate\n\n The following example eviction policy enables live migration of VMs. The\n cluster can retry the live migration up to 3 times, with a 30-second\n timeout on the process each time to start: \n\n apiVersion: vm.cluster.gke.io/v1\n kind: VMRuntime\n metadata:\n name: vmruntime\n spec:\n disableCDIUploadProxyVIP: false\n enabled: true\n evictionPolicy:\n evictionStrategy: LiveMigrate\n maxMigrationAttemptsPerVM: 3\n migrationTargetInitializationTimeout: 30s\n useEmulation: false\n\n Restart\n\n The following example eviction policy makes no attempt at migration for\n any VMs during eviction. VMs are stopped on their current host, and start\n again when the host finishes its maintenance event: \n\n apiVersion: vm.cluster.gke.io/v1\n kind: VMRuntime\n metadata:\n name: vmruntime\n spec:\n disableCDIUploadProxyVIP: false\n enabled: true\n evictionPolicy:\n evictionStrategy: Restart\n useEmulation: false\n\n3. Save and close the `VMRuntime` custom resource in your editor.\n\n VM Runtime on GDC now applies the eviction policy to VMs in your\n cluster.\n\nWhat's next\n\n- [Schedule VMs that use VM Runtime on GDC](/kubernetes-engine/distributed-cloud/bare-metal/docs/vm-runtime/schedule-vms)"]]