An Associate Cloud Engineer needs to increase the available disk space for a stateful application running on a Linux Compute Engine VM without restarting or replacing the existing Persistent Disk. Sequence the steps required to safely expand the disk capacity and make the additional storage space usable by the operating system.
- 1Increase the disk capacity in Google Cloud by executing `gcloud compute disks resize [DISK_NAME] --size=[NEW_SIZE]`.
- 2Connect to the Linux virtual machine instance via `gcloud compute ssh [INSTANCE_NAME]`.
- 3Extend the disk partition boundary to occupy the newly unallocated disk space using `growpart`.
- 4Expand the operating system filesystem using `resize2fs` or `xfs_growfs`.
Answer
The correct sequence begins with expanding the Persistent Disk capacity in GCP (`gcloud compute disks resize`), followed by connecting to the VM via SSH (`gcloud compute ssh`), extending the disk partition table (`growpart`), and finally expanding the guest filesystem (`resize2fs` or `xfs_growfs`).
Expanding persistent storage on a live Compute Engine VM requires a top-down layer approach: provision additional raw block storage at the GCP control plane (`gcloud compute disks resize`), gain access to the OS (`gcloud compute ssh`), update the partition table to encompass the new space (`growpart`), and finally resize the filesystem layer (`resize2fs` or `xfs_growfs`).
Step-by-Step Solution
Key Concept
Compute Engine Persistent Disk Resizing Procedure
Estimated Time:1m 30s