Manually live migrate VMs (original) (raw)

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

API rate limits

Manual live migration requests are categorized in the Queries API 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:

gcloud

To manually live migrate VMs into or within sole-tenancy, use the followinggcloud compute instances update command:

gcloud compute instances update VM_NAME
( --node=NODE
--node-group=NODE_GROUP
--node-affinity-file=NODE_AFFINITY_FILE )

Replace the following:

Replace exactly one of the following:

REST

To manually live migrate VMs into or within sole-tenancy, use the followinginstances.update method:

PUT https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME

{ ... "scheduling": { "nodeAffinities": [ { "key": "NODE_AFFINITY_LABEL_KEY", "operator": "IN", "values": [ "[NODE_AFFINITY_LABEL_VALUE]" ] } ] } ... }

Replace the following:

What's next