Check new segments added to OVN mechanism driver. This mechanism
driver does not inherit from ``SimpleAgentMechanismDriverBase``
because OVN has no agents (NOTE 1). However OVN mechanism driver
requires an OVN controller service in each deployed chassis. This
is how OVN driver knows the hosts using this backend.
The segments, attached to an external network (connected to a
physical network), can be mapped to a host if ther is a chassis (OVN
controller agent) in this host.
NOTE 1: OVN provides agent API compatibility, presenting the
controller and the metadata services as agents. But OVN mechanism
driver has no control or provides any information (via RPC) to
those services.
Closes-Bug: #1949967
Change-Id: I570b2251da8a4a25d155ba838346b24afafd727f
There is no real reason we should be using some of the
terms we do, they're outdated, and we're behind other
open-source projects in this respect. Let's switch to
using more inclusive terms in all possible places.
Change-Id: I99913107e803384b34cbd5ca588451b1cf64d594
In [1] the concept of "connectivity" was introduced for the ML2 drivers.
This parameter defines the mech driver connectivity type (layer 2, layer
3 only or legacy - not defined).
The spec defined in the blueprint allows to spawn a VM with ports
without IP addresses. As commented in the Nova spec [2], those ports can
be bound only to "l2" drivers.
[1] https://review.opendev.org/#/c/645645/
[2] https://review.opendev.org/#/c/641670/
bp boot-vm-with-unaddressed-port
Related-Bug: #1821058
Change-Id: I438cbab43b45b5f7afc820b77fcf5a0e823d0eff
Drive the choice of mechanism driver during binding as inferred from
the resource provider allocated by nova and as told to neutron via the
port's binding:profile.
As discussed on a neutron qos irc meeting some time ago
this patch introduces a new assumption on bind_port() implementations.
That is an implementation of bind_port() in any mech driver supporting
Guaranteed Minimum Bandwidth bind_port() must not have a non-idempotent
side effect. Because the last binding level will be redone for a 2nd
time with a narrowed down list of mechanism drivers. And if the 2nd call
does not give the same result as the first all kind of weird things can
happen.
Change-Id: I2b7573ec6795170ce45a13d5d0ad7844fb85182d
Depends-On: https://review.openstack.org/574781
Depends-On: https://review.openstack.org/635160
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
Now supported_vnic_types is hardcoded to the mechanism drivers, but that
can depend on several factors, like type of the NIC, admin decision,
etc.
With this patch we put the right to decide which vnic types are
supported for ovs agent into the hands of the admin, by allowing
blacklisting items from the mechanism driver specific list.
Background: http://eavesdrop.openstack.org/meetings/neutron_qos/2018/
neutron_qos.2018-07-31-15.00.log.html#l-58
Change-Id: I63e562e2eccc5b02c1c767d6a2c28cb803131e99
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
when a mechinism driver calls context.continue_binding to
continue binding, it will be called again because
_check_driver_to_bind compares driver name with driver.
Closes-Bug: #1745572
Change-Id: I62b32c9b9d01dd929fe8cd3634c78dc0cbe325b6
The ml2 plugin driver API was rehomed into neutron-lib with commit
Ifc829953ef4d5859c3475903965dc08aba42fd9c and the API was shimmed in
neutron with I86a10091b55d1123e8d16f16155e0312bb10e54c. This patch
consumes the ML2 driver api from neutron lib thereby removing the
driver_api module from neutron.
NeutronLibImpact
Change-Id: Ice49572e217eeaf820e48d40f2251d08766490b5
In I77650be5f04775a72e2bdf694f93988825a84b72 we added
vnic_type direct to the ovs mechanism drivers supported
vnic_types. This cause problems when working with ovs and sriovnicswitch
mechanism drivers in that order. In this case the ovs will bind
the direct port instead of the sriovnicswitch.
This change make ovs mech driver to bind the direct port only
if user requested --binding-profile '{"capabilities": ["switchdev"]}'
in the direct port if a user don't request this capability the SR-IOV
legacy NIC mode is used.
When enable-sriov-nic-features will be implemented in nova and
libvirt will expose the switchdev capability then nova will be
able to select a host which supports SR-IOV nic with switchdev
mode.
[1] - https://review.openstack.org/#/c/435954/11/specs/pike/approved/enable-sriov-nic-features.rst
[2] - https://www.redhat.com/archives/libvir-list/2017-August/msg00583.html
Closes-Bug: #1713590
Change-Id: I0b5f062bcbf02381bdf4f694fc039f9bb17a2db5
The ml2 MechanismDriver is now in neutron-lib along with its associated
constants. This patch switches over to the lib versions of those, but
leaves a shim of the MechanismDriver that just ref's the driver from
lib. This shim allows our broad consumer base of the driver to switch
over at their leisure.
NeutronLibImpact
Change-Id: I99e3de6d933a1bb341394f85415fb07306a82a01
Neutron-lib 1.1.0 is now out and contains the portbindings
API definition (as per commit [1]). This patch moves neutron
references over to the neutron-lib version.
NeutronLibImpact
- Consumers using the public constants within neutron's
portbindings API extension must now use the values
from neutron-lib.
[1] 87e42f993c07ae320159d5123662ee9f3bd4d903
Change-Id: I669af9b4c712877772d91a03857ab108714001d4
Change 6865f4d9f2 mistakenly
assumed that None would not be present for the 'original'
property on a PortContext. However, this is the default value
for the original field in PortContext, which is what is used
in the construction as part of the _create_port_db process
in ML2.
This resulted in binding failures for the macvtap mech drivers
due to an attribute error in cases like brand new ports.
This patch simply checks for None before trying to determine
if it's a live migration (which it isn't in the case of port creation).
Part of the issue is likely that the FakePortContext in the unit tests
was defaulting to an empty dict which is the not the same behavior as
the real PortContext.
Change-Id: I6659235a70aa4528fd21911c04e651194591e449
Closes-Bug: #1658802
As of today, Macvtap agent allows invalid live migrations
from a host with interface mapping 'physnet1:eth1' to a host
with mapping 'physnet1:eth2'. Migration places the macvtap on
the target on 'eth2' instead of 'eth1'. This fix detects
such a migration in the mech driver and lets the portbinding fail.
Nova will put the instance in error state. The instance might
still be able to access the wrong network it migrated to, as
today there is no communication to the agent after a failed binding
after a migration. But at least the user is now aware that
something went wrong.
Change-Id: I92cd6411fe88483b921c92f219afa8e846cc0137
Depends-On: Ib1cc44bf9d01baf4d1f1d26c2a368a5ca7c6ab68
Partial-Bug: #1550400
The old mlnx mechanism driver was used for SR-IOV with Ethernet
and infiniband support but the PCI allocation wasn't done by nova.
Juno introduced sriovnicswitch mechanism driver for SR-IOV with
Ethernet support. Mellanox recommends on using it.
The updated mlnx mechanism driver supports SR-IOV infiniband.
* support only port vnic_type 'direct'
* update vif_type name to ib_hostdev (the ib_hostdev is generic vif_type
for SR-IOV infiniband see https://review.openstack.org/#/c/187052/)
Closes-Bug: #1460430
DocImpact
Change-Id: Ia822b492afdfeb1aecf373d5a8cdb72174512884
Extends the existing ML2 port binding unit tests to cover the
distributed port bindings used for DVR. Within the test mechanism
driver, bindings are tracked per-host, and additional assertions are
added.
Fixes issues with PortContext attributes that were exposed by these
new tests. Adds new vif_type, original_vif_type, vif_details, and
original_vif_details PortContext attributes, similar to the exising
host, original_host, status, and original_status attributes, to
reflect host-specific details of distributed (or normal) port
bindings. Also fixes original_host and original_status to return None
when in the context of an operation other than an update, and fixes
original_host to reflect the specific host being bound for a
distributed port.
Closes-bug: 1453943
Closes-bug: 1453955
Change-Id: I467db0d48e4b82fdaad8d851e294e639a84a8160
This change ensures that the structure of the unit test tree matches
that of the code tree to make it obvious where to find tests for a
given module. A check is added to the pep8 job to protect against
regressions.
The plugin test paths are relocated to neutron/tests/unit/plugins
but are otherwise ignored for now.
Change-Id: If307593259139171be21a71c58e3a34bf148cc7f
Partial-Bug: #1440834