Stay organized with collections
Save and categorize content based on your preferences.
Linux
Windows
To move sole-tenant VMs to a different node or node group, you can manually
initiate a live migration. You can also manually initiate a live migration to
move a multi-tenant VM into sole-tenancy. For information about how to move a VM
out of sole-tenancy, see Move a VM out of sole-tenancy.
Before you begin
If you haven't already, set up 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:
Select the tab for how you plan to use the samples on this page:
gcloud
Install the Google Cloud CLI.
After installation,
initialize the Google Cloud CLI by running the following command:
Manual live migration requests are categorized in the QueriesAPI rate
limit.
Manually live migrate VMs into or within sole-tenancy
To manually live migrate VMs into or within sole-tenancy, use the
gcloud CLI or REST.
If the destination of the VM is a node group, Compute Engine selects
the node within the group that has both enough space for the VM and the least
amount of spare capacity.
You cannot perform live migration between projects while using shared
sole-tenant node groups.
Permissions required for this task
To perform this task, you must have the following permissions:
VM_NAME: the name of the VM to update the node
affinity labels for.
Replace exactly one of the following:
NODE: the name of the node to live migrate the VM
to.
NODE_GROUP: the name of the node group to live
migrate the VM to.
NODE_AFFINITY_FILE: the name of a JSON file
containing a configuration of nodes on which this VM could be scheduled.
For more information, see Configure node affinity
labels.
REST
To manually live migrate VMs into or within sole-tenancy, use the following
instances.update method:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 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)"]]