A Cloud Engineer needs to migrate an existing standalone, stateful Compute Engine VM instance named 'prod-db-node' and its boot persistent disk from zone us-central1-a to zone us-central1-b due to a planned zone retirement. The database engine requires complete data consistency prior to taking storage backups. Which sequence of gcloud CLI actions correctly performs this zonal migration while ensuring data integrity?
- 1Stop the source VM instance 'prod-db-node' in zone us-central1-a to freeze disk I/O.
- 2Create a snapshot from the source VM's boot persistent disk 'prod-db-node-disk'.
- 3Create a new zonal persistent disk in us-central1-b specifying the snapshot as the source.
- 4Provision a new VM instance in us-central1-b attaching the newly created disk as the boot disk.
Answer
The correct operational sequence to migrate a stateful Compute Engine instance to a new zone is: 1) Stop the source instance in us-central1-a to ensure disk consistency. 2) Take a snapshot of the boot persistent disk. 3) Provision a new persistent disk in target zone us-central1-b using the snapshot as source. 4) Launch a new Compute Engine instance in us-central1-b attached to the restored persistent disk as its boot disk.
Because Compute Engine Persistent Disks are bound to a single zone, migrating a stateful VM to another zone requires creating a new persistent disk in the target zone. The proper workflow starts with stopping the VM instance to guarantee data consistency, capturing a project-wide persistent disk snapshot, instantiating a new persistent disk in target zone us-central1-b using the snapshot as a source, and finally launching a new Compute Engine VM in us-central1-b referencing the new disk as its boot disk.
Step-by-Step Solution
Key Concept
Cross-Zone Compute Engine Persistent Disk Migration
Estimated Time:2m 0s