Fix one port can be attached to more devices

a port attached to some device should not be attached to another device again

Change-Id: I60de0fa265358ac5b5e1b2c8f370862b32f9e724
Fixes: bug #1204850
Fixes missing host in Hyper-V get_volume_connector

Fixes bug: #1215765

The Hyper-V driver is not returning the host in the
"get_volume_connector" method.

This commit fixes the issue by adding the "host" key to the dictionary
returned by the method.

Adds also a unit test for get_volume_connector.

Change-Id: Ic74882e54994f957bf6d2bb75bbd53c6a346042e
compute rpcapi 2.37 is not backwards compatible

Patch 552693e4ad51291c8bfd28cd1939ed3609f6eeac which added compute
rpcapi version 2.37 does not provide any backwards compatibility.

Fix the issue by 'self.can_send_version'.

Fix bug 1217044

Change-Id: I65154fa6298133721b6509b00b117d7f6cc455b8
Improve db_sqlalchemy_api test coverage

Added new tests and improved coverage for methods:

 instance_group_*
 migration_*
 task_log_*
 agent_build_*

Blueprint: db-api-tests

Change-Id: Idbf704b3e6aa8df1d4f927e67d108e6a8489b9d2
powervm: actually remove files after migration

The powervm driver is attempting to clean up compressed image gz files
in the migration flow but the rm command being issued doesn't use the
--force option, so the files are piling up on the backing hypervisor.

This patch properly removes the files like in other parts of the powervm
code (see blockdev.py for example) and fixes the tests so the
_remove_file method is actually tested.

Closes-Bug: #1214985

Change-Id: I82919aa20447230e317c13f51bdf1c204a2eca39
Tenant id filter test is not correct

The test_tenant_id_filter_converts_to_project_id_for_admin is not testing what
it is reporting.
To test that the tenant_id filter is actually mapped correctly to the
project_id filter, the request has to include the all_tenants options too.

That should be make clearer how the tenant_id option actually works.

Change-Id: Id6e8c9d2f39d4dd7ce3bb60400d9cf52c9133f48
Adds V3 API samples for agents, aggregates and certificates

Adds v3 API samples for the agents, aggregates, and certificates
extensions. Bundling them together to save on review load

Partially implements blueprint v3-api-unittests
Partially implements blueprint v3-api-specification

Change-Id: Iee26fe25b5fd369f2a1f5690ddc095a90526a549
Remove dis/associate actions from security_groups v3

In v3, with the imminent deprecation of nova-network, we're
removing Nova API extension actions that don't add value to
what's already offered by the source API (Neutron).

Partially implements blueprint nova-v3-api

Change-Id: I3b75143cd13faab5b1eb6f832876d29636e76fd0
Introduce InvalidPermission.Duplicate EC2 error code

New SecurityGroupRuleExists exception with 'InvalidPermission.Duplicate'
ec2_code attribute replaced useless EC2APIError.

Note that this error isn't about duplicate group as the code suggests,
but about duplicate permission within a group.

Implements: blueprint ec2-error-codes

Change-Id: I42c94e15a6ca1bc57b10fb683bec17b73de0e0e5
Use ExceptionHelper to bypass @client_exceptions

Rather than stubbing out catch_client_exception() to bypass the wrapping
of exceptions in ClientException, use the existing ExceptionHelper to do
it.

This is important for oslo.messaging, because there's no public API
method for us to stub out.

This is a continuation of I32c83ef15fece35526739c4fcdfccf7a275c7033 as
another stub_out_client_exceptions() usage got merged by
I4120156db1499dfd3ed22095e528787eb73d33a6.

blueprint: oslo-messaging
Change-Id: If4ff9dba58e9f94fab80be804a98c76fff3267b7
Fix warning log message typo in resource_tracker.instance_claim

Just cleans up a small typo in a warning log message that the resource
tracker gives when 'node' is already set on the instance during a claim
operation.

Change-Id: Ic1ece4451f54f4efc8028f8d90de5d240910b20e
Call safe_encode() instead of str()

To avoid the error in python2.6:
"UnicodeEncodeError: 'ascii' codec can't encode characters",
use safe_encode() to encode basestring instead of str().

Fix bug #1218719

Change-Id: Id26f23ad7f975a3a50750927adbedb86bf80871d
Disable retry filter with force_hosts or force_nodes

If customer deploy a VM with force_hosts or force_nodes options,
then there is no need to retry even if retry filter was enabled.

Fix bug 1211597

Change-Id: I2948f48b5c4982cc29899b76889d7d8f0db47449
Fix wrong method call in baremetal

The `get_pxe_config_file` method is not part of the PXE class.

Change-Id: Ife4f5332af05fd82a865ecdbddf7c5431eb29c1d
Closes-Bug: #1218779
xenapi: skip metadata updates when VM not found

There is a race condition where change_instance_metdata requests still
get to the compute nodes when the VM has a task in operation that means
the VM is no longer present. This change ensures that we skip the
metadata updates when this occurs.

Currently, if this happens, the long running task, like rebuild or
resize will fail because the VM task_state=None and is put into ERROR.
After this change, it will silently fail, and the updated metadata will
be written when the VM gets re-created as part of the long running
operation.

Fixes bug 1207238
Change-Id: I75e1f93e34d3b3ab93a8e8104fd64224f72d7309
VMware: Config Drive Support

Create the config drive iso, upload it to the correct location,
then create a VirtualMachineConfigSpec with appropriate contents
and run the ReconfigVM_Task to enable the iso.

DocImpact

Fixes LP# 1206584
Fixes BP vmware-config-drive-support

Change-Id: I1df1e61edbff9f3a68940d3e3e87fea3be838d11
Sync rpc from oslo-incubator

This includes:

76972e2 Support a new qpid topology
284b13a Raise timeout in fake RPC if no consumers found
9721129 exception: remove
7b0cb37 Don't eat callback exceptions
69abf38 requeue instead of reject
28395d9 Fixes files with wrong bitmode
bec54ac Fix case error in qpid exchange type "direct"
61c4cde Ensure context type is handled when using to_dict
223f9e1 Clarify precedence of secret_key_file
a035f95 Don't shadow cfg import in securemessage
0f88575 Remove redundant global keyword in securemessage
848c4d5 Some nitpicky securemessage cleanups
5c71c25 Allow non-use of cfg.CONF in securemessage
9157286 RPC: Add MessageSecurity implementation
2031e60 Refactors boolean returns
a047a35 Make ZeroMQ based RPC consumer threads more robust
34a6842 On reconnecting a FanoutConsumer, don't grow the topic name
f52446c Add serializer param to RPC service
5ff534d Add config for amqp durable/auto_delete queues
7bfd443 Avoid shadowing Exception 'message' attribute

Closes-bug: #1178375
Change-Id: Ib5d4733743041eb2324020f9b1dc553260e79b21
Add block_device_mapping_get_all_by_instance to virtapi

Add another conductor api method to the virtapi.  This is needed by the
following patch: https://review.openstack.org/#/c/42812

Part of blueprint qemu-assisted-snapshots

Change-Id: I21d0ebe9f83423d504f7626f0d048b31945156d9
VMware: use VM uuid for volume attach and detach

When using the instance name an exception occurs. The problem is due
to the way in which the VM's are named on vCenter. On vCenter the name
of a VM is actually the nova uuid - hence all intercations with the VM
should be done by the uuid. The problem here is that the name was used.

Fixes bug: 1208173

Change-Id: Iefe1584ee1ded403815cf0ca1fb5206ceadd3e55
Merge "Adds V3 API samples for agents, aggregates and certificates"