With 19cb8280232 The driver interface has been updated. Now that the
method get_info() has an extra parameter 'use_cache'. That one is
currently not going to be used in lxd driver since we don't cache such
info.
Also, to ensure that the unit tests pass on a machine with lxd installed
as a snap, there are some additional mocks needed.
Closes-Bug: #1824300
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
(cherry picked from commit d0faf787d9)
Change-Id: I13a451ba95e0fd2485f94327d55ea1c0a7ed1f1d
This ought to have been a while ago, but getting it in for completeness
if stable/rocky has any further backports.
Change-Id: I6d376d14ce6c4ca60c6b926d4ead7e9e4deb8734
If LXD is installed via a snap, then the location of the console log
changes from the package version. This patchset detects whether LXD is
snapped, and if so, provides a slightly different path for the console.
(cherry picked from commit e2aab580bd)
Change-Id: Id5c0ca2fd4b70f06b683c75ce5162b3f1a709187
nova-lxd has a python3 compatibility issue where it will fail with:
TypeError: 'filter' object is not subscriptable
This patch corrects that problem.
Change-Id: Iaa275eb770bca53fac2aae201cc5597e660c64df
Related-Bug: #1815325
Sets up the default dir backend and configures it as the default pool
for lxd. This is required on bionic (LXD 3.0.x) as there is no default
storage pool by default.
Also installs apparmor which LXD requires to operate, but that is
missing from ubuntu image that is built for devstack-gate.
Related-Bug: 1822182
(Cherry-picked from aee3ef71d9)
Change-Id: I910d6f4b64990ff3068badc693321165317c10e3
This commit is in the stable/rocky branch, and the patch ensures that
unit tests in this branch test against the stable/rocky nova branch.
Otherwise unit tests may fail as it was testing against the master
branch.
Change-Id: I12dfab6568ee673ee5222ea549b42b9f801ba4f5
manager.py had a syntax error which caused the module to be not
installable. This wasn't picked up in testing. This fixes the bug
and adds pep8 coverage to the nova_lxd_tempest_plugin so that the module
always remains installable.
Also, this fixes the tempest concurrency at 1. See the related bugs.
Closes-bug: #1790956
Related-Bug: #1790943
Change-Id: Ie542b062a9f0997f6363877ff03f0f9bfc8f3d43
(cherry picked from commit c4c16bcf49)
According to Openstack summit session [1] stestr
is maintained project to which all Openstack projects should migrate.
Let's switch it then.
[1] https://etherpad.openstack.org/p/YVR-python-pti
Change-Id: Ic4eae5a383616e93f154b99208817ca9f20548cc
Signed-off-by: Chuck Short <chucks@redhat.com>
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: I6527640438331b86f2140cf0a772f7d207a6fd40
Closes-Bug: #1782329
In a previous commit, I erroneously deleted the instance=instance dict
entry from some of the logging calls, not realising they were a feature
of oslo.logging. This commit puts them back, and adds them in a few
more useful places for debuggin purposes.
Change-Id: I0a1be5a46a888db9f0782db90815a74d50ead298
A few functions from nova migrated to os-vif, and two were the
create_ovs_vif_port and delete_ovs_vif_port that nova-lxd uses to
do the post vif wiring on the container to connect it to the appropriate
bridge. This just gets the correct import, and adds a bit to the
docstrings to help maintainers understand the code.
Change-Id: I0787a919275c544e4faddc9d42d8db5880ba57ee
Closes-Bug: #1776205
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: I9f7df241e90aa2b82813a41f330e3890e08b5869
Some of the debug logs were not actually outputing the instance;
it was just tagged in the LOF.<type>(...) command.
Also took the opportunity to modernise to '.format()' the string
interpolation to meet current guidelines.
Change-Id: I99c56ff738713140b2af16199e9e58b39bb4e396
Closes-Bug: #1657339
This fixes two bugs (independently) to get nova-lxd to work with
datasets (pool/set) as well as pools (just 'pool'). It also, switches
the attributes to use the '-p' option with 'zfs list' and 'zpool list'
which returns the values in bytes rather than human readable format,
which is more useful in nova-lxd.
Change-Id: I2eb1b3ba7bd482e680933808414a3992a9a1feba
Closes-Bug: #1756900
Closes-Bug: #1757371
For config drive purposes, nova-lxd needs to call mount and umount.
These need to be added to the rootwrap.d/lxd.filters file.
Change-Id: Id04558cc57c95d09e23f17208c5e275fc9702504
Closes-Bug: #1747720
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.
Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.
Add openstack-tox-lower-constraints job to the zuul configuration.
See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.
Also: fix up test due to changes in requirements/make it work with
Python 3.6
Change-Id: Iedb7fe7e5bbb8935a5a958a301ed3c5540005bbc
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Commit 543776483b changed nova.network.utils ->
nova.network.linux_utils in change:
I10382329524bcd217299df15c586615193205bdc
This just updates the nova-lxd reference to it.
Change-Id: Icc3fd1c37f04399b95d822bb13e76759a3125ef3
The 'device_exists' method moved from nova.network.linux_net to
nova.network.utils in Ieac8621217c42f8b2d08dbc58c2025262f325e1e
The 'set_device_mtu' and 'delete_net_dev' moved in
I9872056c440a706b89dd51d3b9f2418951723efa
The 'detach_volume' method has user context passed to it as of
I751fcb7532679905c4279744919c6cce84a11eb4.
The 'lxd_mock' fixture has also been updated to work with recent changes
to oslotest for autospec.
Change-Id: Iac52d616517a55984b13d3762c88c66a64292ef5
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.
Change-Id: If11bf72a9fdeeaff4f55cfca0ec0bc0a1bc6ce3c
Closes-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.
Change-Id: I586261f25e8c8b9b8acdba6cafe67491bd55b46a
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