Soru

Zorluk: OrtaDeploying and Managing Compute Engine Virtual Machines

A cloud engineer needs to deploy a Compute Engine virtual machine instance using a custom image stored in a central image repository project. The VM requires a reserved static internal IP address in a specific target subnet and must be assigned a custom service account. What is the correct sequence of steps to perform this deployment workflow?

  1. 1Grant the target project's Compute Engine Service Agent the `roles/compute.imageUser` role on the custom image in the central repository project.
  2. 2Reserve a static internal IP address in the target subnet using `gcloud compute addresses create`.
  3. 3Create the VM instance using `gcloud compute instances create` referencing the custom image URI, reserved static IP, target subnet, and custom service account.
  4. 4Verify the running status and network configuration of the VM using `gcloud compute instances describe`.

Cevap

The correct order of execution is: First, grant the target project service agent `roles/compute.imageUser` access on the central image. Second, reserve the static internal IP address in the target subnet. Third, execute `gcloud compute instances create` with the image URI, reserved internal IP, and custom service account. Fourth, verify the VM state and configuration using `gcloud compute instances describe`.
Cross-project image deployments require establishing IAM permissions prior to instance creation. Granting `roles/compute.imageUser` to the target project's Compute Engine Service Agent authorizes access to the custom image in the central project. Next, reserving the static internal IP in the target subnet ensures the network resource exists. Once these prerequisites are met, running `gcloud compute instances create` provisions the instance with the specified image, network IP, and service account. Finally, verifying with `gcloud compute instances describe` ensures proper deployment.

Adım Adım Çözüm

1
Authorize cross-project image access
Target project service account receives read access to the custom disk image
Compute Engine cannot read disk images across project boundaries without explicit IAM role delegation.
2
Reserve static internal IP address
An internal IP address is allocated within the specified subnet
An existing reserved IP resource is required to attach a static IP during instance creation.
3
Provision the Compute Engine VM
The instance is created and boots from the cross-project image
All authorization and network prerequisites are in place to execute instance provisioning.
4
Inspect instance deployment status
Instance configuration and RUNNING status are confirmed
Executing a describe command validates successful initialization and correct network/IAM metadata attachment.

Anahtar Kavram

Cross-Project Image Provisioning and Static Network Allocation
Bu soruyu puanla