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
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
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
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 error in test_get_all_by_multiple_options_at_once()

We should not use 0 as id. It will conflict with db-unique-keys.

Since soft_delete() stores `id` value in `deleted` column, and
checking whether entry is deleted softly is made through comparison of
`id` and `deleted` column values, created entry will look like already
deleted softly.

blueprint db-unique-keys

Change-Id: Icb7a4880886301a3cc72c6ea0e455b867952812e
Ensure that Quantum uses configured fixed IP

Fixes bug 1094897

The fix ensures that the fixed IP address specified by the user
is correctly passed to Quantum. That is, when the Quantum port
is created it is created with the specified IP address.

Change-Id: I8191ac2497037e2592b0679962e4606cd24d7844
Add unit test to revert resize server action

Add a unit test to check the revert resize to an invaid server

Fix bug: 1088874
Partially implements blueprint nova-v2-api-audit

Change-Id: I19128ac1a99e85721e7911176fa6d6c78bd5c256
Add unit test to update server metadata

Fixes bug: 1088878
Partially implements blueprint nova-v2-api-audit

The bug description points to 4 situations to be tested, although those
situations are already tested on create metadata tests which use the same
method as update_all to operate over metadata (_update_instance_metadata) so no
more tests are needed.

Change-Id: Ifae3c69c0e00c361ae36f5a8dede835c96568d11
Add remaining get_backdoor_port() rpc calls to coverage.

This adds the get_backdoor_port() rpc calls for cert, conductor,
console, consoleauth, and scheduler so that the coverage
extension can now telnet into all of those services.

Change-Id: I5de654a11ac224b1192a3b1601855c302b771efd
Fix spelling mistakes in nova.virt

Change-Id: Ic5ff80af956726b768610290e4fae7dd46549711
Imported Translations from Transifex

Change-Id: Ifb57826e0cfe1c94511c86641b6392f042c4b866
Removes unused imports

Change-Id: I76d243329f810cdcd6f8a5459eb66fddd5871e33
Clarify & fix docs for nova-novncproxy

Clarify docs for nova-novncproxy to indicate that it only serves
noVNC web content. Also remove duplicated link from manpage

Change-Id: Ia1f4aff21591132a5c41810a371d248ea0001e1f
Delete pointless nova.virt.VIFDriver class

There is a nova.virt.VIFDriver class which the hypervisor
VIF drivers inherit from. None of the hypervisor subclasses
pay any attention to the API contract defined to the parent
class. Some of the hypervisors don't bother trying to use
the VIFDriver class at all (hyperv, baremetal).

It is not worth trying to make the hypervisor subclasses
follow the same API contract, since the base parent class
offers no re-usable functionality of its own. The hypervisor
base classs nova.virt.ComputeDriver also has no need for the
VIFDriver API to exist, since its integration point is the
'plug_vifs' method.

As such the nova.virt.VIFDriver class serves no purpose
other than to mislead reviewers into thinking there is a
common API where none actually exists. It should thus be
deleted

Change-Id: Id287f7e66143a248a5f106e010510a3f09d2b1e7
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
xenapi: Avoid hotplugging volumes on resize.

In finish_migration, instead of starting up the vm and then
hotplugging in the volumes to it, just attach the volumes before
starting the vm.

This avoids the issue where the guest OS hasn't loaded the PV
drivers for the volume yet.

Fixes bug 1094351

Change-Id: I51d754f8f82f1d22bc123b39777449b58b03e389
fix resize of unpartitioned images with libguestfs

Following on from I9c974e138ff90e8b7a5a40f5b31dcdb25a59622d
Ensure that the libguestfs path also throws a NovaException,
handled by can_resize_fs().

* nova/virt/disk/vfs/guestfs.py (setup): Move the debug message
and guestfs handle outside the exception handler as we
don't want to map failure of those to a NovaException
that indicates an issue with the image as opposed to the
nova code or libguestfs installation.  Change to a more explicit
exception thrown by guestfs, so as to avoid masking other issues.
(teardown): Remove redundant calls to str().
* nova/virt/disk/api.py (can_resize_fs): Cleanup the debug messages,
and use the newer vfs API directly, rather than the slightly
hacky call to inject_data() with no data to inject.

Fixes bug: 1094373
Change-Id: I3e1305cf6bb64278a8caf37e4c5005cb9683f632
Merge "Add remaining get_backdoor_port() rpc calls to coverage."