From 7ba8f40134bf1f4dcb179a102cde1eea63f92aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Tue, 30 Jun 2020 16:49:57 -0400 Subject: [PATCH] QEMU/KVM: accept vmxnet3 NIC Add the ability to use vmxnet3 NIC on a host using the QEMU/KVM driver. Qemu supports the driver since version 1.5, and Libvirt can expose it properly. This allow the migration of an ESXi VM to QEMU/KVM, this without any driver changes. vmxnet3 comes with better performance, and lower latency comparing to an emulated driver like e1000. Change-Id: I95203af4ded9a4dbecfb7981b400f0fb988f2d47 --- nova/tests/unit/virt/libvirt/test_vif.py | 6 ++++-- nova/virt/libvirt/vif.py | 6 ++++-- releasenotes/notes/qemu-accept-vmxnet3-nic.yaml | 7 +++++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/qemu-accept-vmxnet3-nic.yaml diff --git a/nova/tests/unit/virt/libvirt/test_vif.py b/nova/tests/unit/virt/libvirt/test_vif.py index 25aca122cc79..5c37c650b672 100644 --- a/nova/tests/unit/virt/libvirt/test_vif.py +++ b/nova/tests/unit/virt/libvirt/test_vif.py @@ -840,14 +840,16 @@ class LibvirtVifTestCase(test.NoDBTestCase): network_model.VIF_MODEL_RTL8139, network_model.VIF_MODEL_E1000, network_model.VIF_MODEL_E1000E, - network_model.VIF_MODEL_SPAPR_VLAN) + network_model.VIF_MODEL_SPAPR_VLAN, + network_model.VIF_MODEL_VMXNET3) else: supported = (network_model.VIF_MODEL_NE2K_PCI, network_model.VIF_MODEL_PCNET, network_model.VIF_MODEL_RTL8139, network_model.VIF_MODEL_E1000, network_model.VIF_MODEL_E1000E, - network_model.VIF_MODEL_SPAPR_VLAN) + network_model.VIF_MODEL_SPAPR_VLAN, + network_model.VIF_MODEL_VMXNET3) for model in supported: image_meta = objects.ImageMeta.from_dict( {'properties': {'hw_vif_model': model}}) diff --git a/nova/virt/libvirt/vif.py b/nova/virt/libvirt/vif.py index 15e7fabdb1b1..e2b86a8b88c9 100644 --- a/nova/virt/libvirt/vif.py +++ b/nova/virt/libvirt/vif.py @@ -67,7 +67,8 @@ SUPPORTED_VIF_MODELS = { network_model.VIF_MODEL_E1000, network_model.VIF_MODEL_E1000E, network_model.VIF_MODEL_LAN9118, - network_model.VIF_MODEL_SPAPR_VLAN], + network_model.VIF_MODEL_SPAPR_VLAN, + network_model.VIF_MODEL_VMXNET3], 'kvm': [ network_model.VIF_MODEL_VIRTIO, network_model.VIF_MODEL_NE2K_PCI, @@ -75,7 +76,8 @@ SUPPORTED_VIF_MODELS = { network_model.VIF_MODEL_RTL8139, network_model.VIF_MODEL_E1000, network_model.VIF_MODEL_E1000E, - network_model.VIF_MODEL_SPAPR_VLAN], + network_model.VIF_MODEL_SPAPR_VLAN, + network_model.VIF_MODEL_VMXNET3], 'xen': [ network_model.VIF_MODEL_NETFRONT, network_model.VIF_MODEL_NE2K_PCI, diff --git a/releasenotes/notes/qemu-accept-vmxnet3-nic.yaml b/releasenotes/notes/qemu-accept-vmxnet3-nic.yaml new file mode 100644 index 000000000000..a5aef594ecaa --- /dev/null +++ b/releasenotes/notes/qemu-accept-vmxnet3-nic.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Add the ability to use ``vmxnet3`` NIC on a host using the QEMU/KVM driver. This allows + the migration of an ESXi VM to QEMU/KVM, without any driver changes. ``vmxnet3`` + comes with better performance and lower latency comparing to an emulated driver like + ``e1000``.