이 문서는 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에 대해 발생할 수 있는 최대 마이그레이션 시도 수를 제어합니다.
evictionStrategy가 Restart로 설정되었으면 이 설정이 무시됩니다.
migrationTargetInitializationTimeout
이 설정은 마이그레이션이 실패로 간주되기 전 마이그레이션을 시작하는 데 걸리는 최대 시간을 제어합니다. 시작하는 데 너무 오래 걸리는 마이그레이션은 VM 워크로드의 실패한 마이그레이션 예산으로 계산됩니다.
evictionStrategy가 Restart로 설정되었으면 이 설정이 무시됩니다.
제거 정책 사용 설정 및 구성
GDC용 VM 런타임에서 제거 정책을 사용하려면 evictionPolicy 설정을 클러스터의 VMRuntime 객체에서 정의해야 합니다.
이 설정은 기본적으로 사용 설정되어 있습니다. 이전 버전에서 업그레이드할 경우에는 이 설정을 수동으로 사용 설정해야 합니다.
evictionPolicy: {}와 같은 빈 객체는 기본 설정을 사용하여 제거 정책을 사용 설정합니다. 기본 동작을 변경하려면 evictionPolicy 객체에 추가 구성 옵션을 추가합니다.
제거 정책을 사용 설정하고 구성하려면 다음 단계를 수행합니다.
VMRuntime 커스텀 리소스를 수정합니다.
kubectleditvmruntimevmruntime
기본 제거 정책 설정을 사용하려면 빈 객체를 사용해서 evictionPolicy 섹션을 추가 또는 업데이트하고, 아니면 원하는 설정을 추가합니다.
[[["이해하기 쉬움","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)"]]