Commit Graph

1019 Commits

Author SHA1 Message Date
OpenDev Sysadmins 02ce72ac47 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:34 +00:00
Ken'ichi Ohmichi cc7585651f Switch to use stable data_utils
Tempest provides stable library interfaces under tempest.lib.
This patch switches to use it for data_utils.

Depends-On: Ib3e29a2b03429e69151717908bc43c590bb8c52e
Change-Id: I0a08bdfd304d988ca48fb07d901d3ecfd5968599
(cherry picked from commit 9a92d8bcf5)
2018-02-28 12:41:02 +00:00
Alex Kavanagh e7772cb6b7 Collection of fixes to unstick the branch with the gate
1. Fix Py2/Py3 difference in '/' causing py3 unit test failure

Py2 and Py3 treat '/' differently, but '//' the same.  The
semantics of the change mean that the py3 '//' division is required
(i.e. resulting in an integer) for the unit tests to pass

2. backport from master of devstack/tempest-dsvm-lxd-rc

Also includes a backport from master of devstack/tempest-dsvm-lxd-rc
to disable new tests that stable/ocata doesn't/won't support.

3. cherry-pick: 6b56b30e8b

Also includes a cherry-pick from 6b56b30e8b which adds a test for
destroying an instance when in rescue mode, and cleans up the code
around deletion of the rescue container.

Change-Id: Icd83ee747d7287b1cd0c614b3928084262fdb16d
2018-02-28 10:06:27 +00:00
Jenkins 2a452c54ea Merge "Misc fixes for devstack gate tests" into stable/ocata 2017-06-16 08:21:40 +00:00
Jenkins dde181a02d Merge "Updated from global requirements" into stable/ocata 2017-06-15 16:03:54 +00:00
James Page dc5c042831 Misc fixes for devstack gate tests
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
(cherry picked from commit 41ac333680)
2017-06-13 08:52:08 +01:00
James Page 054bd005af Re-check image alias prior to sync from glance
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
(cherry picked from commit 698f3da561)
2017-06-13 08:51:43 +01:00
OpenStack Proposal Bot 15aa44d494 Updated from global requirements
Change-Id: I50a050560536b064ee6431e878df5b148baaf339
2017-06-09 17:26:06 +00:00
Chris MacNaughton 6e57a5a2d2 Add storage pool support
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

Closes-Bug: 1692962

Change-Id: I702d1600fdf70bfd1e2402e3455dd868e25214c0
(cherry picked from commit d883fa99eb)
2017-05-23 16:50:04 +01:00
James Page d7b8e7013b Pass readonly flag as a string, not a boolean.
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
(cherry picked from commit 73e33e6ebd)
2017-05-17 10:54:27 +01:00
James Page ed05fa417c Ensure config-drive is read-only
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
(cherry picked from commit c3f55e797e)
2017-03-28 11:51:29 +01:00
James Page d169c8a619 Update dependencies to use stable/ocata branches
upper-constraints and nova repository references where still using
master branches; switch to using stable/ocata branches inline
with stable maintenance requirements.

Change-Id: I36290468beeb6a284dd52231d0db0ef562f181de
2017-03-28 11:50:23 +01:00
James Page e8a7e81cb9 Fix config-drive support inline with cloud-init
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
(cherry picked from commit 991b2bd550)
2017-03-24 09:29:07 +00:00
James Page f5b0133a42 Pass client object to flavor.to_profile calls
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
(cherry picked from commit 9ca7dc3f93)
2017-03-16 12:16:35 +00:00
OpenStack Proposal Bot e8f4ae4a26 Updated from global requirements
Change-Id: I9af8a6607c0296512e1439c5c23ef8ed75274a09
2017-03-09 18:19:44 +00:00
Paul Hummer 2338b77875 Manual backport of attach/detach interface patch
Change-Id: I4359cac0e3e10960d4c6d85f5a191dc7b75fcb44
2017-02-21 21:24:27 -07:00
OpenStack Proposal Bot c6ae6a7040 Updated from global requirements
Change-Id: Ib345122c6ab4501377cd167b3fd5df26e59e4531
2017-02-20 22:31:35 +00:00
OpenStack Proposal Bot 6257ebc2ed Updated from global requirements
Change-Id: I2cae99f3a3a00d171cce625504c9796caa9a9e6e
2017-02-10 12:52:22 +00:00
Jenkins 579a493df3 Merge "Remove the last remnants of LXDSession use" 2017-02-10 12:09:47 +00:00
Jenkins 79093a72a9 Merge "Switch to decorators.idempotent_id" 2017-02-09 16:05:50 +00:00
Paul Hummer e6a584ea28 Remove the last remnants of LXDSession use
_container_init just changed to _migrate, and was dramatically
simplified because pylxd handles most of the work for us now.

Change-Id: I60e513e0ea5967a7f579918085b27b0c17aea802
2017-02-09 08:20:45 -07:00
ghanshyam d5e068c736 Switch to decorators.idempotent_id
test.idempotent_id is being kept temporary to migrate
to new lib interface. Now idempotent_id is available as Tempest stable
interface decorators and all plugins tests using the old decorator
should be switched to new interface.

In future, Once all plugins are switched to new decorator Tempest
will remove the test.idempotent_id

Change-Id: I29d631d0c9130262a4d56b258c76cb43665b9e04
Related-Bug: 1616913
2017-02-09 15:14:26 +00:00
OpenStack Proposal Bot 473dfb629e Updated from global requirements
Change-Id: I37b38a4519161265642443c0d2cc0a10b4764d44
2017-02-09 13:57:16 +00:00
Paul Hummer b664cc294d Refactor the flavor <-> profile work
There is a single interface to pass in an instance and get back
a matching profile for the instance now: `flavor.to_profile`. It
uses a map of functions to generate the config and devices from
the instance and network/block device info.

All the unit tests that are added here were added *before* the
beginning of the refactor, so there should be no broken functionality
in this refactor. Along with that, this increases our test coverage
by about 15%.

Change-Id: I575054422386462df170a0a75fac74fbec6f6086
2017-02-08 22:19:12 -07:00
Paul Hummer 9b899e71c0 Refactor storage handling
Move the ephemeral storage attach/detach code to a storage module.
This meant that we also needed to create a common module for
InstanceAttributes, as both driver and storage needed it.

Change-Id: I6e72d93b5deb3a6be51a35b21960ee9617bdc8b3
2016-12-13 17:57:56 +00:00
Paul Hummer 3609b4f112 Update the glance<->lxd image sync.
Kill the old deprecated api, and simplify the sync process. pylxd
now supports the stuff needed to do multipart uploads. Removing
the setup_image mock clicks things into place.

I think, after this is all finished, we'll want to move some stuff
around, so we don't have one big module with all our code in it
(it's getting a little unwieldy), but I won't worry about that until
it's all updated.

Change-Id: Ic3ad53701fd360f1390e8198135c846294253ab4
2016-12-08 11:36:35 -07:00
OpenStack Proposal Bot 757163cfc7 Updated from global requirements
Change-Id: I02223c0fe2234913f9629038b2191bdb09bcc651
2016-12-06 23:31:30 +00:00
Andy McCrae b78ee132b8 Align with move of hv_type -> fields.HVType & vm_mode -> fields.VMMode
nova core has moved the hv_type module into the HVType class, and the vm_mode
module into the VMMode class, within the fields module.

This patch aligns nova-lxd with this change, resolving driver loading
issues in master branch.

Change-Id: I952ec41d6ee0281d70f911df57cb1013140acdcd
2016-12-06 13:10:40 +00:00
James Page 45048093d5 Align with move of arch -> fields.Architecture
nova core has moved the arch module into the Architecture
class in the fields module; align nova-lxd with this change,
resolving driver loading issues in master branch.

Change-Id: I9b935cbfa4d4fb81b01a8a575c3cbeedc088923c
2016-12-01 10:08:45 +00:00
Jenkins 06390f10e4 Merge "Fix "unary operator expected" error" 2016-11-24 16:16:37 +00:00
Paul Hummer e40795cb03 Merge reconnect_instance into after_reboot.
There was no need to have reconnect_instance. It's only called once,
and isn't a very long function.

Change-Id: Ib26b0cdd044aa808afaeeb8f04816f5b1759f972
2016-11-24 06:53:59 +00:00
Paul Hummer 43a07cef1c Fix "unary operator expected" error
Change-Id: I1763bbac6e24ea396c049c08807ea14f23e3c39b
2016-11-24 06:28:17 +00:00
Paul Hummer 9bf9db7e52 Consolidate profile creation tooling
`create_profile` actually spanned a number of functions. This patch
smooshes most of it together in a way that makes sense without also
having a 500 line method.

A side effect of this work is that a number of testing hacks can
be removed and we get better unit tests for LXDDriver.

Change-Id: Iec75e84ae247b403dc66a530c7ca44c6e757d6ee
2016-11-22 05:32:39 +00:00
Paul Hummer bec48689e4 Remove erroneous XXX comments
When I originally put them in, I thought they were missing features.
If we're missing features at this point, it's on purpose, not tech
debt.

Change-Id: Ieee830b849629bb09f63bdc5c45826214b65da93
2016-11-21 18:06:34 +00:00
Paul Hummer f434b721cd Move nova-lxd to use os-vif.
This patch introduces a new vif driver that implements only plug/unplug.
Those methods merely act as a thin layer over the os-vif functionality,
which requires some adaptation between nova instances/vifs and os-vif
instances/vifs.

The rest of the functionality that was once part of the vif driver has
been moved to functions, as there was no need to make them member methods
(i.e. they never needed `self`). Rather than using the dynamic function
call via string interpolation pattern (which was taken from the libvirt
driver, but is still fragile). Instead, I opted for an explicit map
for config generation.

This patch has 100% test coverage.

The vif library was in dire need of attention, and as a result of the
os-vif transition, it got it.

Change-Id: I175f4df9b58b038b594a40c16076b06f2521bcfc
2016-11-15 20:45:46 +00:00
Jimmy McCrory ccae5dcec4 Fix image alias creation
The add_alias method requires two arguments, a name and description.
Also ensure that the image alias does not already exist before
attempting to upload the image.

Closes-Bug: 1641345
Change-Id: I26dd4328aae5594a52c88ea00bfa3594a0ae617e
2016-11-12 11:56:01 -08:00
Paul Hummer 42ed04c572 Remove profile-related methods from nova.virt.lxd.session
Another red patch, a few less lines of code to maintain.

Change-Id: Ie6d7fbea5ecf5184129dab4614fcfa94a44731ee
2016-11-10 20:02:00 +00:00
Paul Hummer bc17707671 Do not write or read from the database in the LXDDriver tests
Change-Id: Iedc280bbbbe93b04e84d737ab2c91cc4d6a98a2d
2016-11-10 12:47:38 -07:00
Paul Hummer 9d107415f7 Remove the simple nova.virt.lxd.session image methods
`image_upload` takes a bit more work, and will probably get sorted
when `LXDDriver.setup_image` is reworked.

Change-Id: I2950c6fb892b17c809aafdca38eee1e520340277
2016-11-09 19:22:50 -07:00
Paul Hummer 8277d81d03 Remove the remainder of the small container methods from session.
In the ongoing effort to remove nova.virt.lxd.session, I've removed
more of the smaller container related methods from it, and replaced
them with the modern api. `container_init` will require a little more
effort to remove, and will need some full migration testing before
we remove it.

Change-Id: Ieafe916d1da1b0c1a8976d437b94ddd8dfd6bf63
2016-11-09 17:38:03 -07:00
Paul Hummer cb0ab27c18 Remove dead code in nova.virt.lxd.session
nova.virt.lxd.session is going to way of the dodo. Unfortunately,
it's not practical to eat that whole elephant at one time. This
starts the process by removing some already dead code.

I promise not to add any more metaphors in this commit message.

Change-Id: I3796f6b9373b0697b4f5b12d44d505442e1b5f20
2016-11-09 16:05:48 -07:00
OpenStack Proposal Bot 5336f91a52 Updated from global requirements
Change-Id: Ib08c8f89a8e70785e452fff77256490f61ff383a
2016-11-09 04:20:50 +00:00
Jenkins 2d65fd372c Merge "Use constratints when installing requirements" 2016-11-09 00:08:59 +00:00
OpenStack Proposal Bot 13bebfd410 Updated from global requirements
Change-Id: I58d5d5c7c3b8d2dd76c373c24fb7130f8779ff51
2016-11-08 21:40:01 +00:00
Tony Breeds 4d5161dd2c Use constratints when installing requirements
Change-Id: I9cea14812c1beb1491ec20587e1cfdec199a564e
2016-11-08 15:18:17 +11:00
Jenkins 338e1bc765 Merge "Remove some unneeded/unused dependencies" 2016-11-07 12:36:14 +00:00
Paul Hummer e56acc2eac Remove some unneeded/unused dependencies
Dependencies in openstack are sometimes a little hairy (resulting
in some painful mismatches) and the Openstack requirements bot
only complicates things. So I removed the ones we aren't actually
using.

There's also some removal of configs for internationalization that
haven't worked since right after xenial was released, and that we
aren't using and don't really have a need for.

Change-Id: If5c1725cf420174cd75cbd93e1915e276adfe46e
2016-11-06 14:28:25 -07:00
OpenStack Proposal Bot c34551bbb8 Updated from global requirements
Change-Id: Id587f4c2709686b0897d4c60e60b07243e63d257
2016-11-06 02:03:52 +00:00
Chuck Short 4cd2524eee Expand power state querying and resolution.
The get_info method only checks for running and shutdown instances.
However, when the periodical job for syncing instance power states
is run. The instance information and LXD can get out of sync.
So check translate the LXD power state against the nova power
state.

Change-Id: Ib805467e318c886c53bcb953ab368f6f5506534e
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2016-11-04 05:40:21 -06:00
Paul Hummer 2a85329ed9 Remove `nova.virt.lxd.migrate`
Unwrap the last of the indirection modules, migrate. The functionality
is copied straight into LXDDriver, where it should be. The tests
were then updated to reflect this new change.

One thing I'd like to call out is that
`nova.tests.unit.virt.lxd.test_driver_api` contained tests that were
complete lies, essentially. They should not have existed at all in
the first place. Those tests were deleted just on principal, but were
also relatively redundant tests (i.e. if I had updated them to be more
truthful, they would have been similar to the tests in
`nova.tests.unit.virt.lxd.test_migrate`.

Change-Id: Id08079b35c25f0eee4f2d7b74e6bf3037842f703
2016-11-03 12:03:35 -06:00