Remove deprecated config option names: Juno Edition

Just like the beginning of every other release, remove the deprecated
config option aliases that were marked as deprecated in Icehouse.

Equivalent Icehouse patch: I64548e40f6cea42275a6f0f3ebdc0c4cd9324804

DocImpact: Configurations that were deprecated in the Icehouse release are not
recognized in Juno.

Change-Id: I346ee0248c03e60716bd7dc4a5ee4493610867cb
Improve performance for checking hosts AZs

When updating aggregate metadata or when adding a host into aggregate,
a check is done to make sure that hosts can't be in multiple AZs.

In order to do the check, the routine was looping over each host to look
in the DB which AZs the host is part of.
As it's quite hungry in terms of DB accesses, here the proposal is to
extend the helper method for getting all AZs by also having their hosts,
and so only do memory iterations.

Partial-Bug: #1277230

Change-Id: I7c5bc980acb17f0a0e1f8c1403dac66c305866fb
Delete image when backup operation failed on snapshot step

when we snapshot an instance, we will use @delete_image_on_error to
delete any failed snapshot, however, the image will not be removed
by backup code flow, it will be an issue if too many backup failed
at last ,all useful image will be removed and we have only 'error'
image left in host

Change-Id: Ib527ade86aef52a8445b57fa03fed434578c4204
Closes-Bug: #1288574
Shrink devref.unit_tests, since info is in wiki.

Don't keep a copy of the run_tests.sh flag list here since it
inevitably will get out of sync with the real list.

No need to go into detail on how unit testing is set up, since we already have a wiki
on how to run tests that applies for all OpenStack projects. Keep
section with tox examples since that is the most commonly used command.

Change-Id: Ia8eb059be164d9df3edfd69aedcebfd028da45ff
Related-Bug: 1219040
minor corrections to devref rpc page

Correct wording to proper English and remove extra space between words while
in there.

DocImpact

Change-Id: If4b3d9d81d7193107e84867e4ab713c413a4976d
Properly skip coreutils readlink tests

Some tests in VirtDiskVFSLocalFSTestPaths class are skipped
if we're running on OSX by doing a check using is_osx() function
from tests.utils. However, these tests actually require readlink
from coreutils, so replace OS X check by more general check
for coreutils readlink presence.

This change allows to run a complete test suite on OSes rather than
Linux and OSX, such as FreeBSD.

These tests were the only consumer of tests.utils.is_osx, but
it's kept because it could be still potentially useful.

Change-Id: I7593560b84bda3719de811fbc214b1f52e1a121f
Correct exception info format of v3 flavor manage

The existing flavor manage may raise HTTPBadRequest exception,
But the msg info didn't use '_' prefix. This patch adds it.

Change-Id: I736bf4b0e78ecc0bb753d376ee162f19fafc09e1
Adds IVS unit tests for new VIF firewall logic

Adds new unit tests for the IVS VIF driver to
cover the various possible plugging behaviors
added by the vif_details based logic introduced
in change I3bbcfc67036ab7389c82720add0bc0fc627bfee0.

Closes-Bug: #1301087
Change-Id: I7f0a1460b948a852c2d61d24217bbf27a4d85859
VMware: remove unused parameters in imagecache

Trivial patch to remove some unused parameters in
timestamp_cleanup().

Change-Id: Id3c6e8c6c504591fdf09e8871cf3358d265a678c
Check if volume is bootable when creating an instance

Cinder provides a bootable flags for volumes that's not being
checked when creating an instance.

If a user select a non-bootable volume, then the VM became unusable
since nothing will be booted at all.

This check is done only in case that a volume is selected as root
device for a VM.  Boot from snapshot will still work (even that the
volume will be marked as non-bootable by cinder, but will boot the
attached snapshot instead)
If the attribute bootable is not present, we keep the old behaviour
and allow the instance creation.

Change-Id: I8e028d40d6a11beeac4f043afccb17eb61f6ce62
Closes-Bug: #1321334
Allow user to specify image to use during rescue - V3 API changes

This commit includes the V3 changes.
Making changes in V3 API to take an extra parameter rescue_image_ref
as part of the rescue action API.
If specified, this image_ref will be used to rescue the instance.
If the image is not specified, then the base image ref is used by
default.

Partially Implements: blueprint allow-image-to-be-specified-during-rescue

DocImpact

Change-Id: I7a9d88bf4dfe73879247f5b82a52928fdde76510
VMware: spawn refactor - DatastorePath class

Part of spawn refactor work to consolidate a lot of the datastore path
manipulation code. The DatastorePath class is a simpler version of a
class of the same name in earlier versions of
https://review.openstack.org/#/c/87002, and is intentionally limited in
the ways that DatastorePath objects can be constructed. No attempts are
made to ensure that the datastore, directories and files referenced in
these objects are valid on the remote system.

partial blueprint vmware-spawn-refactor

Change-Id: Id65d0308d32835048229e7a3d98b84af2b13583c
VMware: remove dsutil.split_datastore_path

The functionality of split_datatore_path has been subsumed by
the DatastorePath utility class, so remove it and convert
all callers to use the latter.

Change-Id: I07a2cfe15fccaca4aee25bc43157e6c604b91831
VMware: spawn refactor - Datastore class

Introduces the start of a simple Datastore class to encapsulate relevant
data of a datastore.

partial blueprint vmware-spawn-refactor

Change-Id: Ic0ee6cdd47e7cbd66cf456776c61d0b85fb51a0a
Add tests to avoid inconsistent extension names

On v2.1/v3 API, extension names should be camelcases.
I0dc6c23ffcdcf97fc52d3575d521692805ffd9e3 has fixed inconsistent
names already.
This patch adds tests for blocking these inconsistent name/alias
additions in the future.

Change-Id: I3c9ee3f59fd17394b251fedf8df592e5d6304962
Related-Bug: #1315597
Use no_timer_check with soft-qemu

The Linux kernel timer check not working properly
when the hypervisor's thread preempted by the host CPU scheduler.

The timer check is automatically disabled with other types
of hypervisors including the hardware accelerated kvm,
but timer_check is not disabled when qemu used without hardware acceleration.

This issue is frequently mischaracterized as an SSH connectivity issue and
causes rechecks and occasional boot failures.

This change adds no_timer_check kernel parameter when we are using
uec images with qemu.

Closes-Bug: #1312199
Change-Id: I3cfdfe9048fe219fc12cdac8a399b496f237e55e
Fix api direct use of instance module objects

This switches the nova/api and nova/tests/api code to use
nova.objects.Instance* vs nova.objects.instance.Instance*.

Partial-Blueprint: object-subclassing

Change-Id: I146f1d082fa37e1a5c09aa8c5363746daffbc219
Make metadata password routines use Instance object

This replaces existing uses of raw conductor apis for get_by_uuid()
and instance_update() with objects.

Related to blueprint compute-manager-objects-juno

Change-Id: I63cf0ac6636e17f2bfcd9d6a859d9ed8612a56e1
Deprecate instance_get_by_uuid() from conductor

Aside from a few trivial-to-fix places in the unit tests, the
conductor instance_get_by_uuid() method is no longer used. This
deprecates it and cleans up the few places that were trivially
touching it.

Related to blueprint compute-manager-objects-juno

Change-Id: Iab48856c0432af0b9483e9868c2e235de75fdd51
Check the length of aggregate metadata

PostgreSQL gives an error if you try to shove 256+ characters
into a 255-character field. So we need raise a HTTPBadRequest
explanation if the length of aggregate_metadata.keys or
aggregate_metadata.values is above 255.

Change-Id: I2c778f2237ba5bd2aa8335a0eae80f3aad3e9157
Closes-Bug: #1219693