Failure during termination should always leave state as Error(Deleting)

Delete is a non-reversible operation for the user, and once the
user has indicated that they want to delete the instance from that
point on is the system's problem to complete the delete as soon as
possible.

If anything fails during the delete that the system cannot recover
from then the instance should be left in an Error(Deleting) state.
Anything else, in particular reverting to an Active(None) state, makes
it look like the system has ignored the request.

Currently InstanceTerminationFailure is explicitly caught, but the
exception does not propagate so the instance_fault wrapper does not
get a chance to log the failure.  Also terminate_instance is wrapped
by reverts_task_state which resets the state to Active(None)

This change removes the revert_task_state wrapper and catches all
exceptions so that unhandled exceptions always leave the instance
in Error(Deleting)

Change-Id: I5fb1bbd56035792f566a6e076edfe7a69df006ef
Closes-Bug: 1254122
Use utils method when getting instance metadata and system metadata

Change-Id: Idab1ba25a8ec4c7dcc9efbb9d86e7248ae3c351e
Recommend the right call instead of datetime.now()

Closes-Bug: #1258166
Change-Id: I92b94dbcd0405d8f2bb818ad1c44c4f4934c8bec
Fixes errors on start/stop unittest

The action name is incorrect on stop unittest, we should use "stop"
instead of "start".

Change-Id: I973e4f4591945f225e374797aebd1bbe00c3c9bd
Closes-Bug: #1257222
baremetal: set capabilites explicitly

ComputeDriver, base class of compute drivers, has dict capabilities
to show if the compute driver implements some functions. Compute
manger will check this with capabilities['has_imagecache'] or
capabilities['supports_recreate'] directly. If use compute driver
baremetal, there is code path leading KeyError. Let set capabilites
explicitly to avoid this.

Partial-Bug: #1261636

Change-Id: I5097d271df0d6ad419f530787d890288163d06c5
Fixing availability-zone not take effect error

when add/remove a host to one aggregate or update aggregate
metadata incluing availability_zone, "OS-EXT-AZ:availability_zone"
property of some instances in the host can not show correctly.

The cause is that when getting availability_zone of one instance,
it will try to get the value from cache first, but unfortunately
the cache does not update or reset in time, and it will keep one
hour if we do not change it.

This patch will add update or reset after adding/removing a host
to one aggregate or updating aggregate metadata including
availability_zone.

Change-Id: I5dd07f876471b5faf8fb1016e25a861124b7cb6f
Closes-bug: #1240374
Workers verification for WSGI service

When we start the nova-api service, the *_workers (metadata_workers,
ec2_workers, osapi_compute_workers) value are not verified if the value
is negative. If the user passes a negative value accidentally, and
InvalidInput exception will be threw.

Change-Id: I8337d672cb119efe700aa6be420fdac9864c1577
Closes-bug: #1269997
libvirt: Configuration element for sVirt support

This configuration is need to allow users to enable sVirt support,
which is by default disabled for lxc.

In addition to a dynamic configuration, the users will be able to
provide a base label

Partially implements: blueprint libvirt-enable-lxc-svirt
Change-Id: Iacb6fcfb66379fbae900e8e9909377bf5ce18409
docstring fix

The docstring of class Extended_availability_zone was totally same as
Extended_server_attributes. This patch improves this docstring.

Change-Id: Ifd59d8dd149975c7f2653a0e0effadfc88d119d4
Fix string formatting of exception.NoUniqueMatch message

There is no implicit logger string formatting happening, so
we need to do this on our own.

Change-Id: I13dfb804d55b5ede2987e355f8a932f237b56c56
Fix the test parameter order for v3 evacuate test

On assertEqual(), the order of parameters should be "expected" and
"observed". However the parameters of some evacuate tests are invalid.
This patch fixes them.

Change-Id: I7ee48ef87082301f7f4ea0633b39275847cbd7e1
Sync unhandled exception logging change from Oslo

Copying changes from 1 Oslo commit: Ibf00173a07510b2ec0c81a29624004f17810a4e4
This is related to the bug fix for adding error type to unhandled
exception log message.

Change-Id: Ie8af57a148753121f79136af928feb0edaea228b
Closes-Bug: #1265561
vmwareapi:remove unused variables in volumeops

Variables instance_name were not used in two methods,
Let us remove them.

Change-Id: Ib617aa82651923ebb2824edf5ff5008f61898bfb
XenAPI: Tidy calls to get_all_ref_and_rec

get_all_records is more efficient than getting them individually in the
old get_all_ref_and_rec implementation.

Replaced some cases of get_all_records with a faster and more
specific API call.

Change-Id: I4725c3f1fdebdf1737941cb7db69b19afb22df9f
XenAPI: Speedup get_vhd_parent_uuid

In many cases the VDI record has already been retrieved.
Use it rather than expensively getting a new VDI record from XAPI.

Change-Id: I469e2a415c1f1924010f47d3927ca18c45a7b8f8
libvirt: Review of the code to use module units

In some places we do not use the module units to refer
bytes type.

Change-Id: Ia89684bb6531bfdcee565cb1bdd33ed943ec3971
PCI address should be uniform

PCI address should be  "domain:bus:slot.function",PF address should
also use this format.

Closes-Bug: #1240383
Change-Id: I303c0905c40d6d07b9c935367d33df73b51fcd56
signed-off-by: Yongli he <yongli.he@intel.com>
Remove XML support from some extension v3 API plugins

Remove XML support from the following v3 compute API plugins:

 - extended_server_attributes
 - extended_status
 - extended_volumes
 - extension_info

Part of blueprint remove-v3-xml-api

DocImpact

Change-Id: I4f3785fbdac7257370458a3bdd859d46ef83f415
Remove XML support from certificates v3 API

This patch removes XML support from certificates v3 API.

Part of blueprint remove-v3-xml-api

DocImpact

Change-Id: If34053c1dce851dc6b3fd2bd1b8ebd03849bae53
Remove XML support from admin_password V3 API plugin

Removes all XML support from the V3 API admin_password
plugin.

Partially implements blueprint remove-v3-xml-api

Change-Id: Ib45a04d34704bc259ef6e457d6dfb6f79c929edf
DocImpact: XML no longer suported for the admin_password plugin