This patch revisits the is_bound() condition for ports that
are about to be used as parent in a trunk. The existing
logic checked that for a port to be bound it is either an
unbound compute port or it is associated to a host. In pratice
only the latter suffices.
Partially-implements: blueprint vlan-aware-vms
Change-Id: I1c2c877b5cc421e05d97c7f528546a6a2c14aa46
Some drivers, like the Open vSwitch one, may restrict the creation of a
trunk from a bound port (i.e. prevents from creating trunks after a VM
is already booted on the port).
This limitation frees us from worrying about dataplane migrations for OVS
as trunk ports and regular ports are wired differently.
However, other drivers, like the Linux Bridge one, may not be affected by
this limitation, and the existing rule should be relaxed to allow the
operation based on whether not the driver can support it.
Partially-implements: blueprint vlan-aware-vms
Change-Id: Ia938eb7cc845f6f144924acdb0e333d23516fcca
A port that is currently in use as a trunk port or a subport cannot be
deleted. The trunk or subport that the port is owned by must be deleted
first.
Partially-implements: blueprint vlan-aware-vms
Change-Id: I35aec716b44b85a686c9d0f8f591d7d1ec21a794
Segmentation ID is meant to be an Integer as per model,
and as such it is best to attempt a conversion in case
it happens to be sent as string as done in [1]. The
failure mode in this case is not immediately obvious
as the ID range check fails and yet the ID is indeed
in range.
This patch also dedups some logic, clean up and add a
test.
[1] https://review.openstack.org/#/c/340624/7/neutronclient/osc/v2/trunk/subport.py@36
Partially-implements: blueprint vlan-aware-vms
Change-Id: I7ca4c93fdf0ab83088194e9a343448ed511d4cdb
This patch adds the following attributes to the trunk model:
* name: this is added for convenience, especially to speed
up resource lookup via CLI commands. This is also added
for consistency with other Neutron resources.
* admin_state_up: this is added for management needs. There
may be maintenance situations where preventing the user
from adding/removing subports to a trunk while in disabled
state is desired.
* status: this can be used to track the aggregate status
of all the resources (parent + subports) participating
into a trunk.
The API extension is modified accordingly, coverage added.
The hash for the trunk object is revised, while the object
version is left as is, since all of this is still unreleased.
The patch leaves the logic to handle the trunk status aggregation
to be added at a later date, whilst minor refactoring
improves readability and use of the database sessions.
Partially-implements: blueprint vlan-aware-vms
Change-Id: Ibe39378d43b1d63c2b006c2da574f52d9934a0df
This patch enables basic CRUD operations on trunk ports and defines
related API extensions. Trunk ports and sub-ports can be persisted
in the Neutron model and are made visible through the API, but the
L2 agent is not notified and no trunk ports or subports are actually
instantiated on compute hosts.
This one of the main patches in the series that implement the end
to end functionality.
Partially-implements: blueprint vlan-aware-vms
Co-Authored-By: Armando Migliaccio <armamig@gmail.com>
Change-Id: I26453eb9a1b25e116193417271400994ac57e4c1