nova-lxd/nova
James Page 16866d2cf8 Refactor container VIF handling for linuxbridge
Neutron recently changed behaviour to complete all bridge setup
and configuration for the linuxbridge driver via the neutron
linuxbridge agent, requiring Nova simply to setup the tap device
that subsequently gets plugged into a linuxbridge.

Rework plug/unplug handling based on libvirt driver to fallback
to a legacy style plug/unplug driver for tap devices of this kind.

In the case of LXD we actually still use a veth pair so that:

  a) security group rules are applied to the tap named
     device on the host.
  b) the container still gets part of a nic to use, named
     ethX internally to the container.
  c) the neutron linuxbridge agent can see the required tapXXX
     device prior to the container being created, allowing
     VIF plugging to be completed.

This looks something like this once wired and running:

           Host       |     Container

  [bridge] <-> [tapXXX|tinXXX] <-> [ethX]

The veth pair is mapping into a LXD container using the physical
LXD nic type.

As the drive now creates the veth pair for unbridged network
types, unplug must occur after the device has been removed
from the container during interface_detach.

Rework LXD device profile naming for consistency:

  a) VIFs attaching to bridges will be named inline with the
     bridge (no-change)
  b) VIFs not being attached to a bridge will be named with
     the VIF devname (changed from 'unbridged' which did not
     support any multiplicity).

Change-Id: I2fdf41e5640f5ca5e3bcd7df1aa159a65b706138
Closes-Bug: 1694719
2017-06-12 15:14:28 +01:00
..
tests/unit/virt/lxd Refactor container VIF handling for linuxbridge 2017-06-12 15:14:28 +01:00
virt Refactor container VIF handling for linuxbridge 2017-06-12 15:14:28 +01:00
__init__.py Fix nova-lxd driver loading 2016-05-11 10:06:16 -04:00