This document provides instructions to increase the size of both boot and non-boot virtual machine (VM) disks in Google Distributed Cloud (GDC) air-gapped.
You can increase the size of your VM disk partition when your VM instance requires additional storage space or increased performance limits.
You can only increase, and not decrease, the size of a disk. To decrease the disk size, you must create a new disk with a smaller size. Until you delete the original, larger disk, you are charged for both disks.
This document is for developers in platform administrator or application operator groups that want to expand VM disks in a Distributed Cloud environment. For more information, see Audiences for GDC air-gapped documentation.
Request IAM roles
To increase the size of your VM disks, contact your Project IAM Admin to request
the Virtual Machine Project Admin (project-vm-admin) role.
All VM roles must bind to the namespace of the project where the VM resides. Follow the steps to verify your access.
Disk expansion
Follow the gdcloud or API steps to expand the disk size.
gdcloud
Expand the VM disk:
gdcloud compute disks resize DISK_NAME \
--project=PROJECT \
--size=NEW_SIZE
Replace
DISK_NAMEwith the name of the disk.Replace
PROJECTwith the name of the GDC project in which the VM lives.Replace
NEW_SIZEwith the new size of the disk.
API
Expand the
VirtualMachineDiskby updating the.spec.sizefield:kubectl --kubeconfig MANAGEMENT_API_SERVER \ -n PROJECT \ apply -f - <<EOF apiVersion: virtualmachine.gdc.goog/v1 kind: VirtualMachineDisk metadata: name: VM_BOOT_DISK_NAME spec: source: image: name: BOOT_DISK_IMAGE_NAME namespace: vm-system size: BOOT_DISK_SIZE EOFReplace the following variables:
Variable Definition MANAGEMENT_API_SERVERThe Management API server kubeconfig file. PROJECTThe GDC project to create the VM. VM_BOOT_DISK_NAMEThe name of the new VM boot disk. BOOT_DISK_IMAGE_NAMEThe name of the image to use for the new VM boot disk. BOOT_DISK_SIZEThe size of the boot disk, such as 20Gi.
This value must always be greater than or equal to theminimumDiskSizeof the boot disk image.Wait until the
.status.sizefield updates to the new size.
Expand the file systems and partitions
After expanding the block device, you must expand the guest's partition and file
system so that applications can consume the additional space. Some OS's do this
automatically using cloud-init.