Cherry-pick from master: f1bbc03b65
LXD 3.x onwards removes the key 'storage.zfs_pool_name' from the config.
This means the storage_pool API needs to be used to get the name of the
pool that juju is using for ZFS. This is a temporary fix until storage
pools can be threaded into nova-lxd properly. This occurs on bionic due
to LXD 3 being shipped as standard.
Change-Id: Ic80ad942759718785b62e4fc887ded0a345bb260
Related-Bug: #1782329
Exsiting config drive creation flow assume that LXD
ALWAYS return UID mapping for instance.
For privieged this is not true, as not UID mapping perfomed.
Existing code which try simply split JSON answer and
lookup in it failed as result.
Parser switched to JSON based parsing and have fallback
to zero UID if no mapping found in LXD answer.
Cherry-picked from: 5512808831
Change-Id: I263f4d4e460f798c83a4628ea85182097dc40113
Related-Bug: 1707101
A previous commit added some code to delete the rescued comtainer
when the instance was in rescue mode. This means that there are two
containers for the instance (and thus using the profile). However, no
test was added at that stage. This patchset adds a test to verify that
the containers do get deleted and modifies the destroy code to also
ensure that the rescue container is also stopped before deletion.
Cherry-picked from: 6b56b30e8b
Change-Id: I7f81167c098dfdc24735f2f841cd21f6ce2cb1f4
This resolves issues with use of the reference configuration
in OpenStack Ocata or later.
Closes-Bug: 1660973
Change-Id: I02bf7f730f17503afd0ad1ff7671dddb264ef46d
Tempest deprecated tempest.test.requires_ext [1]
At this moment, it is available in tempest.common.utils
[1] https://review.openstack.org/#/c/493668/
Change-Id: Ie6a104d2cf6ccc4217df62a3784b8757457f3142
In case when unified image format is used it is possible
to pass file like object to pylxd API to import image to LXD.
In that case image not read to memory and nova-compute does
not utilize abnormal amount of RAM.
requirements.txt bumped pylxd to 2.2.5 as the change requires pylxd
change "Image import - memory hog fix"
(8588c3afb316299f204ae502b1c35dd7d7e3420e)
Change-Id: I4d47ab4e40b62925c0b63e7ac740f35709df1e3d
Closes-Bug: 1714415
Zuul no longer requires the project-name for in-repo configuration.
Omitting it makes forking or renaming projects easier.
Change-Id: Id88a23a4e98bb2a12300208f054a1637563bf963
This adds the flag "supports_multiattach" as False to the
driver's capabilities dictionary to enable it to work with
nova from commit baa8278ca78f onwards.
Change-Id: I08defc8b506a8936bd206885c189a5f1a393d260
* While running nova lxd tempest plugin with tempest, it gives
ERROR tempest ImportError: No module named nova_lxd_tempest_plugin.plugin.
It can be fixed by adding nova_lxd_tempest_plugin to site packages.
Change-Id: Id08618a497b0f9205680a97d31600481b92eab08
A recent change in nova[1] added an allocations argument to the
compute driver spawn function. Include it in nova-lxd's implementation
as well.
Also allow deletion of instances that are in a rescued state.
[1] https://review.openstack.org/#/c/511879/
Change-Id: Ie99ef6c7249b0b43cf21de6aaa883d04cdfafba2
This patch implements a replacement of the legacy
functional test previously implemented using
openstack-ansible. The job and pipeline is defined
in-repo to ensure that the nova-lxd team has complete
control over the voting status, pipelines it is in,
etc.
The test uses the 'func_lxd' tox environment in the
openstack/openstack-ansible-os_nova repository which
executes an integration build of nova services in a
container, using the nova-lxd compute driver, using
linuxbridge for networking and using the nodepool host
for compute.
Depends-On: If39e4bec8db0be04b13dfc005ee404b73c0b65d3
Depends-On: Ia5ab6aa43f912b3cb4adf98154cd3da12688c2e0
Depends-On: I4995fcac48889bd189cc1f25adb442b7a6637a46
Change-Id: I49075be82daf62b1ca564c77bf835ae83cd6595b
Recent changes in Nova [0] remove a number of parameters from the
InstanceInfo object; re-align the nova-lxd driver to not provide
these values when constructing this object.
Also add chown & chmod to rootwrap configuration file until
nova-lxd moves to using privsep rather than rootwrap.
Include minor change to .testr.conf to deal with switch to
stestr (via os-testr).
[0] I5fe5c8121800e2b8da0860d53d818b7bd83c9e9d
Change-Id: I21caccaeb8794d1ee82956bd8c897b3f1cc366b0
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