1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00

Merge pull request #100813 from openshift-cherrypick-robot/cherry-pick-100539-to-enterprise-4.21

[enterprise-4.21] CNV-61644: Disk hotplug with virtio-blk devices
This commit is contained in:
Ashleigh Brennan
2025-10-20 15:03:14 -05:00
committed by GitHub
3 changed files with 12 additions and 18 deletions

View File

@@ -8,7 +8,7 @@
You can hot plug and hot unplug a disk while a virtual machine (VM) is running by using the command line.
You can make a hot plugged disk persistent so that it is permanently mounted on the VM.
The hot plugged disk remains attached to the VM until you unplug it.
.Prerequisites
@@ -22,10 +22,10 @@ You can make a hot plugged disk persistent so that it is permanently mounted on
----
$ virtctl addvolume <virtual-machine|virtual-machine-instance> \
--volume-name=<datavolume|PVC> \
[--persist] [--serial=<label-name>]
[--bus <bus_type>] [--serial=<label_name>]
----
+
** Use the optional `--persist` flag to add the hot plugged disk to the virtual machine specification as a permanently mounted virtual disk. Stop, restart, or reboot the virtual machine to permanently mount the virtual disk. After specifying the `--persist` flag, you can no longer hot plug or hot unplug the virtual disk. The `--persist` flag applies to virtual machines, not virtual machine instances.
** The optional `--bus` flag allows you to specify the bus type of the added disk. The options are `virtio` and `scsi`. The default bus type is `virtio`.
** The optional `--serial` flag allows you to add an alphanumeric string label of your choice. This helps you to identify the hot plugged disk in a guest virtual machine. If you do not specify this option, the label defaults to the name of the hot plugged data volume or PVC.
* Hot unplug a disk by running the following command:

View File

@@ -10,8 +10,6 @@ You can hot plug a disk by attaching it to a virtual machine (VM) while the VM i
The hot plugged disk remains attached to the VM until you unplug it.
You can make a hot plugged disk persistent so that it is permanently mounted on the VM.
.Prerequisites
* You must have a data volume or persistent volume claim (PVC) available for hot plugging.
@@ -20,16 +18,16 @@ You can make a hot plugged disk persistent so that it is permanently mounted on
. Navigate to *Virtualization* -> *VirtualMachines* in the web console.
. Select a running VM to view its details.
. On the *VirtualMachine details* page, click *Configuration* -> *Disks*.
. On the *VirtualMachine details* page, click *Configuration* -> *Storage*.
. Add a hot plugged disk:
.. Click *Add disk*.
.. Click *Add*.
.. In the *Add disk (hot plugged)* window, select the disk from the *Source* list and click *Save*.
. Optional: Select the type of the interface bus. The options are *VirtIO* and *SCSI*. The default bus type is *VirtIO*.
. Optional: Change the type of the interface bus of an existing hot plugged disk:
.. Click the Options menu {kebab} beside the disk and select the *Edit* option.
.. In the *Interface* field, select the desired option.
. Optional: Unplug a hot plugged disk:
.. Click the Options menu {kebab} beside the disk and select *Detach*.
.. Click *Detach*.
. Optional: Make a hot plugged disk persistent:
.. Click the Options menu {kebab} beside the disk and select *Make persistent*.
.. Reboot the VM to apply the change.

View File

@@ -10,20 +10,16 @@ You can add or remove virtual disks without stopping your virtual machine (VM) o
Only data volumes and persistent volume claims (PVCs) can be hot plugged and hot-unplugged. You cannot hot plug or hot-unplug container disks.
A hot plugged disk remains attached to the VM even after reboot. You must detach the disk to remove it from the VM.
You can make a hot plugged disk persistent so that it is permanently mounted on the VM.
A hot plugged disk remains attached to the VM even after reboot. You must unplug the disk to remove it from the VM.
[NOTE]
====
Each VM has a `virtio-scsi` controller so that hot plugged disks can use the `scsi` bus. The `virtio-scsi` controller overcomes the limitations of `virtio` while retaining its performance advantages. It is highly scalable and supports hot plugging over 4 million disks.
Each VM has a `virtio-scsi` controller so that hot plugged disks can use the SCSI bus. The `virtio-scsi` controller overcomes the limitations of VirtIO while retaining its performance advantages. It is highly scalable and supports hot plugging over 4 million disks.
Regular `virtio` is not available for hot plugged disks because it is not scalable. Each `virtio` disk uses one of the limited PCI Express (PCIe) slots in the VM. PCIe slots are also used by other devices and must be reserved in advance. Therefore, slots might not be available on demand.
When you hot plug disks to the VirtIO (`virtio-blk`) bus, each disk uses a PCI Express (PCIe) slot in the VM. The number of PCIe slots is limited and pre-set automatically at the VM creation as specified in the link:https://kubevirt.io/user-guide/storage/hotplug_volumes/#available-virtio-ports[Available VirtIO Ports] table. Therefore, you can use `virtio-blk` for a small number of disks that does not exceed the number of available slots.
====
include::modules/virt-hot-plugging-disks-ui.adoc[leveloffset=+1]
include::modules/virt-hot-plugging-disk-cli.adoc[leveloffset=+1]