A cloud engineering team needs to standardize a base environment for auto-scaling a web application currently running on a standalone Compute Engine instance. The team plans to capture the configuration of the existing instance's boot disk, package it into a custom image, and use that image to generate an instance template for a new Managed Instance Group (MIG). In what sequential order should the engineer perform these gcloud CLI operations to ensure data consistency and proper resource dependency?
- 1Stop the source Compute Engine virtual machine instance using `gcloud compute instances stop`.
- 2Create a snapshot of the VM's boot disk using `gcloud compute disks snapshot`.
- 3Create a custom image from the persistent disk snapshot using `gcloud compute images create`.
- 4Create a new instance template specifying the custom image using `gcloud compute instance-templates create`.
Cevap
The correct execution sequence is: 1) Stop the source Compute Engine instance to flush disk caches and guarantee data consistency. 2) Create a persistent disk snapshot from the stopped VM's boot disk. 3) Create a custom image with the snapshot specified as its source. 4) Create an instance template referencing the newly created custom image.
The correct order follows dependency and data-integrity requirements: stopping the VM ensures disk consistency, creating a disk snapshot captures that state, building a custom image from the snapshot provides a reusable boot resource, and defining the instance template uses the finished custom image.
Adım Adım Çözüm
Anahtar Kavram
Compute Engine Image and Template Lifecycle Management