Soru

Zorluk: OrtaDeploying and Managing Compute Engine Virtual Machines

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.

  1. 1Stop the source VM instance `web-base-vm` to ensure application state and file system consistency.
  2. 2Create a persistent disk snapshot named `web-base-snapshot` from the boot disk of `web-base-vm`.
  3. 3Create a custom disk image named `web-custom-image-v1` using `web-base-snapshot` as the source snapshot.
  4. 4Deploy the new VM instance `web-prod-1` in zone `us-central1-b` specifying the custom image `--image=web-custom-image-v1`.
  5. 5Restart the original baseline VM instance `web-base-vm` to restore its normal operation.

Cevap

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.

Adım Adım Çözüm

1
Stop the baseline VM instance.
The VM enters the TERMINATED state, locking persistent disk writes.
Capturing a snapshot from a stopped instance avoids disk corruption and guarantees a consistent image state.
2
Create a disk snapshot from the boot disk.
A persistent disk snapshot is generated in Google Cloud Storage.
Snapshots store point-in-time byte data required to build image resources.
3
Create a custom image from the snapshot.
A custom Compute Engine disk image resource is registered in the project.
Custom images allow cross-zone and cross-region provisioning of standardized VM boot disks.
4
Execute `gcloud compute instances create web-prod-1 --zone=us-central1-b --image=web-custom-image-v1`.
The new VM instance boots up with the pre-configured OS and environment.
Specifying the custom image provisions a new instance initialized with the exact baseline software stack.
5
Start the baseline VM instance `web-base-vm`.
The source instance resumes RUNNING state.
The image capturing dependency chain is complete, so baseline operations can resume.

Anahtar Kavram

Compute Engine Custom Image Deployment Workflow
Bu soruyu puanla