A Cloud Engineer is managing a custom-mode Virtual Private Cloud (VPC) network. A subnet named `app-subnet-us-east1` in region `us-east1` currently has a primary IP range of `10.1.0.0/24`. Due to rapid application growth, the subnet is running out of available IP addresses. The engineer needs to expand the primary subnet IP range to accommodate at least 500 private IP addresses without disrupting existing running Compute Engine instances or recreating the subnet. Which `gcloud` command should the engineer execute?
- Run `gcloud compute networks subnets expand-ip-range app-subnet-us-east1 --region=us-east1 --prefix-length=23`.Cevap
- BRun `gcloud compute networks subnets expand-ip-range app-subnet-us-east1 --region=us-east1 --prefix-length=25`.
- CDelete `app-subnet-us-east1` using `gcloud compute networks subnets delete` and recreate it with CIDR `10.1.0.0/23`.
- DRun `gcloud compute instances update --zone=us-east1-a --subnet-prefix=23` for each instance connected to the subnet.
Cevap
Run `gcloud compute networks subnets expand-ip-range app-subnet-us-east1 --region=us-east1 --prefix-length=23`.
In Google Cloud Virtual Private Cloud (VPC), primary subnet IP address ranges can be expanded in-place non-disruptively without recreating the subnet or taking VM instances offline. To expand a `/24` range (256 addresses) to fit at least 500 hosts, the prefix length must be reduced to `/23` (512 addresses). The correct command is `gcloud compute networks subnets expand-ip-range [SUBNET_NAME] --region=[REGION] --prefix-length=23`.
Adım Adım Çözüm
Anahtar Kavram
Expanding VPC Subnet Primary IP Ranges in Google Cloud
Tahmini Süre:1m 30s