You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
= Hot plugging a bridge network interface using the CLI
7
+
= Hot plugging a secondary network interface by using the CLI
8
8
9
-
Hot plug a bridge network interface to a virtual machine (VM) while the VM is running.
9
+
Hot plug a secondary network interface to a virtual machine (VM) while the VM is running.
10
10
11
11
.Prerequisites
12
12
13
13
* A network attachment definition is configured in the same namespace as your VM.
14
14
* You have installed the `virtctl` tool.
15
+
* You have installed the OpenShift CLI (`oc`).
15
16
16
17
.Procedure
17
18
@@ -22,21 +23,45 @@ Hot plug a bridge network interface to a virtual machine (VM) while the VM is ru
22
23
$ virtctl start <vm_name>
23
24
----
24
25
25
-
. Use the following command to hot plug a new network interface to the running VM. The `virtctl addinterface` command adds the new network interface to the VM and virtual machine instance (VMI) specification but does not attach it to the running VM.
26
+
. 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.
<vm_name>:: Specifies the name of the `VirtualMachine` object.
35
-
<net_attach_def_name>:: Specifies the name of `NetworkAttachmentDefinition` object.
36
-
<interface_name>:: Specifies the name of the new network interface.
33
+
.Example VM configuration
34
+
[source,yaml]
35
+
----
36
+
apiVersion: kubevirt.io/v1
37
+
kind: VirtualMachine
38
+
metadata:
39
+
name: vm-fedora
40
+
template:
41
+
spec:
42
+
domain:
43
+
devices:
44
+
interfaces:
45
+
- name: defaultnetwork
46
+
masquerade: {}
47
+
# new interface
48
+
- name: <secondary_nic> # <1>
49
+
bridge: {}
50
+
networks:
51
+
- name: defaultnetwork
52
+
pod: {}
53
+
# new network
54
+
- name: <secondary_nic> # <2>
55
+
multus:
56
+
networkName: <nad_name> # <3>
57
+
# ...
58
+
----
59
+
<1> Specifies the name of the new network interface.
60
+
<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.
61
+
<3> Specifies the name of the `NetworkAttachmentDefinition` object.
37
62
38
63
39
-
. To attach the network interface to the running VM, live migrate the VM by using the following command:
64
+
. To attach the network interface to the running VM, live migrate the VM by running the following command:
= Hot unplugging a bridge network interface using the CLI
7
+
= Hot unplugging a secondary network interface by using the CLI
8
8
9
-
You can remove a bridge network interface from a running virtual machine (VM).
9
+
You can remove a secondary network interface from a running virtual machine (VM).
10
+
11
+
[NOTE]
12
+
====
13
+
Hot unplugging is not supported for Single Root I/O Virtualization (SR-IOV) interfaces.
14
+
====
10
15
11
16
.Prerequisites
12
17
@@ -16,12 +21,40 @@ You can remove a bridge network interface from a running virtual machine (VM).
16
21
17
22
.Procedure
18
23
19
-
. Hot unplug a bridge network interface by running the following command. The `virtctl removeinterface` command detaches the network interface from the guest, but the interface still exists in the pod.
24
+
. 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.
<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.
25
58
26
59
. Remove the interface from the pod by migrating the VM:
You can add or remove secondary network interfaces without stopping your virtual machine (VM). {VirtProductName} supports hot plugging and hot unplugging for Linux bridge interfaces that use the VirtIO device driver.
9
+
You can add or remove secondary network interfaces without stopping your virtual machine (VM). {VirtProductName} supports hot plugging for secondary interfaces that use the VirtIO device driver.
10
10
11
-
:FeatureName: Hot plugging and hot unplugging bridge network interfaces
12
-
include::snippets/technology-preview.adoc[]
11
+
[NOTE]
12
+
====
13
+
Hot unplugging is not supported for Single Root I/O Virtualization (SR-IOV) interfaces.
* xref:../../virt/vm_networking/virt-connecting-vm-to-linux-bridge.adoc#creating-linux-bridge-nad[Creating a Linux bridge network attachment definition]
36
+
* xref:../../virt/vm_networking/virt-connecting-vm-to-linux-bridge.adoc#creating-linux-bridge-nad[Creating a Linux bridge network attachment definition]
37
+
* xref:../../virt/vm_networking/virt-connecting-vm-to-linux-bridge.adoc#configuring-vm-network-interface[Connecting a virtual machine to a Linux bridge network]
38
+
* xref:../../virt/vm_networking/virt-connecting-vm-to-sriov.adoc#nw-sriov-network-attachment_virt-connecting-vm-to-sriov[Creating an SR-IOV network attachment definition]
39
+
* xref:../../virt/vm_networking/virt-connecting-vm-to-sriov.adoc#virt-attaching-vm-to-sriov-network_virt-connecting-vm-to-sriov[Connecting a virtual machine to an SR-IOV network]
0 commit comments