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)
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
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)
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)
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)
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)
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)
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
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)
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)
_container_init just changed to _migrate, and was dramatically
simplified because pylxd handles most of the work for us now.
Change-Id: I60e513e0ea5967a7f579918085b27b0c17aea802
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
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
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
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
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
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
There was no need to have reconnect_instance. It's only called once,
and isn't a very long function.
Change-Id: Ib26b0cdd044aa808afaeeb8f04816f5b1759f972
`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
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
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
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
`image_upload` takes a bit more work, and will probably get sorted
when `LXDDriver.setup_image` is reworked.
Change-Id: I2950c6fb892b17c809aafdca38eee1e520340277
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
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
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
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>
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