A cloud engineer needs to create a standardized custom boot image from an existing baseline Compute Engine VM instance named `web-base-vm` and deploy a new instance named `web-prod-1` in zone `us-central1-b` using this custom image. Arrange the administrative steps required to complete this VM cloning and deployment workflow in the correct chronological order from first to last.
- 1Stop the source VM instance `web-base-vm` to ensure application state and file system consistency.
- 2Create a persistent disk snapshot named `web-base-snapshot` from the boot disk of `web-base-vm`.
- 3Create a custom disk image named `web-custom-image-v1` using `web-base-snapshot` as the source snapshot.
- 4Deploy the new VM instance `web-prod-1` in zone `us-central1-b` specifying the custom image `--image=web-custom-image-v1`.
- 5Restart the original baseline VM instance `web-base-vm` to restore its normal operation.
Answer
The correct sequence begins by stopping the source VM instance, creating a persistent disk snapshot, generating a custom image from that snapshot, deploying the new VM instance using the custom image flag, and finally restarting the original source VM instance.
To create a clean, consistent boot image and deploy a new Compute Engine VM from it, the engineer must first stop the source VM to prevent uncommitted disk writes. Next, a snapshot of the boot disk is created. That snapshot is then used as the source to build a custom Compute Engine image. With the image ready, the new VM instance (`web-prod-1`) is created using the `--image` parameter. Finally, the source VM can be restarted.
Step-by-Step Solution
Key Concept
Compute Engine Custom Image Deployment Workflow