Added sample tests to FlavorDisabled API.

Partially implements blueprint nova-api-samples
Fixes bug 1070161

Change-Id: I889a5b2e85d31fda1e9a8a82043ba7e9ddf1b7a6
Fix race condition of resize confirmation

Currently, the db update of migration status is after the db update of
instance's vm_state in _finish_resize, so a race condition occurs when an
instance's vm_state is updated but the migration status doesn't, and at
this moment a resize confirmation is performed, then an exception
'MigrationNotFoundByStatus' is raised.

Fixes: bug #1066140

Change-Id: I1dac98cc99d3491c92faaad2b9dcc40d7c0524b5
Extract image metadata from Cinder

This patch makes nova extract image metadata if it is present in the
volume dict received from Cinder API.

The volume image metadata is received from Cinder when the
volume_image_metadata Cinder extension is loaded.

This patch is part of the work done on blueprint improve-boot-from-volume
as this metadata will be used when booting instances from volumes
without the need to supply an image just for the metadata. Subsequent
patches will make Nova consider this metadata when booting instances
without and image id.

Change-Id: I9e5925ea4147a41c41f9019933a47c5ccf756747
Add get_backdoor_port to consoleauth.

This adds a get_backdoor_port function to the consoleauth
service which enables returning the eventlet_backdoor port
from rpc for the service.

Change-Id: I7da9cbc8111342b5f49f148a8e3389faf5c4f2ab
Add get_backdoor_port to console.

This adds a get_backdoor_port function to the console
service which enables returning the eventlet_backdoor port
from rpc for the service.

Change-Id: I3cb7d199fac8c10e4b5fdc04c403b63e75a69d2d
Add get_backdoor_port to scheduler.

This adds a get_backdoor_port function to the scheduler
service which enables returning the eventlet_backdoor port
from rpc for the service.

Change-Id: Ib88e2a9e709d5240722027c94e6762b4a3bd918c
Add get_backdoor_port to cert.

This adds a get_backdoor_port function to the cert service
which enables returning the eventlet_backdoor port from rpc
for the service.

Change-Id: Iea2b1f9587ea2749c2def921d6a0d1e86f1645ee
Add html reports to report action in coverage extension.

This makes a few minor cleanups and 2 additions to the
coverage extension. First, it adds a new optional field to the
report action: 'html'. This will generate an html report instead
of either the text or xml reports that the extension can
generate.

The second change is that it adds a return for the stop action.
Now upon successful completion of the stop action the directory
where the coverage data files will be returned.

Change-Id: If1aa25fc7237e9bb5100d2a4a8e560f0a68eba61
Provide a configdrive helper which uses contextlib.

As suggested on review of Ib23d117ad4cd5dc92298a0812eb468f7d557417c.

Resolves bug 1092248.

Change-Id: I2829ac60732b86b9853983b03ef6f30f5c5a3283
Eliminate race conditions in floating association

This makes associating and disassociating floating ips atomic and
idempotent. This means multiple concurrent messages will not leave
behind iptables rules and concurrent request will not cause odd
failures.

Fixes bug 1092762 and bug 1092761.

Change-Id: Idbcad6c1d2a3d4881cf7180b848ed3844fac4054
Enable nova exception format checking in tests.

Updates the Nova test runner so that it enables
'fatal_exception_format_errors' for testing.

Fixes a slew of issues in the tests including:
 -adds a whole bunch of missing kwarg's to exception constructors
 -removing an extra print statement in ec2/test_cloud
  (this was causing failures...)
 -removing a duplicate (and misnamed) flavor test case:
    test_remove_tenant_access_with_bad_access
 -removing an odd test case which tested throwing an exception with
  and without kwargs explicitly (the part testing without kwargs was
  removed)
 -explicitly update test/test_misc.py's test_exceptions_raise to disable
  formatting checks for now. This allows it to continue to pass.

Change-Id: Ibb5083c93f1a5de6edadb1b613292ff9eb26ddf0
Log last compute error when rescheduling.

When a scheduling attempt is re-tried, log the last exception from
the compute side.  The goal is to provide simpler access to debugging
information about why a build/resize is having issues.

Change-Id: Ic31852dcbbf1cea9034a4b8eb1c7d20178c3229d
Remove inconsistent usage of variable from hyperv.

Portions of the code use instance_name, while others use
instance['name']. In some cases, within the same function. See
lines 123, 153, and 156.

Change-Id: I69763e62a1db79b4c5a4468104fd26ad9b3aad5a
db.security_group_rule_destroy() method performance optimization

1 db requst instead of 2

blueprint db-session-cleanup

Change-Id: I094632c422aa9d10278c1b85ec9f4d51a54541b1
Fix cloudpipe instances query.

Filter out deleted instances in _get_all_cloudpipes.

Fix bug 1092786.

Change-Id: Ia714a1989f78728f8b3597d6f837b622427ac5b1
Spelling: Compatability=>Compatibility

Change-Id: Idc6f99d8021bb942b3a82f530c6a4ff2c4d72f8f
Remove improper NotFound except block in list servers

Added a couple tests to verify that NotFound was actually
never raised when no results are returned from list servers
or list servers details, and then removed the except blocks
from the controller.

Change-Id: I36856066b9e4c4e3f7b85ddf8facb35204034838
fixes: lp bug #1089385
Check for image_meta in libvirt.driver.spawn

This adds check that image_meta exists in libvirt driver
spawn method. In case it doesn't the image shouldn't be
created.

part of libvirt driver support for blueprint rebuild-for-ha

DocImpact

Change-Id: I097c7cbfde96bcb21b4f06af4e5bac00440849c2
Co-authored-by: Oshrit Feder <oshritf@il.ibm.com>
Remove unused imports

And one unused variable

Change-Id: I81edaf7ddedd7723c2601b30951ca82bd2cd5256
Remove session.flush() and session.query() monkey patching

Use custom Session class to avoid monkey patching of SqlAlchemy
Session instance.

blueprint db-session-cleanup

Change-Id: I7d40c20e585782403556f3587141805c197bfa64