This is a cache of https://docs.okd.io/4.17/virt/virtual_machines/virtual_disks/virt-expanding-vm-disks.html. It is a snapshot of the page at 2026-04-01T02:38:05.801+0000.
Expanding VM disks - Virtual machines | Virtualization | OKD 4.17
×

Expand the persistent volume claim (PVC) of your virtual machine disk to accomodate growing data requirements. If your storage provider does not support volume expansion, you can expand the available virtual storage of a VM by adding blank data volumes.

You cannot reduce the size of a VM disk.

Expanding a VM disk PVC by using the cli

You can increase the size of a virtual machine (VM) disk by expanding the persistent volume claim (PVC) of the disk. To specify the increased PVC volume, you can edit the PersistentVolumeClaim manifest by using the OpenShift cli (oc).

If the PVC uses the file system volume mode, the disk image file expands to the available size while reserving some space for file system overhead.

Prerequisites
  • You have installed the OpenShift cli (oc).

Procedure
  1. Edit the PersistentVolumeClaim manifest of the VM disk that you want to expand:

    $ oc edit pvc <pvc_name>
  2. Update the disk size:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
       name: vm-disk-expand
    spec:
      accessModes:
         - ReadWriteMany
      resources:
        requests:
           storage: 3Gi
    # ...
    • spec.resources.requests.storage specifies the new disk size.

Expanding available virtual storage by adding blank data volumes

You can expand the available storage of a virtual machine (VM) by adding blank data volumes.

Prerequisites
  • You must have at least one persistent volume.

Procedure
  1. Create a DataVolume manifest as shown in the following example:

    Example DataVolume manifest
    apiVersion: cdi.kubevirt.io/v1beta1
    kind: DataVolume
    metadata:
      name: blank-image-datavolume
    spec:
      source:
        blank: {}
      storage:
        resources:
          requests:
            storage: <2Gi>
      storageClassName: "<storage_class>"
    • spec.storage.resources.requests.storage specifies the amount of available space requested for the data volume.

    • spec.storageClassName is an optional field that specifies a storage class. If you do not specify a storage class, the default storage class is used.

  2. Create the data volume by running the following command:

    $ oc create -f <blank-image-datavolume>.yaml