Commit Graph

1124 Commits

Author SHA1 Message Date
Sahid Orentino Ferdjaoui 36b72b016b driver: add missing use_cache parameter for get_info()
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
2019-07-18 18:37:22 +01:00
OpenDev Sysadmins be6befedeb OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:51:35 +00:00
Alex Kavanagh 20e302411d Add defaultbranch for stable/rocky
This ought to have been a while ago, but getting it in for completeness
if stable/rocky has any further backports.

Change-Id: I6d376d14ce6c4ca60c6b926d4ead7e9e4deb8734
2019-04-04 14:47:35 +01:00
Zuul 243ac2b909 Merge "Fix 'filter' object is not subscriptable" into stable/rocky 2019-04-04 10:05:57 +00:00
Alex Kavanagh 539efa3ad0 Add snapped version of LXD support to nova-lxd
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
2019-04-03 16:27:58 +00:00
Michael Johnson 8ee2979084 Fix 'filter' object is not subscriptable
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
2019-04-03 16:25:56 +00:00
Alex Kavanagh 1060782cbf On Bionic ensure that a default storage backend is configured
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
2019-04-03 10:24:28 +01:00
Alex Kavanagh 7e70d3bd59 Ensure that tox.ini uses nova at stable/rocky
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
2019-03-01 11:02:54 +01:00
Alex Kavanagh 4b935f860c Fix bug in scenario/manager and cover it with pep8
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)
2018-09-06 10:26:04 +01:00
Zuul bc8d540c95 Merge "Switch to using stestr" 2018-07-26 14:23:19 +00:00
Chuck Short 8f65d1af8f Switch to using stestr
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>
2018-07-24 20:12:07 -04:00
Zuul 292c4fae2e Merge "fix tox python3 overrides" 2018-07-24 15:47:22 +00:00
Alex Kavanagh f1bbc03b65 Fix problem with 'storage.zfs_pool_name' being removed from lxd 3
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
2018-07-23 09:36:22 +01:00
Zuul a02fce0d31 Merge "Add back in instance to logging entries" 2018-06-15 11:32:13 +00:00
Zuul fb0326a381 Merge "Remove volume v1 API service client usage" 2018-06-12 13:22:02 +00:00
Alex Kavanagh dbe0846b60 Add back in instance to logging entries
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
2018-06-12 10:00:44 +00:00
Zuul 33a55bc978 Merge "'create_ovs_vif_port' function moved to os-vif" 2018-06-12 08:57:32 +00:00
Alex Kavanagh b4c89d0677 'create_ovs_vif_port' function moved to os-vif
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
2018-06-11 18:10:45 +01:00
huang.zhiping a6da038b8c fix tox python3 overrides
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
2018-06-09 18:42:00 +08:00
ghanshyam 5889ea10ab Remove volume v1 API service client usage
Volume v1 API has been gone since long and Tempest also
marked their deprecation since Juno
- https://review.openstack.org/#/c/446238/

Now Tempest is removing the deprecated config option and
alias for voluem v1 service client in
- https://review.openstack.org/#/c/573135/

Before the Tempest patch gets merged, we need to remove all usage
of volume v1 things.

Change-Id: I1ceb269d5ce9f8c9e557d62e829bb536ac4d2a3d
Needed-By: https://review.openstack.org/#/c/573135/
2018-06-07 10:59:26 +00:00
Zuul b3b4555b09 Merge "Fix file descriptors leak which as result disk usage leak produced by wrong use of python tempfile.mkstemp" 2018-06-05 12:19:45 +00:00
Alex Kavanagh 84a7945bca Fix broken debug logs and modernise string interpolation
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
2018-06-01 15:40:14 +01:00
Alex Kavanagh 97cb7ea742 Enable ZFS to work with datasets and all locales
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
2018-05-30 16:19:00 +01:00
Alexander Kharkov 9c411c8828 Fix file descriptors leak which as result disk usage leak
produced by wrong use of python tempfile.mkstemp

Change-Id: Ia5e015c4d7a838f7e7701e078204e7e9d0d363bb
Closes-Bug: 1771928
2018-05-18 04:54:20 +00:00
Alex Kavanagh bd4378a74f Allow nova-lxd to also use mount & umount in rootwrap
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
2018-05-15 18:25:46 +01:00
Doug Hellmann 2a17b6674d add lower-constraints job
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>
2018-05-04 16:27:33 +01:00
Zuul 8b6d7bf97a Merge "Updated from global requirements" 2018-04-27 09:55:12 +00:00
Alex Kavanagh 8b947ea7a5 Update nova to use nova.network.linux_utils
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
2018-04-17 11:06:13 +01:00
Jimmy McCrory f571c64283 Use new location for nova network utilities
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
2018-04-10 12:27:40 -07:00
OpenStack Proposal Bot e5c89dd4c9 Updated from global requirements
Change-Id: Idc8531a269383c379c5b30514762a13fdbf45213
2018-03-26 08:15:25 +00:00
OpenStack Proposal Bot 47afcf108a Updated from global requirements
Change-Id: I18232c8f0bda7ad197fdbd82129bb9f7c110e2ff
2018-03-15 07:27:03 +00:00
Alexander Kharkov 5512808831 Fixed 'privileged' instance creation using config-drive
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
2018-02-28 10:36:49 +00:00
Zuul d9bcbd598e Merge "Add a test for destroying an instance when in rescue mode" 2018-02-27 17:54:50 +00:00
Alex Kavanagh 6b56b30e8b Add a test for destroying an instance when in rescue mode
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
2018-02-27 13:51:36 +00:00
Alex Kavanagh fa6eff604c Change the .testr.conf to .stestr.conf
This is to squash the warning and bring the project up to date.

Change-Id: I4b91e44e3d17300d170e2355085b747aa32005ed
2018-02-27 11:21:11 +00:00
Alex Kavanagh 41f17f418c Remove branch from 'master' branch .gitreview
Change-Id: If4051a220807c984f10b5fd48b4183d22f6943f9
2018-02-23 13:34:59 +00:00
Zuul 67cf1de3d4 Merge "Add placement api and client to devstack configuration" 2018-02-23 08:35:29 +00:00
Zuul 34e4171410 Merge "Replace the usage of some aliases in tempest" 2018-02-23 08:34:40 +00:00
Zuul c196274d85 Merge "Switch to tempest.common.utils.requires_ext" 2018-02-22 21:28:18 +00:00
Zuul c98286cc30 Merge "Add stestr to .gitignore file" 2018-02-22 20:58:51 +00:00
Zuul 7f9a259d6a Merge "Memory hog during image import from glance fixed" 2018-02-22 20:58:47 +00:00
Yurtaykin, Andrey 2d1a056566 Add placement api and client to devstack configuration
This resolves issues with use of the reference configuration
in OpenStack Ocata or later.

Closes-Bug: 1660973
Change-Id: I02bf7f730f17503afd0ad1ff7671dddb264ef46d
2018-02-22 20:08:17 +00:00
Vu Cong Tuan 640c365a52 Replace the usage of some aliases in tempest
In tempest, following aliases have been moved in version Pike
and will be removed in version Queens:
* manager > os_primary [1]
* admin_manager > os_admin [2]
* os_adm > os_admin [3]
* os > os_primary [4]
* alt_manager > os_alt [5]

[1] https://review.openstack.org/#/c/468036/
[2] https://review.openstack.org/#/c/467852/
[3] https://review.openstack.org/#/c/467605/
[4] https://review.openstack.org/#/c/466991/
[5] https://review.openstack.org/#/c/457555/

Change-Id: Icd2ba2fd8e47cf0d515e6004c3793b499eef802e
2018-02-22 20:04:02 +00:00
Nguyen Hung Phuong b47dcf5a53 Switch to tempest.common.utils.requires_ext
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
2018-02-22 17:47:57 +00:00
Nguyen Hung Phuong e6b5850fd9 Add stestr to .gitignore file
Change-Id: Ifa0fe126c354d878732b7bd48556782641fe751b
2018-02-22 17:47:01 +00:00
Alexander Kharkov 3a6ea27da3 Memory hog during image import from glance fixed
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
2018-02-22 17:46:18 +00:00
James E. Blair 9dce01eab9 Zuul: Remove project name
Zuul no longer requires the project-name for in-repo configuration.
Omitting it makes forking or renaming projects easier.

Change-Id: Id88a23a4e98bb2a12300208f054a1637563bf963
2018-02-22 17:45:30 +00:00
Alex Kavanagh cb136ab1e6 Add capabilities flag "supports_multiattach" flag
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
2018-02-22 14:18:30 +00:00
OpenStack Proposal Bot 16d06d149e Updated from global requirements
Change-Id: I6e2ea4b8c4d0942255777818ae095df7556154fc
2018-01-19 20:24:19 +00:00
OpenStack Proposal Bot a614dec5b1 Updated from global requirements
Change-Id: I846bf39a618fa9531eac5f41a06551aa5e4a21f2
2018-01-16 12:40:35 +00:00