Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/virt-expanding-storage-with-data-volumes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ spec:
storage:
resources:
requests:
storage: <2Gi> <1>
storageClassName: "<storage_class>" <2>
storage: <2Gi>
storageClassName: "<storage_class>"
----
<1> Specify the amount of available space requested for the data volume.
<2> Optional: If you do not specify a storage class, the default storage class is used.
** `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.

. Create the data volume by running the following command:
+
Expand Down
46 changes: 46 additions & 0 deletions modules/virt-expanding-vm-disk-pvc-cli.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// 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-cli_{context}"]
= Expanding a VM disk PVC by using the CLI

[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 edit the `PersistentVolumeClaim` manifest by using the {oc-first}.

[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.
====

.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
# ...
----
** `spec.resources.requests.storage` specifies the new disk size.
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@
// * 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
[id="virt-expanding-vm-disk-pvc-web-console_{context}"]
= Expand a VM disk PVC by using the web console

[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.
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 *VirtualMachines* page in the web console, with the VM running.

[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.
Expand All @@ -28,43 +23,9 @@ You can increase the size of a VM disk PVC in the web console without leaving th
+
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.
. Click *Save*.
18 changes: 9 additions & 9 deletions virt/managing_vms/virtual_disks/virt-expanding-vm-disks.adoc
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
:_mod-docs-content-type: ASSEMBLY
include::_attributes/common-attributes.adoc[]
[id="virt-expanding-vm-disks"]
= Expanding virtual machine disks
include::_attributes/common-attributes.adoc[]
:context: virt-expanding-vm-disks

toc::[]

[role="_abstract"]
You can increase the size of a virtual machine (VM) disk by expanding the persistent volume claim (PVC) of the disk.

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.

include::modules/virt-expanding-vm-disk-pvc.adoc[leveloffset=+1]
include::modules/virt-expanding-vm-disk-pvc-web-console.adoc[leveloffset=+1]

[role="_additional-resources"]
.Additional resources for volume expansion
* link:https://docs.microsoft.com/en-us/windows-server/storage/disk-management/extend-a-basic-volume[Extending a basic volume in Windows]
* link:https://access.redhat.com/solutions/29095[Extending an existing file system partition without destroying data in Red Hat Enterprise Linux]
* link:https://access.redhat.com/solutions/24770[Extending a logical volume and its file system online in Red Hat Enterprise Linux]
include::modules/virt-expanding-vm-disk-pvc-cli.adoc[leveloffset=+1]

include::modules/virt-expanding-storage-with-data-volumes.adoc[leveloffset=+1]

[role="_additional-resources"]
.Additional resources for data volumes
[id="additional-resources_{context}"]
== Additional resources
* link:https://docs.microsoft.com/en-us/windows-server/storage/disk-management/extend-a-basic-volume[Extending a basic volume in Windows]
* link:https://access.redhat.com/solutions/29095[Extending an existing file system partition without destroying data in Red Hat Enterprise Linux]
* link:https://access.redhat.com/solutions/24770[Extending a logical volume and its file system online in Red Hat Enterprise Linux]
* xref:../../../virt/storage/virt-using-preallocation-for-datavolumes.adoc#virt-using-preallocation-for-datavolumes[Configuring preallocation mode for data volumes]
* xref:../../../virt/storage/virt-managing-data-volume-annotations.adoc#virt-managing-data-volume-annotations[Managing data volume annotations]