Skip to content

Commit 3b0616e

Browse files
authored
Merge pull request #32690 from bgaydosrh/CNV-6070
CNV-6070 Hot-plugging virtual disks
2 parents bc63ae1 + ff2ec69 commit 3b0616e

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed

_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2765,6 +2765,8 @@ Topics:
27652765
File: virt-storage-defaults-for-datavolumes
27662766
- Name: Creating and using boot sources
27672767
File: virt-creating-and-using-boot-sources
2768+
Name: Hot-plugging virtual disks
2769+
File: virt-hot-plugging-virtual-disks
27682770
- Name: Using container disks with virtual machines
27692771
File: virt-using-container-disks-with-vms
27702772
- Name: Preparing CDI scratch space
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virtual_machines/virtual_disks/virt-hot-plugging-virtual-disks.adoc
4+
5+
[id="virt-hot-plugging-a-virtual-disk-using-the-cli_{context}"]
6+
= Hot-plugging a virtual disk using the CLI
7+
8+
Hot-plug virtual disks that you want to attach to a virtual machine instance (VMI) while a virtual machine is running.
9+
10+
.Prerequisites
11+
* You must have a running virtual machine to hot-plug a virtual disk.
12+
* You must have at least one data volume or persistent volume claim (PVC) available for hot-plugging.
13+
14+
.Procedure
15+
16+
* Hot-plug a virtual disk by running the following command:
17+
+
18+
[source,terminal]
19+
----
20+
$ virtctl addvolume <virtual-machine|virtual-machine-instance> --volume-name=<datavolume|PVC> \
21+
[--persist] [--serial=<label-name>]
22+
----
23+
+
24+
** 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 interfaces.
25+
** 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.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virtual_machines/virtual_disks/virt-hot-plugging-virtual-disks.adoc
4+
5+
[id="virt-hot-unplugging-a-virtual-disk-using-the-cli_{context}"]
6+
= Hot-unplugging a virtual disk using the CLI
7+
8+
Hot-unplug virtual disks that you want to detach from a virtual machine instance (VMI) while a virtual machine is running.
9+
10+
.Prerequisites
11+
* Your virtual machine must be running.
12+
* You must have at least one data volume or persistent volume claim (PVC) available and hot-plugged.
13+
14+
.Procedure
15+
16+
* Hot-unplug a virtual disk by running the following command:
17+
+
18+
[source,terminal]
19+
----
20+
$ virtctl removevolume <virtual-machine|virtual-machine-instance> --volume-name=<datavolume|PVC>
21+
----
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[id="virt-hot-plugging-virtual-disks"]
2+
= Hot-plugging virtual disks
3+
include::modules/virt-document-attributes.adoc[]
4+
:context: virt-hot-plugging-virtual-disks
5+
6+
:FeatureName: Hot-plugging virtual disks
7+
include::modules/technology-preview.adoc[leveloffset=+1]
8+
9+
toc::[]
10+
11+
Hot-plug and hot-unplug virtual disks when you want to add or remove them without stopping your virtual machine or virtual machine instance. This capability is helpful when you need to add storage to a running virtual machine without incurring down-time.
12+
13+
When you _hot-plug_ a virtual disk, you attach a virtual disk to a virtual machine instance while the virtual machine is running.
14+
15+
When you _hot-unplug_ a virtual disk, you detach a virtual disk from a virtual machine instance while the virtual machine is running.
16+
17+
Only data volumes and persistent volume claims (PVCs) can be hot-plugged and hot-unplugged. You cannot hot-plug or hot-unplug container disks.
18+
19+
[WARNING]
20+
====
21+
When you attach a hot-plugged virtual disk to a virtual machine, you cannot perform live migration on the virtual machine. If you attempt to perform live migration on a virtual machine with a hot-plugged disk attached, live migration fails.
22+
====
23+
24+
include::modules/virt-hot-plugging-a-virtual-disk-using-the-cli.adoc[leveloffset=+1]
25+
include::modules/virt-hot-unplugging-a-virtual-disk-using-the-cli.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)