From 03ab18d4599183d13dceb6d1130358f717197136 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 23 Jul 2020 09:29:51 -0400 Subject: [PATCH] Supports 'virtio-forwarder' vnic type for port Supports the 'virtio-forwarder' vnic type for port sync with Neutron. The 'virtio-forwarder' is an indirect mode for SR-IOV interfaces used to connect the instances into the Neutron networks. It has been supported since the Queens release: I28315fb12f62dc7d52d099c211086b2b81eca39a Note that 'virtio-forwarder' is already supported by Horizon: openstack_dashboard/api/neutron.py: ('virtio-forwarder', _('Virtio Forwarder')) Nova: nova/network/model.py: VNIC_TYPE_VIRTIO_FORWARDER = 'virtio-forwarder' openstackclient: openstackclient/network/v2/port.py: choices=(...), virtio-forwarder neutron-lib: neutron_lib/api/definitions/portbindings.py VNIC_VIRTIO_FORWARDER = 'virtio-forwarder' Task: 40435 Change-Id: Ie65f8858d6d1a1854702eb33c40ea827505bfe51 --- heat/engine/resources/openstack/neutron/port.py | 3 ++- heat/tests/openstack/neutron/test_neutron_port.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/heat/engine/resources/openstack/neutron/port.py b/heat/engine/resources/openstack/neutron/port.py index 4ea844121e..de2c1db0ef 100644 --- a/heat/engine/resources/openstack/neutron/port.py +++ b/heat/engine/resources/openstack/neutron/port.py @@ -283,7 +283,8 @@ class Port(neutron.NeutronResource): 'the bindings extension.'), constraints=[ constraints.AllowedValues(['normal', 'direct', 'macvtap', - 'direct-physical', 'baremetal']), + 'direct-physical', 'baremetal', + 'virtio-forwarder']), ], support_status=support.SupportStatus(version='2015.1'), update_allowed=True, diff --git a/heat/tests/openstack/neutron/test_neutron_port.py b/heat/tests/openstack/neutron/test_neutron_port.py index 4b414d1de3..78485c9880 100644 --- a/heat/tests/openstack/neutron/test_neutron_port.py +++ b/heat/tests/openstack/neutron/test_neutron_port.py @@ -1021,6 +1021,11 @@ class UpdatePortTest(common.HeatTestCase): fixed_ips=None, addr_pair=None, vnic_type='baremetal')), + ('virtio_forwarder_vnic', dict(secgrp=None, + value_specs={}, + fixed_ips=None, + addr_pair=None, + vnic_type='virtio-forwarder')), ('with_all', dict(secgrp=['8a2f582a-e1cd-480f-b85d-b02631c10656'], value_specs={}, fixed_ips=[