단독 테넌트 VM을 다른 노드 또는 노드 그룹으로 이동하려면 라이브 마이그레이션을 수동으로 시작할 수 있습니다. 또한 라이브 마이그레이션을 수동으로 시작하여 멀티 테넌트 VM을 단독 테넌시로 이동할 수도 있습니다. 단독 테넌시 외부로 VM을 이동하는 방법은 단독 테넌시 외부로 VM 이동을 참조하세요.
시작하기 전에
아직 인증을 설정하지 않았다면 설정합니다.
인증은 Google Cloud 서비스 및 API에 액세스하기 위해 ID를 확인하는 프로세스입니다.
로컬 개발 환경에서 코드 또는 샘플을 실행하려면 다음 옵션 중 하나를 선택하여 Compute Engine에 인증하면 됩니다.
Select the tab for how you plan to use the samples on this page:
gcloud
After installing the Google Cloud CLI,
initialize it by running the following command:
[[["이해하기 쉬움","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-07-22(UTC)"],[[["\u003cp\u003eManual live migration can move sole-tenant VMs to a different node or node group, and multi-tenant VMs into sole-tenancy.\u003c/p\u003e\n"],["\u003cp\u003ePerforming manual live migration requires \u003ccode\u003ecompute.instances.update\u003c/code\u003e permissions on the VM.\u003c/p\u003e\n"],["\u003cp\u003eThe gcloud CLI or REST can be used to manually live migrate VMs into or within sole-tenancy, using the \u003ccode\u003egcloud compute instances update\u003c/code\u003e command or the \u003ccode\u003einstances.update\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eWhen a node group is the destination, Compute Engine selects the node with sufficient space and the least spare capacity.\u003c/p\u003e\n"],["\u003cp\u003eLive migration between projects using shared sole-tenant node groups is not supported.\u003c/p\u003e\n"]]],[],null,["Linux Windows\n\n*** ** * ** ***\n\nTo move sole-tenant VMs to a different node or node group, you can manually\ninitiate a live migration. You can also manually initiate a live migration to\nmove a multi-tenant VM into sole-tenancy. For information about how to move a VM\nout of sole-tenancy, see [Move a VM out of sole-tenancy](/compute/docs/nodes/updating-vm-tenancy#moving_a_vm_out_of_sole-tenancy).\n\nBefore you begin\n\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n gcloud\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\nAPI rate limits\n\nManual live migration requests are categorized in the **Queries** [API rate\nlimit](/compute/docs/api-rate-limits).\n\nManually live migrate VMs into or within sole-tenancy\n\nTo manually live migrate VMs into or within sole-tenancy, use the\ngcloud CLI or REST.\n\nIf the destination of the VM is a node group, Compute Engine selects\nthe node within the group that has both enough space for the VM and the least\namount of spare capacity.\n\nYou cannot perform live migration between projects while using shared\nsole-tenant node groups.\n\nPermissions required for this task\n\nTo perform this task, you must have the following [permissions](/iam/docs/overview#permissions):\n\n- `compute.instances.update` permissions on the VM.\n\ngcloud\n\nTo manually live migrate VMs into or within sole-tenancy, use the following\n[`gcloud compute instances update` command](/sdk/gcloud/reference/compute/instances/update): \n\n```\ngcloud compute instances update VM_NAME \\\n ( --node=NODE \\\n --node-group=NODE_GROUP \\\n --node-affinity-file=NODE_AFFINITY_FILE )\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of the VM to update the node affinity labels for.\n\nReplace exactly one of the following:\n\n- \u003cvar translate=\"no\"\u003eNODE\u003c/var\u003e: the name of the node to live migrate the VM\n to.\n\n- \u003cvar translate=\"no\"\u003eNODE_GROUP\u003c/var\u003e: the name of the node group to live\n migrate the VM to.\n\n- \u003cvar translate=\"no\"\u003eNODE_AFFINITY_FILE\u003c/var\u003e: the name of a JSON file\n containing a configuration of nodes on which this VM could be scheduled.\n For more information, see [Configure node affinity\n labels](/compute/docs/nodes/provisioning-sole-tenant-vms#configure_node_affinity_labels).\n\nREST\n\nTo manually live migrate VMs into or within sole-tenancy, use the following\n[`instances.update` method](/compute/docs/reference/rest/v1/instances/update): \n\n```\nPUT https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME\n\n{\n ...\n \"scheduling\": {\n \"nodeAffinities\": [\n {\n \"key\": \"NODE_AFFINITY_LABEL_KEY\",\n \"operator\": \"IN\",\n \"values\": [\n \"[NODE_AFFINITY_LABEL_VALUE]\"\n ]\n }\n ]\n }\n ...\n}\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project that has the VM\n to update the node affinity labels for.\n\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone of the VM to update the node\n affinity labels for.\n\n- \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of the VM to update the node\n affinity labels for.\n\n- \u003cvar translate=\"no\"\u003eNODE_AFFINITY_LABEL_KEY\u003c/var\u003e: one of the following\n strings that specifies whether to live migrate the VM to a node group or\n node:\n\n | VM destination | Key to specify |\n |----------------|------------------------------------------|\n | Node group | `compute.googleapis.com/node-group-name` |\n | Node | `compute.googleapis.com/node-name` |\n\n- \u003cvar translate=\"no\"\u003eNODE_AFFINITY_LABEL_VALUE\u003c/var\u003e: the name of the node\n group or node to live migrate the VM to.\n\nWhat's next\n\n- [Learn how to move a VM out of sole-tenancy](/compute/docs/nodes/updating-vm-tenancy#moving_a_vm_out_of_sole-tenancy)"]]