1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/virt-hot-unplugging-bridge-network-interface-cli.adoc
2024-02-15 16:38:05 +00:00

64 lines
1.7 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/virtual_machines/vm_networking/virt-hot-plugging-network-interfaces.adoc
:_mod-docs-content-type: PROCEDURE
[id="virt-hot-unplugging-bridge-network-interface_{context}"]
= Hot unplugging a secondary network interface by using the CLI
You can remove a secondary network interface from a running virtual machine (VM).
[NOTE]
====
Hot unplugging is not supported for Single Root I/O Virtualization (SR-IOV) interfaces.
====
.Prerequisites
* Your VM must be running.
* The VM must be created on a cluster running {VirtProductName} 4.14 or later.
* The VM must have a bridge network interface attached.
.Procedure
. 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.
+
[source,terminal]
----
$ oc edit vm <vm_name>
----
+
.Example VM configuration
[source,yaml]
----
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: vm-fedora
template:
spec:
domain:
devices:
interfaces:
- name: defaultnetwork
masquerade: {}
# set the interface state to absent
- name: <secondary_nic>
state: absent # <1>
bridge: {}
networks:
- name: defaultnetwork
pod: {}
- name: <secondary_nic>
multus:
networkName: <nad_name>
# ...
----
<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.
. Remove the interface from the pod by migrating the VM:
+
[source,terminal]
----
$ virtctl migrate <vm_name>
----