1. Backport tempest-dsvm-lxd-rc from master to stable/pike
This is just to ignore some newer/changed tempest tests that the
pike release of nova-lxd doesn't support.
2. Fix up destroy method to ensure proper clean-up
Cherry-picked from: 6b56b30e8b. This cleans up the destroy method
to ensure that both the containers are deleted if the destroy method is
called whilst and instance is in rescued mode.
Change-Id: Iaceb4bd9c91c07471259cea8e3e337150823c702
As result it is possible to use nova configuration option
'resume_guests_state_on_host_boot' option.
This option allow to keep instance RUNNING state across reboots
so if instance was in RUNNING state before reboot it will
started after reboot.
Change-Id: I884e0d1bf136488c1930673b25a560d0add12beb
Closes-Bug: 1708393
If LXD instance on host lost for some reason (corrupted, host
reinstall) but present in controller DB nova compute service
on compute node fails to start.
Nova manager asks LXD driver about instance info and got
LXD specific exception instead of responce or proper InstanceNotFound.
As result nova compute manager service became unusable - it does not
even register itself in controller and shown as 'down'.
Change-Id: I98b6b7ec0a9ccd31aa6d46ec3dedb923022cfcca
Closes-Bug: 1708589
Attempt to detect if image imported from glance is in unified LXD format
(metadata + rootfs/) and import this image to LXD 'as is' if any -
without implicit metdata injection.
Existing behavior leads to unusable for instance creation LXD images
if they are in unified format and imported via nova LXD driver
as LXD can not instantiate rootfs properly for such images
Simple use case does not work without this fix:
1. create instance -> create snapshot -> launch instance from snapshot
image
Image format identification is straightforward - attempt to search
metadata.yaml in tarball /. If found 'unified' format assumed.
Additional issues fixed:
1. fixed issue when instance from snapshot image can not be launched
on compute node where snapshot was created. The reason is image
already present in LXD without glance alias after snapshot creation.
As result nova tries to import it again from glance and got error
from LXD - "Image with same fingerprint already exists".
Attempt to lookup LXD image also by fingerprint during import
and if any do not import but simply add required by nova alias.
Closes-Bug: 1651506
Change-Id: I77d3b7c8d7cf43d505fd86b294779dada204919a
Tempest has deprecated decorator 'tempest.test.attr' and
moved the same as stable interface to 'tempest.lib.decorators
.attr' in version 16.1.0.
Let's use the stable interface for attr decorator.
This will help Tempest to remove the deprecated decorator.
Change-Id: I8e0face1852df17d64ec667bf591d8bb3f0791be
Recently utils.last_bytes has moved to libvirt/utils.py in nova.
(2341a41eaee5152e95379e5ed38012270af82ef5). Duplicate the function
that was in nova/utils.py.
Also includes a fix for nova-lxd's gate:
Update test-requirements with wsgi-intercept
Closes-Bug: #1707096
Change-Id: Ie77c8e67e29e8a01bbf58ab9277c5110cd7c112e
Signed-off-by: Chuck Short <charles.short@ericsson.com>>
The nova-lxd driver has to take a slightly different approach
to virtual interface wiring due to a lack of an equivalent to
'launch and pause' in LXD.
For some interface types, the last mile tap device needs to
be present for vif plugging to complete successfully which
occurs prior to the instance being launched; This change
refactors the vif module to create veth pairs directly
in nova-lxd, rather than delegating this to LXD as part of
a bridged network interface type. This allows vif plugging
to complete prior to the instance being created in LXD.
The side effect of this change is that all currently supported
interface types are now configured as 'physical' interfaces
in LXD profiles for instances - wiring to bridges is handled
directly by the nova-lxd driver instead.
This change has been validated with:
ovs driver + iptables hybrid firewall driver
ovs driver + openvswitch native firewall driver
linuxbridge driver + iptables hybrid firewall driver
The VIF wiring approach is described in detail in the VIF
wiring documentation included in this change.
Closes-Bug: 1681758
Change-Id: Ic268e989d1ee19f696298fb1e0db729a00352a12
Misc fixes to bring tox targets back inline with general OpenStack
standards (py27 and py35 targets executed by default).
Deal with running 27 and 35 tests in succession.
This change also includes some fixes for coverage reporting; however
they are still currently broken due to mismatching module names
between nova-lxd and nova.virt.lxd.
Change-Id: If0079309a4c4b6b57fc6b5e6f0e947926b010f09
The nova-lxd driver does not currently implement the server diagnostic
feature; blacklist tests and reference open bug report for resolution
at some point in the future.
Change-Id: Ifb6e1b8524a7f75761866ed14c42abc49c5f4d9b
Related-Bug: 1700516
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
If two processes attempt to upload the same image at the same
time, the second will fail as the image alias will already have
been created by the first process.
Re-check by image alias as part of the lock context for the image
prior to syncing the image from glance to ensure that a duplicate
sync is not executed.
Change-Id: Ie5ef1fcf9170e18cf41767683036162fd509ee94
Closes-bug: 1697455
Correct typo in INSTALL_LXD setting.
Correctly set default for for LXD_GROUP.
Rewrite gate pre-test hook to use DEVSTACK_LOCAL_CONFIG.
Use central Cirros version and architecture.
Drop use of Xenial images for tempest tests.
Split out tempest configuration into test-config phase.
Change-Id: Iff0f0a501dae13e2306b9efb87d06c0d917d6233
Refer to OpenStack Style Guidelines:
https://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises
[H203] Unit test assertions tend to give better messages for more
specific assertions. As a result, assertIsNone(xxx) is preferred over
assertEqual(None, xxx)
Change-Id: I8ccc344a40762ddc01253e23b533e27f3618d5f1
LXD has grown support for multiple storage pools
defined by name and type (btrfs, zfs, lvm, etc)
and we would like to support this in nova-lxd
Change-Id: I702d1600fdf70bfd1e2402e3455dd868e25214c0
The LXD API requires that data be passed as strings; pass the
readonly flag for config-drive support as a string to ensure
it can be parsed by LXD avoiding the following error:
json: cannot unmarshal bool into Go value of type string
Change-Id: I0c5dbd9cb8b8ea4f43398849f8b4c33305231d54
Closes-Bug: 1691428
python 2.x matched these correctly without the casts but a version
bump to python 3.x (identified in 3.5.3) changes the output, this
change casts to int when we expect an integer output
Change-Id: Id6010b95a3c90d5538497c9936a6484400436ca6
When LXD is using a ZFS backend, correctly report disk stats
based on the usage of the ZFS pool rather than the usage of
the filesystem at /var/lib/lxd.
Change-Id: I2f2b843156cdc47c2f3324d69c384f943a0e1499
Closes-Bug: 1680869
The /config-drive dir presented from the host OS should
be presented as read only to ensure that the instance
can write directly to the host OS filesystem.
Change-Id: I997ef68048fa0a77f9cb0b70c325b9b96c079e2f
Closes-Bug: 1675741
Proposed changes to cloud-init under the same bug will
introduce behaviour to support a config-drive type concept
for LXD containers at /config-drive.
The current path is broken; switch to this new path to
support offline configuration of cloud instances.
Change-Id: I4996a34f84eb088c408a6454de9281908490a8eb
Closes-Bug: 1673411
The scenario tests base class from Tempest is not a stable interface
and it's going to be refactored on Tempest side, as notified in
http://lists.openstack.org/pipermail/openstack-dev/2017-February/112938.html
Maintain a local copy of the base class, taken from Tempest with head of
master at c5f1064759fe6c75a4bc5dc251ed1661845936cb.
Change-Id: I586d03848d96126640da030e393d468cd613a58a
Ensure that client attribute is passed to to_profile calls,
completing some refactoring earlier during the Ocata cycle.
This resolved issues with cold migration of containers between
compute hosts.
Change-Id: I6500349ecacd30a6cb7698fe3e0af2e1fb1817de
Closes-Bug: 1651006