Easy1 markMultiple Choice
Domain 4.5: Managing networking resourcesDomain 4.5VPCNetworkinggcloud

GCP ACE · Question 39 · Domain 4.5: Managing networking resources

Your company has a custom VPC with a subnet named 'app-subnet' using the IP range 10.0.0.0/24. You have run out of IP addresses in this subnet and need to expand it to a /20 range without recreating the subnet or disrupting existing VMs.

Which command should you use?

Answer options:

A.

gcloud compute networks subnets update app-subnet --range=10.0.0.0/20

B.

gcloud compute networks subnets expand-ip-range app-subnet --prefix-length=20

C.

gcloud vpc subnets resize app-subnet --cidr=10.0.0.0/20

D.

You cannot expand a subnet; you must create a new one and migrate the VMs.

How to approach this question

Recall the specific gcloud command used to increase the size of a subnet.

Full Answer

B.gcloud compute networks subnets expand-ip-range app-subnet --prefix-length=20✓ Correct
In GCP, you can dynamically expand the IP range of a subnet without downtime, provided the new range does not overlap with other subnets. The correct command is `gcloud compute networks subnets expand-ip-range [SUBNET_NAME] --prefix-length=[NEW_PREFIX]`.

Common mistakes

Believing that subnets cannot be resized, or using the 'update' command instead of 'expand-ip-range'.

Practice the full GCP Associate Cloud Engineer Practice Exam 3

50 questions · hints · full answers · grading

More questions from this exam