Grow a volume when it runs out of space. You can grow a volume while it’s attached to a running instance, without a restart. Volumes only grow: there’s no way to make a volume smaller.
Before you begin
- The volume’s URN.
- Permission
pvs.volume.updateon the volume. See Roles. - A volume that reports
AVAILABLEorINUSE. A volume inCREATINGcan’t be resized yet; wait forAVAILABLE. A volume inDELETING,DELETED, orERRORcan’t be resized. - No other resize in progress:
modificationStatusisCOMPLETEDorFAILED. - An active organization and a billing account that can pay. For card-managed billing, that means a verified payment method. See Add a payment method.
- Quota headroom for the growth. Only the growth counts: taking a 100 GiB volume to 120 GiB needs 20 GiB of headroom. See Limits.
Resize the volume
-
Check the volume’s current
sizeInGib,status, andmodificationStatus.Terminal window origin storage get-volume --volume-urn <volume-urn> -
Request a size larger than the current
sizeInGib.Terminal window origin storage resize-volume --volume-urn <volume-urn> \--size-in-gib 120With the API, use the
resizeVolumemutation:mutation {pvs {resizeVolume(input: {volumeUrn: "<volume-urn>"sizeInGib: 120}) {acceptedmessage}}}The volume reports
modificationStatus: RESIZING, andpendingSizeInGibshows the target size. -
Check the volume until
modificationStatusreportsCOMPLETEDandsizeInGibshows the new size.Terminal window origin storage get-volume --volume-urn <volume-urn>
Use the new space inside the guest
The platform grows the block device. It doesn’t change the partition table or the filesystem on it.
- On a running instance, the guest sees the larger disk without a restart. Grow the partition and then the filesystem, for example with
growpartand the filesystem’s own grow command. Many images do this at boot, so a restart also makes the space appear. - On a stopped instance or a detached volume, nothing is needed now. The instance sees the new size the next time it starts.
What the platform refuses
These requests are refused immediately with an error, and nothing about the volume changes, not even modificationStatus:
- A size equal to or smaller than the current
sizeInGib. Shrinking would truncate the filesystem on the disk. To use less storage, create a smaller volume, copy your data across at file level, and delete the old volume. A volume created from a snapshot can’t be smaller than the snapshot’s source volume, so a snapshot doesn’t help here. - A volume in a state other than
AVAILABLEorINUSE. - A resize while another one is in progress.
- A resize that would exceed your volume storage quota, from an inactive organization, or from a project whose billing account can’t pay.
If your usage is already over a limit, for example because the limit was lowered, no resize brings you back under it. Deleting volumes you no longer need frees quota, and a delete is never held to a quota.
If this fails
If the platform accepts the resize but can’t apply it, modificationStatus reports FAILED with a modificationStatusReason. The volume’s data is intact and sizeInGib still reports its real size. Request the resize again.