Commit Graph

18 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez c8427c82da [OVN] Check new added segments in OVN mech driver
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
2021-11-23 16:21:37 +00:00
Brian Haley 055036ba2b Improve terminology in the Neutron tree
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
2020-08-19 16:47:53 -04:00
Rodolfo Alonso Hernandez 380825fcf8 Check mech driver connectivity during port binding
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
2019-09-11 07:05:54 +00:00
Bence Romsics 74c51a2e53 Drive binding by placement allocation
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)
2019-03-09 22:03:51 +00:00
Lajos Katona a85c5ed3fb supported_vnic_type configurable for ovs
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)
2018-10-15 20:35:49 +02:00
Bo Chi 892c1ec690 fix same mechanism driver called twice bug
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
2018-02-01 18:51:39 +08:00
Boden R a2c36d7e00 use ml2 driver api from neutron-lib
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
2017-11-10 08:41:28 -07:00
Moshe Levi b184558ab6 ovs mech: bind only if user request switchdev
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
2017-09-12 15:01:50 +03:00
Boden R fde6710515 use MechanismDriver from neutron-lib + shim
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
2017-06-05 14:09:07 -06:00
Dongcan Ye 2d6290daf7 Add network_id in segment check log
For the purpose of debug, it will useful to know network_id in
check_segment_for_agent.

Change-Id: I16c4a9da6ae0e32f82d1e454500e2d7236169238
2017-04-21 16:37:57 +08:00
Boden R 7bd521e7ce use neutron_lib's portbindings api-def
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
2017-03-31 09:16:22 -06:00
Kevin Benton 3dddfa56db Macvtap: Check for no original port in is_live_migration
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
2017-02-17 17:41:17 +00:00
Andreas Scheuring 6865f4d9f2 macvtap: Mech driver detects invalid migration
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
2016-09-02 18:42:25 +00:00
Gary Kotton 49d25b3992 portbindings: use constants for extension keys
Use the constants defined in the portbindings extension.

TrivialFix

Change-Id: I90c3deeae9018d4e5b23283f64657d9f5d5723c7
2016-01-10 00:42:53 -08:00
Jenkins ca3cdaaa47 Merge "Refactor mlnx mechanism driver to support infiniband only" 2015-06-07 18:47:57 +00:00
Moshe Levi 9b29f62491 Refactor mlnx mechanism driver to support infiniband only
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
2015-06-01 10:24:09 +03:00
Robert Kukura 922dae45d0 Add unit tests for ML2 DVR port binding and fix PortContext inconsistencies
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
2015-05-11 17:03:31 -04:00
Maru Newby 1105782e39 Reorganize unit test tree
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
2015-04-06 23:28:31 +00:00