Question

Difficulty: MediumManaging Compute Engine Resources

A DevOps engineer manages a critical application running on a Linux-based Compute Engine virtual machine. The attached persistent disk containing application data is approaching full capacity. The engineer needs to expand the storage capacity of this persistent disk with minimal disruption and without recreating the instance. Which procedure should the engineer follow?

  1. Resize the disk using the Cloud Console or gcloud CLI, and then extend the file system partition inside the guest operating system.Answer
  2. B
    Submit a GCP quota increase request for persistent disk capacity, which automatically expands the disk volume and guest file system.
  3. C
    Configure a Compute Engine autoscaling policy based on disk utilization to automatically resize the attached disk when usage exceeds 80%.
  4. D
    Migrate the Compute Engine instance to a Spot VM configuration to enable automatic dynamic resizing of persistent disks.

Answer

The correct procedure is to resize the disk using the Cloud Console or gcloud CLI, and then extend the file system partition inside the guest operating system.
Resizing a persistent disk in Google Cloud is a two-step process: first, increase the size of the persistent disk resource using GCP tools (Console or gcloud compute disks resize), and second, use guest OS utilities (such as growpart and resize2fs/xfs_growfs) to expand the file system into the newly available space.

Step-by-Step Solution

1
Increase the disk capacity in Google Cloud
The block device capacity assigned to the Compute Engine VM is increased without stopping the VM.
Google Cloud persistent disks can be resized online using the Console or gcloud compute disks resize command.
2
Expand the guest OS partition and file system
The operating system formats and allocates the newly expanded block storage space for immediate application use.
Increasing the block disk size in GCP does not automatically update partition tables or file systems inside Linux (e.g., via resize2fs or xfs_growfs).

Key Concept

Compute Engine Persistent Disk Management and Expansion
Rate this question