Add an exception when doesn't have permissions to operate vm on hyper-v

This commit adds a wrapper checking method when creating/operating
vms on hyper-v, it will raise a HyperVAuthorizationException if the
windows account running nova-compute on this Hyper-V host doesn't
have the required permissions to create/operate the virtual machine.

Fixes bug #1195205

Change-Id: I2ef67a686c99dc83fcc3e9f47a71473929b01e9f
Merge "Make fake_instance handle security groups"
Merge "Pull out instance object handling for use by create also"
Merge "Fix Instance objects with empty security groups"
VMware: fix rescue/unrescue instance

Fixes bug 1199955

The problem is due to the way in which the VM's are named on vCenter.
That is, in Nova a VM has a name and a UUID. In vCenter the VM only
has a name. The VM name on vCenter is Nova's instance UUID. When the
rescue/unrescue operation takes place a new VM is spawned/destroyed.
The Nova VM has the name '<name>-rescue'. The problem is that the
new rescue name was not passed correctly to the vCenter, that is,
it should have been '<uuid>-rescue' but it was just '<uuid>'. This
caused the opertaion to fail as there is already a VM with that name
on vCenter. A new name should have been passed which is '<uuid>-rescue'.

Change-Id: Icfe6e5021b29026788bec8f3526f94a8ec0a65e2
Move tests test_update_* to separate class

Moved test_update_* in nova.tests.api.openstack.compute.plugins.v3.test_servers
and nova.tests.api.openstack.compute.test_servers to separate classes.

This commit is the first step in refactoring these files.
It will be followed by a commit which will remove duplicated code.

bp nova-tests-code-duplication

Change-Id: Ia78022d32962b846c62afc53ebb70fe17dda7931
Code dedup in test_update_*

Moved shared code that forms a request to separate function.

bp nova-tests-code-duplication

Change-Id: Ie112fafe1085c883446adef1fc5ff4c29e76361f
Merged flavorsextraspecs extension into core API

Partially implements blueprint nova-v3-api

Change-Id: I1eb9bea4996e106c848eb215e19088a968e5200c
Merged flavor_disabled extension into V3 core api

This extension was promoted to core API so it's code is moved inside
main controller

Related to blueprint nova-v3-api

Change-Id: Ia526f27382cf3bedea8b97de11659243d724497f
Need to allow quota values to be set to zero

There are test cases in tempest setting the value of quota to '0', we
need allow this scenario.

Fix bug 1191336

Change-Id: I205b523eddfcd3c253172ad4549142ceb9f9ee4e
Personality files can be injected during server rebuild

Injected files are ignored during a server rebuild, this patch fixes
this issue.

Fixes: bug #1187629

Change-Id: I5e7776de07c8513e36c2926b1fc58c66b382a5ec
Update BareMetal driver to current nova.network.model

Update baremetal driver and vif to use classes from
nova.network.model instead of legacy "network,mapping" tuple.

Partly implement blueprint nova-network-legacy

Co-author: Amir Sadoughi<amir.sadoughi@gmail.com>
Change-Id: Ia66360f51e1d7a12273df2a080931958cc4f86b5
Remove unsafe XML parsing

Move to using xmlutils for all XML parsing. Resolves bug 1190229.

Change-Id: I43afb2e188bbea99ea30fe6cb2eb1aeedc4ddfd4
Merge "Move tests test_update_* to separate class"
Merge "Code dedup in test_update_*"
Fix deferred delete use of objects

Commit dce64683291ba2cdb5e6617e01ccc2909254acb4 added the want_objects
flag to compute_api.get to the _restore function for the V3 version
of deferred delete and the _force_delete function for the V2 version.

This changeset makes it consistent so the want_objects flag is
passed to both. The unittests are also updated accordingly. The inconsistency
was found by the integrated test_servers test which is not yet merged
for the V3 API.

Change-Id: I797f8da855fda8df823e9093cb51ef5da6bdcb0f
Merge "Add Instance.create()"
Fix EC2 API Fault wrapper

Fault wrapper now returns actual EC2 error code instead of HTTP
status code which was ridiculously incorrect behavior.

Fault:__call__ wasn't covered by any unit tests, so I added one.

Implements: blueprint ec2-error-codes
Change-Id: I41f7f0aa09e2925882a0da941f9ea5d4e694e65c
Check host exists before evacuate

Before an evacuate is attempted, there is no checks in
place to see if the host exists. This
results in rpc call being made to non existent host.

This patch adds a simple check to both v2 and v3 extensions
to ensure that the compute service exists before we attempt
to evacuate.

Fixes bug 1208369

Change-Id: I07103ecb8310d8a891ee5fb21a1f8aa7427e0d78
xenapi: test functions for _stream_disk

Add test cases to cover nova.virt.xenapi.vm_utils:_stream_disk, so that
it could be refactored/extended without fear.

Change-Id: Ice43218680d2d5dffad51155cd8da2c2ad2e2cfa