Skip to content

Commit e0ba372

Browse files
authored
Merge pull request #96190 from sjhala-ccs/cnv-62386
CNV-62386: Updated VM NIC hot plug/unplug docs
2 parents 99e2108 + f003959 commit e0ba372

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

modules/virt-hot-plugging-bridge-network-interface-cli.adoc

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ Hot plug a secondary network interface to a virtual machine (VM) while the VM is
1212

1313
* A network attachment definition is configured in the same namespace as your VM.
1414
* You have installed the `virtctl` tool.
15-
* You have installed the OpenShift CLI (`oc`).
16-
* You have permission to create and list `VirtualMachineInstanceMigration` objects.
15+
* You have installed the {oc-first}.
1716
1817
.Procedure
1918

@@ -24,12 +23,7 @@ Hot plug a secondary network interface to a virtual machine (VM) while the VM is
2423
$ virtctl start <vm_name> -n <namespace>
2524
----
2625

27-
. Use the following command to add the new network interface to the running VM. Editing the VM specification adds the new network interface to the VM and virtual machine instance (VMI) configuration but does not attach it to the running VM.
28-
+
29-
[source,terminal]
30-
----
31-
$ oc edit vm <vm_name>
32-
----
26+
. Use your preferred text editor to edit the `VirtualMachine` manifest, as shown in the following example:
3327
+
3428
.Example VM configuration
3529
[source,yaml]
@@ -61,13 +55,18 @@ template:
6155
<2> Specifies the name of the network. This must be the same as the `name` of the new network interface that you defined in the `template.spec.domain.devices.interfaces` list.
6256
<3> Specifies the name of the `NetworkAttachmentDefinition` object.
6357

58+
. Save your changes and exit the editor.
6459

65-
. To attach the network interface to the running VM, live migrate the VM by running the following command:
60+
. For the new configuration to take effect, apply the changes by running the following command. Applying the changes triggers automatic VM live migration and attaches the network interface to the running VM.
6661
+
6762
[source,terminal]
6863
----
69-
$ virtctl migrate <vm_name>
64+
$ oc apply -f <filename>.yaml
7065
----
66+
+
67+
where:
68+
69+
<filename>:: Specifies the name of your `VirtualMachine` manifest YAML file.
7170

7271
.Verification
7372

@@ -90,7 +89,7 @@ kubevirt-migrate-vm-lj62q Running vm-fedora
9089
kubevirt-migrate-vm-lj62q Succeeded vm-fedora
9190
----
9291

93-
. Verify that the new interface is added to the VM by checking the VMI status:
92+
. Verify that the new interface is added to the VM by checking the status of the virtual machine instance (VMI):
9493
+
9594
[source,terminal]
9695
----

modules/virt-hot-unplugging-bridge-network-interface-cli.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,11 @@ Hot unplugging is not supported for Single Root I/O Virtualization (SR-IOV) inte
1818
* Your VM must be running.
1919
* The VM must be created on a cluster running {VirtProductName} 4.14 or later.
2020
* The VM must have a bridge network interface attached.
21-
* You have permission to create and list `VirtualMachineInstanceMigration` objects.
2221
* You have installed the {oc-first}.
2322
2423
.Procedure
2524

26-
. Edit the VM specification to hot unplug a secondary network interface. Setting the interface state to `absent` detaches the network interface from the guest, but the interface still exists in the pod.
27-
+
28-
[source,terminal]
29-
----
30-
$ oc edit vm <vm_name>
31-
----
25+
. Using your preferred text editor, edit the `VirtualMachine` manifest file and set the interface state to `absent`. Setting the interface state to `absent` detaches the network interface from the guest, but the interface still exists in the pod.
3226
+
3327
.Example VM configuration
3428
[source,yaml]
@@ -58,9 +52,15 @@ template:
5852
----
5953
<1> Set the interface state to `absent` to detach it from the running VM. Removing the interface details from the VM specification does not hot unplug the secondary network interface.
6054

61-
. Remove the interface from the pod by migrating the VM:
55+
. Save your changes and exit the editor.
56+
57+
. For the new configuration to take effect, apply the changes by running the following command. Applying the changes triggers automatic VM live migration and removes the interface from the pod.
6258
+
6359
[source,terminal]
6460
----
65-
$ virtctl migrate <vm_name>
61+
$ oc apply -f <filename>.yaml
6662
----
63+
+
64+
where:
65+
66+
<filename>:: Specifies the name of your `VirtualMachine` manifest YAML file.

0 commit comments

Comments
 (0)