Soru

Zorluk: OrtaDeploying and Managing Compute Engine Virtual Machines

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?

  1. 1Reserve a static internal IP address in the target VPC subnet using gcloud compute addresses create.
  2. 2Create a secondary persistent disk from the existing disk snapshot using gcloud compute disks create --source-snapshot.
  3. 3Provision the Compute Engine VM instance using gcloud compute instances create with the --private-network-ip flag.
  4. 4Attach the secondary persistent disk to the created VM instance using gcloud compute instances attach-disk.

Cevap

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.

Adım Adım Çözüm

1
Reserve the static internal IP address in the target subnet.
A static internal IP address resource is created and held in the target subnet.
Assigning a specific internal IP during VM creation requires reserving the address beforehand.
2
Create the secondary persistent disk using the source snapshot.
A zonal persistent disk containing data from the snapshot is created.
The disk must exist as an independent GCP resource before attaching it to a VM instance.
3
Deploy the Compute Engine VM instance specifying the reserved private IP address.
The primary VM instance boots attached to the subnet with the designated static internal IP address.
The instance creation command references the static internal IP reserved in Step 1.
4
Attach the secondary persistent disk to the running VM instance.
The secondary disk is successfully attached to the VM instance for mounting and use.
Attaching a disk requires both the target VM instance and the persistent disk resource to be present in the same zone.

Anahtar Kavram

Compute Engine VM Provisioning with Static Internal IP and Secondary Persistent Disks
Tahmini Süre:1m 30s
Bu soruyu puanla