Soru

Zorluk: Çok zorManaging Networking Resources

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`?

  1. gcloud compute instances add-access-config api-server-01 --zone=us-central1-b --address=api-static-ipCevap
  2. B
    gcloud compute instances update api-server-01 --zone=us-central1-b --external-ip=api-static-ip
  3. C
    gcloud compute addresses update api-static-ip --region=us-central1 --attached-instance=api-server-01
  4. D
    gcloud 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

1
Identify the operational requirement for attaching an external IP to a running Compute Engine instance.
Recognize that external IP addresses on Google Cloud Compute Engine virtual machines are managed as access configurations on the instance's network interface (nic0).
Compute Engine instances without external IP addresses lack an access config element on their network interface.
2
Determine the correct gcloud CLI command group and subcommand for adding access configurations.
Select `gcloud compute instances add-access-config` specifying the target instance name, zone, and reserved IP address via `--address`.
The `add-access-config` command creates a new access configuration (NAT type) for the specified VM interface using the reserved IP.
3
Evaluate alternative CLI options for invalid syntax or incorrect scope.
Reject generic update commands on instances, addresses, or subnets that lack the required parameters for access configuration management.
Flags such as `--external-ip`, `--attached-instance`, or `--assign-external-ip` do not exist in their respective gcloud command schemas.

Anahtar Kavram

Managing Compute Engine Instance Access Configurations and External Static IP Assignment
Tahmini Süre:2m 0s
Bu soruyu puanla