1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/virt-expanding-vm-disk-pvc.adoc
2025-11-18 16:29:25 +01:00

71 lines
2.0 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/virtual_machines/virtual_disks/virt-expanding-vm-disks.adoc
:_mod-docs-content-type: PROCEDURE
[id="virt-expanding-vm-disk-pvc_{context}"]
= Increasing a VM disk size by expanding the PVC of the disk
[role="_abstract"]
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 use the web console with the VM running. Alternatively, you can edit the PVC manifest in the CLI.
[NOTE]
====
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.
====
[id="virt-expanding-vm-disk-pvc-web-console_{context}"]
== Expanding a VM disk PVC in the web console
You can increase the size of a VM disk PVC in the web console without leaving the *VirtualMachines* page and with the VM running.
.Procedure
. In the *Administrator* or *Virtualization* perspective, open the *VirtualMachines* page.
. Select the running VM to open its *Details* page.
. Select the *Configuration* tab and click *Storage*.
. Click the options menu {kebab} next to the disk you want to expand. Select the *Edit* option.
+
The *Edit disk* dialog opens.
. In the *PersistentVolumeClaim size* field, enter the desired size.
. Click *Save*.
[NOTE]
====
You can enter any value greater than the current one. However, if the new value exceeds the available size, an error is displayed.
====
[id="virt-expanding-vm-disk-pvc-editing-manifest_{context}"]
== Expanding a VM disk PVC by editing its manifest
.Prerequisites
* You have installed the {oc-first}.
.Procedure
. Edit the `PersistentVolumeClaim` manifest of the VM disk that you want to expand:
+
[source,terminal]
----
$ oc edit pvc <pvc_name>
----
. Update the disk size:
+
[source,yaml]
----
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: vm-disk-expand
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 3Gi <1>
# ...
----
<1> Specify the new disk size.