A cloud engineer is managing networking resources for an enterprise workload on Google Cloud. A Compute Engine virtual machine named `api-server-01` running in zone `us-central1-b` was initially deployed without an external IP address. Due to an emergency operational requirement, the VM must temporarily receive a static public IP address that has already been reserved under the name `api-static-ip` in region `us-central1`. The virtual machine is actively serving internal requests and cannot be deleted or recreated. Which `gcloud` command should the engineer run to assign the reserved external IP address to `api-server-01`?
- gcloud compute instances add-access-config api-server-01 --zone=us-central1-b --address=api-static-ipCevap
- Bgcloud compute instances update api-server-01 --zone=us-central1-b --external-ip=api-static-ip
- Cgcloud compute addresses update api-static-ip --region=us-central1 --attached-instance=api-server-01
- Dgcloud compute networks subnets update default --region=us-central1 --assign-external-ip=api-static-ip
Cevap
To assign a reserved static external IP address to an existing Compute Engine VM instance, execute `gcloud compute instances add-access-config api-server-01 --zone=us-central1-b --address=api-static-ip`.
In Google Cloud Compute Engine, external IP addresses are associated with instances through network interface access configurations. To attach an existing reserved static external IP address to a running virtual machine without recreating it, you must use the command `gcloud compute instances add-access-config <INSTANCE_NAME> --zone=<ZONE> --address=<ADDRESS_NAME_OR_IP>`.
Adım Adım Çözüm
Anahtar Kavram
Managing Compute Engine Instance Access Configurations and External Static IP Assignment
Tahmini Süre:2m 0s