Soru

Zorluk: OrtaPlanning Virtual Private Cloud (VPC) Networks and Subnets

A cloud engineer needs to expand the primary IPv4 CIDR range of an existing custom-mode Virtual Private Cloud (VPC) subnet in Google Cloud to accommodate new virtual machines without causing service disruption. What is the correct sequence of steps to plan and execute this subnet expansion?

  1. 1Inspect the existing subnet IP range and verify that the contiguous adjacent IP space does not overlap with existing subnets, custom routes, or connected networks.
  2. 2Select a broader subnet prefix length (such as expanding from /24 to /23) that contains the starting IP address of the current primary range.
  3. 3Run the `gcloud compute networks subnets expand-ip-range` command, passing the `--prefix-length` parameter with the targeted netmask value.
  4. 4Validate the expanded subnet configuration by describing the subnet resource to ensure the new primary IPv4 range is active.

Cevap

The correct sequence for expanding a custom-mode VPC primary subnet range is: 1) Verify that adjacent contiguous IP space is free of conflicts, 2) Select a broader prefix length encompassing the original base IP address, 3) Execute `gcloud compute networks subnets expand-ip-range` with the desired prefix length, and 4) Verify the expanded primary range in the subnet resource configuration.
Proper planning and execution of a GCP custom-mode VPC subnet primary range expansion requires checking for non-overlapping contiguous IP space, calculating a valid expanded prefix length, executing `gcloud compute networks subnets expand-ip-range`, and verifying the updated subnet status.

Adım Adım Çözüm

1
Audit current subnet IP allocation and connected networks
Ensures the planned expanded CIDR block does not collide with existing subnets, VPN tunnels, or interconnect routes.
Subnet expansion will fail or cause routing conflicts if the new IP space overlaps with existing network definitions.
2
Determine the new prefix length for expansion
Identifies a smaller prefix number (e.g., /23 instead of /24) that expands capacity while retaining the existing subnet start address.
GCP subnet expansion only permits broadening the netmask without changing the existing starting IP address boundary.
3
Execute the live expansion command
Applies the primary IP range expansion in place without causing VM downtime.
The `gcloud compute networks subnets expand-ip-range` command dynamically grows the subnet CIDR block online.
4
Confirm the updated subnet resource details
Validates that the subnet reflects the expanded primary IP range.
Post-execution verification confirms the subnet has successfully scaled its capacity.

Anahtar Kavram

VPC Subnet Primary Range Expansion Procedure
Bu soruyu puanla