Adds V3 API samples for cells and multinic

Adds V3 API samples for cells and multinic extensions.
Bundling them together to save on review load

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

Change-Id: I50840b3d900fbc8ff4f655e4188cc886d7065729
Clean up check for migration 213

Migration 213 for PCI device needs to check whether the pci_stats column
and the PCI device table exist or not after and before migration.

For pci_stats column check, interface assertColumnExists and
assertColumnNotExists could be used to simplify.

PS: remove an unnecessary word 'image_id' in models.py.

Change-Id: I7f1ba266523bca68c950bd76449324cece09393f
Signed-off-by: Shane Wang <shane.wang@intel.com>
Fixes unexpected exception message in ProjectUserQuotaNotFound

When an exception ProjectUserQuotaNotFound occurs, the message "Quota
could not be found" was obtained. This is because the name of the
variable to override is incorrect. There is a similar bug in
ConsoleTypeUnavailable and ISERTargetNotFoundForVolume.

Change-Id: If709aff55b9042eaca49aaebddc31c366681a36c
Closes-Bug: #1221527
Remove unused exceptions

* nova/exception (ImageDownloadModuleLoadError):
Never referenced.
* nova/exception (ISERTargetNotFoundForVolume):
Never referenced.
* nova/exception (InstanceMetadataNotFound):
Unreferenced since commit 0d417fa73
* nova/exception (ISCSITargetNotFoundForVolume):
Unreferenced since commit 4123094b2

This commit removes them.

Change-Id: I224c6b1d711add12320ca8e89486257a6517a1c9
Add Neutron port check for the creation of multiple instances

Exception is thrown if multiple instances are launched with a single
Neutron port. Remove one duplicated test case
"test_create_instance_with_security_group_enabled".

Fixed Bug 1193434.

Change-Id: Ie5d426db0e0785043833e4e7f9a16c9591bee743
Port server actions unittests to V3 API Part 1

This changeset just copies the test file to the V3 directory.
Part 2 will make the changes required to test against the
V3 API

Partially implements blueprint v3-api-unittests

Change-Id: I1e73832c567d69d8e428133f5258ac09cfdb74b7
Remove cached console auth token after migration

After migrating to another server, the cached instance console auth
tokens become invalid, so we remove the tokens associated with the instance.

Fix bug #1214829

Co-authored-by: Takashi Natsume <natsume.takashi@lab.ntt.co.jp>
Change-Id: I7fddcd13da128a6bec5e2cdb6fa8c8636d6adb24
Fix logging of failed baremetal commands.

Subprocess output is bytestrings, not unicode, so %r is the right
format to use.

Change-Id: Ia6cd0986d6970093c859775bb321ecea632e0264
Closes-Bug: #1223253
Fix create's response is different with requested for sec-grps V3

The create's response always shows the default security-groups even the request
with different security-groups.

Fix bug 1221651

Change-Id: I0c3de3c4d00ed15f3e4a0717c0a1f123ccbf3068
Fix migration 201 tests to actually test changes

Previously for migration 201 the indexes dictionary was overwritten
causing the assertIn statement to tests against itself. This patch
fixes it so that the test checks the new indexes are created
correctly against the table and also checks they are removed on
downgrade.

Fixes bug 1226924

Change-Id: Ie518041c6b7d534ed1b96e2f9b4e7206f4b68d87
VMware: bug fix for instance deletion with attached volume

The creation of the connection information required by Cinder to
delete the volume accessed a resource that did not exist (as it had
been deleted). This would result in the instance being in a 'DELETING'
state and the Cinder volume in 'in-use' state.

Fixes bug 1223074

Change-Id: I5283b1ddea76c0eaaf7315fc8cf8969c6cd6755f
Adds API samples and unitests for os-server-usage V3 extension

Partially implements blueprint v3-api-unittests

Change-Id: I21c9301f53e0e0d85b27a69592bf64eab046ff79
XenAPI raise InstanceNotFound in _get_vm_opaque_ref

If _get_vm_opaque_ref doesn't find an instance it should raise a
specific InstanceNotFound exception rather than the general NotFound
exception.  Callers of this method may try to catch InstanceNotFound or
NotFound and now both will work.

This fix will prevent a traceback during the _sync_power_states periodic
task which is expecting an InstanceNotFound exception.

Change-Id: Ia28fe33d69520806dab878c843fe435e018a20de
Closes-Bug: 1226756
Fixes host stats for VMWareVCDriver

Host stats for VCDriver should collect aggregate cluster stats
rather than that of a single host in the cluster.

Fixes: bug #1190515
Change-Id: I37e46995c5da2e3052e8178098afee7c8061bb3c
Fixes test scripts with wrong bitmode

Some modules have bitmode 755. Changed to 644

Added a redundant blank line according to hacking's import template.
https://github.com/openstack-dev/hacking/blob/master/HACKING.rst

This was done to avoid merged errors in gerrit which happens
if no content has changed.

Partially fixes bug #1224226

Change-Id: I8077035eea8ee3be4d17a992788a4a6b959fc171
Fixes modules with wrong file mode bits

Modified file permission from 755 to 644.
Removed a redundant blank line to avoid merged errors in gerrit
which happens if no content has changed.

Partially fixes bug #1224226

Change-Id: I01695db4a0a55183046edad2069210243d7c5617
VMware: ensure that resource exists prior to accessing

Ensure that the resource being accessed actually exists. There
may be cases when a cluster is updated/deleted and the scheduler
may be out of sync with the compute node.

Fixes bug: 1216510

Change-Id: Ib82af10f78fbad0cec55eff3dffd3d36409d8b24
Add V3 API samples for ext-status,hypervisor,admin-actions

Partially implements blueprint v3-api-unittests

Change-Id: I537366c1824792fb5345544fc27647816d4d824f
Fixes modules with wrong file mode bits in virt package

Modified file permission from 755 to 644.
Deleted a redundant log setup in /nova/virt/baremetal/driver.py to
avoid merged errors in gerrit which happens if no content has changed.

Partially fixes bug #1224226

Change-Id: I9db283c5b49c9f64e6ea52b8b0771d47c5fbbb83
Merge "Fixes test scripts with wrong bitmode"