A cloud engineer needs to deploy a new Compute Engine virtual machine instance into a specific VPC subnet using a pre-reserved static internal IP address. Additionally, the instance requires a secondary persistent disk populated from an existing disk snapshot. What is the correct sequence of steps to execute this deployment using the Google Cloud CLI?
- 1Reserve a static internal IP address in the target VPC subnet using gcloud compute addresses create.
- 2Create a secondary persistent disk from the existing disk snapshot using gcloud compute disks create --source-snapshot.
- 3Provision the Compute Engine VM instance using gcloud compute instances create with the --private-network-ip flag.
- 4Attach the secondary persistent disk to the created VM instance using gcloud compute instances attach-disk.
Answer
The correct sequence of steps is: 1) Reserve a static internal IP address in the target subnet using gcloud compute addresses create; 2) Create a secondary persistent disk from the disk snapshot using gcloud compute disks create --source-snapshot; 3) Provision the Compute Engine VM instance using gcloud compute instances create --private-network-ip; 4) Attach the secondary persistent disk to the VM instance using gcloud compute instances attach-disk.
Provisioning a Compute Engine instance with dependent network and storage resources requires creating prerequisite assets before referencing them. First, the static internal IP must be reserved in the subnet. Second, the persistent disk must be generated from the snapshot. Third, the instance is provisioned using the reserved private IP. Finally, the secondary persistent disk is attached to the newly created VM instance.
Step-by-Step Solution
Key Concept
Compute Engine VM Provisioning with Static Internal IP and Secondary Persistent Disks
Estimated Time:1m 30s