Deprecate old vif drivers.

As per commit 4c0cecd3 (Change-Id I292c2fd7aa0c32b1c91d737152ed8e54ea2cf6ac)
Deprecate:
* LibvirtBridgeDriver
* LibvirtOpenVswitchDriver
* LibvirtHybridOVSBridgeDriver
* LibvirtOpenVswitchVirtualPortDriver
* QuantumLinuxBridgeVIFDriver

Change-Id: Iad854dfe91aaa18622f78aa92746d3ea2f986960
Encode consoleauth token in utf-8 to make it a str

This is needed for memcached backend, because the key cannot be a
unicode object in any of the exposed functions.

Fixes bug 1164784

Co-authored-by: Stanislaw Pitucha <stanislaw.pitucha@hp.com>

Change-Id: Ieb1429116d96eefe97564fe92631063dc16117cb
Completes the power_state mapping from compute driver and manager

Fixes bug 1166906

Added extra states to constants module together with test
cases checking every state map.

Also added some debug statements under blockdev and operator
to be able to spot obvious issues with images at deploy time.

Change-Id: I77ebb4d417a3875b761f5fb220d9274b79611ff0
Allow listing fixed_ips for a given compute host.

nova.db.fixed_ip_get_all_by_instance_host was removed in commit
bb867ce3948ddc23cf928ca3dda100a1a977896a, but was still used in
nova-manage. This patch works around the removal of the foreign
key that led to this method being removed.

Resolves bug 1163660.

Change-Id: Ieccd37c752e245558827615c098604d11ad3d945
Correct disk's over committed size computing error

There's a error in the disk's over committed size computing for the
instance which using RAW type disk. This issue caused
disk_available_least resource counting increasing.

Fixes bug: 1167695

Change-Id: I4e6cf22a9cf66a757e3641e2a0be0b7699cae69d
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Import and convert to oslo loopingcall.

Import the oslo looping call implementation (which is a copy of
nova's), delete nova's local copy, convert all users to the new
location.

It should be noted that the oslo implementation of
FixedIntervalLoopingCall measures time from the start of the
periodic task, not the end, so periodic tasks will run with a
constant frequency instead of the frequency changing depending on
how long the periodic task takes to run.

Change-Id: Ia62ce1988f5373c09146efa6b3b1d1dc094d50c4
hypervisor tests more accurate db

The hypervisor tests don't accurately model the db because the
sqlalchemy DB API requires admin for the compute_node_get_all
function.

This change makes it so that the fake compute_node_get_all
function in the hypervisor test module requires admin just like the
sqlalchemy DB function.

Change-Id: I5acd45cfbd10ec06d8c5a9425e9c6ed18cff669e
Translate cinder NotFound exception

When we attempt to get information about a snapshot
which doesn't exist we get a cinder NotFound exception.
However, this is not caught and causes a stacktrace in the logs.
This occurs on every tempest run in the test
EC2VolumesTest.test_create_volume_from_snapshot.

The fix is to translate the exception to SnapshotNotFound
which is handled correctly further up the call chain.

Fixes bug 1169777

Part of blueprint no-stacktraces-in-logs

Change-Id: If893b5083b93894e671c978bd23bd89d3d017531
Map internal S3 image state to EC2 API values

Fixes the EC2 API so it maps internal S3 image state values to
ones defined by the EC2 API rather than returning the internally
used values.

Fixes bug #1074904

Change-Id: Iabbda0e5fcbe4d572c76367c6f98d4bece050e73
Fix up regression tester

* Clean up to support pydoc
* Support -h
* Make it actually work
* Improve docstrings
* Add copyright

Change-Id: I977df71e8213e39e9eebf9cc56b2dd7625959870
Translate NoMoreFloatingIps exception

When the pool of floating ips is exhausted the NoMoreFloatingIps exception
is raised but not handled properly in the floating ips extension resulting
in the exception propagating further up and causing a stack trace to be logged.

This change translates the exception explicitly into a HTTPNotFound, preserving the current
REST API behaviour. It fixes a bug where the pool name was not correctly inserted into
the message returned if allocation from a specific pool was requested.

Fixes bug 1169811

Part of blueprint no-stacktraces-in-logs

Change-Id: I8f35d25d065bb1fa709cff6f59841ac8c86658bd
Update the log module from oslo-incubator

Contains fix to stop the logger system from logging events twice.

Also includes PID in default logging_context_format_string

Fixes bug: 1170049

Change-Id: I007786604138c41fbcf1127c01339132c56a6aab
Remove unnecessary full resource audits at the end of resizes

Both confirm_resize and revert_resize ends with full resource audits
which is unnecessary, given that correct calculations can be made
using existing claims.

Resolves bug 1169982.

Change-Id: If0f91651605a95e73fdbf88aa18c279bfaf73b04
Fix ec2 CreateVolumes/DescribeVolumes status

In admin context CreateVolumes/DescribeVolumes returns
extraneous information such as project_id, host, instance
data etc. This results in output which is not compatible
with the ec2 API. This change removes the addition
of the extra information.

This only partially fixes bug #1074901 as mapping the internal
volume states to ones specified by the ec2 api results in the devstack
euca.sh exercises to fail. But that can't be fixed until the fix
in this patch is through as the extraneous information returned by DescribeVolumes
causes euca-describe-volumes to not to show the attachment state for
a volume which is needed by the euca exercises.

Change-Id: I48a96fbfe4bb2e3da9514d688638ecdf3a168303
Fix hyperv copy file error logged incorrect

This patch just fix hyperv copy file error message
incorrect, missing src and dest value.

Fixes bug #1170580

Change-Id: I309fd67b3f491c9be872ff9cdd58f6364a26a96b
Stop vm_state reset on reboot of rescued vm

When a VM is in rescue mode, giving it a reboot will reset its state in
the DB back to ACTIVE.

This patch stops that happening.

Work towards bug: 1170237
Change-Id: Ie442bcc85ed7ad5d897b88ffd0dbcf6eeee7b990
Adds tests to xenapi.vm_utils's 'lookup' method

Change-Id: I140f091b50c3e4076d3f4812cae00e37f120a277
Allows xenapi 'lookup' to look for rescue mode VMs

When you lookup a VM by name, you can specify if you want it to check if
it has a rescue mode instance running.

If it finds the rescue mode instance, it'll return that one instead
of the original name.

This is useful for operations that should work on the rescue mode vm if
it's there, or the normal one, if it's not.

Work towards bug: 1170237
Change-Id: I41b31e59631b78a62faadb9970b6b824929e7061
Can now reboot rescued instances in xenapi

This patch makes it possible to reboot an instance that is in rescue mode.

It causes the reboot action to search first for rescue mode VM (the
normal VMs name plus '-rescue') .. if it can't find it, it does a reboot
of the normal VM. If it finds the rescue one first, it'll reboot the
rescue instance.

If there is more than one VM named 'myvm-rescue', it'll raise an
exception just like it did if there were more than one VM named 'myvm'.

Helps with bug: 1170237

Change-Id: I1858d86bf93546618eeaaec92d856f5236f3f090
ec2 CreateVolumes/DescribeVolumes status mapping

'attaching' and 'detaching' are not valid ec2 API volume status
values. Instead map them both to 'in-use'.

Note this will not pass the devstack exercises until
https://review.openstack.org/#/c/27244/ goes through

Fixes bug #1074901

Change-Id: Id3dfd525d24d622aab5e350e42713fdb7671b31e