Adds v3 API samples for limits and simple tenant usage

Adds the v3 API samples for the limits and simple tenant
usage extensions. Bundled together to reduce review load

Partially implements blueprint v3-api-specification

+DocImpact

Change-Id: I1b73d7acf8d1bbccec2fff6180799edd3f3b12aa
disable direct mounting of qcow2 images by default

* nova/virt/disk/api.py: Set the default for the
'resize_fs_using_block_device' option to False,
so that we don't enable this functionality because:
1. It's not needed for newer images that resize themselves.
2. It enables direct mounting of images which might otherwise
   be disabled for security reasons.
3. It's not supported on systems without the nbd module.
4. It gives noisy diagnostics on such systems.

Fixes bug: 1212734

Change-Id: Ifbd687eae46606176ea196888eeffdde08559c01
Enable test_create_multiple_servers test for V3 API

Now that the multiple create extension has merged we can enable
this test for the V3 API. Need to also override post_server
for the test client for the V3 API as the data return when requesting
a reservation id in the V3 API has changed

Change-Id: I7f34f1e90b872c4679b5c54fe9e4b0f4420910ab
Closes-Bug: #1206884
disassociate_address response should match ec2

The current behavior of disassociate_address does not match that of
what EC2 would return when calling it upon an unassociated address.
In EC2 when disassociate_address is called on an unassociated
address, it returns successfully as such:

<DisassociateAddressResponse
    xmlns="http://EC2.amazonaws.com/doc/2012-08-15/">
    <requestId>aabbccdd-0146-4952-bdbe-710e4fee8387</requestId>
    <return>true</return>
</DisassociateAddressResponse>

However, when this same called is made against the OpenStack EC2
implementation, this would return a 400:

<Response><Errors><Error><Code>InvalidInstanceID.NotFound</Code>
<Message>Instance None could not be found.</Message></Error></Errors>
<RequestID>req-7a9b4d03-b9f5-4243-95d8-f1ccab180631</RequestID>
</Response>

This is due to the fact that we continue to attempt disassociation
despite instance_id == None.

Modify this behavior to match EC2 by simply checking that instance_id
is set before continuing disassociation. Else, bail early, and in
either case report success.

This change also modifies unit tests to account for this change.

Change-Id: I17c822d70918fefa55da2ab096af5b98b87e23e7
Closes-Bug: #1224251
Add linked clone related unit tests for VMware Hyper

Test image file is cached when linked clone is enabled, and image file
is downloaded and  stored to instance dir directly when it's disabled.

Fix bug #1226450

Change-Id: I90f940de3de19a41b122e098d6788a5652287605
send the good binding to neutron after live-migration

Nova was sending the host that previously hosted the vm

Closes-Bug: #1224960

Change-Id: If4677c0d1e11a8cf16f9d49e9ca854ca2fcfb698
Add debugging to ComputeCapabilitiesFilter

When ComputeCapabilitiesFilter fails to match an extra_spec its hard to
debug which requirement is missing, add a LOG.debug statement to make
life easier.

Change-Id: I5d24d6ceee92611af112c2fbac1564cc3f9bf838
Force textmode consoles on baremetal

Physical hardware often has console interception hardware for OOB
monitoring/management. Prevent the kernel from switching into a
graphical console mode so the hardware can do its job.

Change-Id: I3a5b17ab194238ada34fee1c834de22fbdcd7430
Related-Bug: #1178112
Change service id to compute for compute/api.py

Now the default service id for nova api notification is aggregate,
this is not accurate, we should change it to compute.

Fix bug 1225579

Change-Id: Ife558024c57d9fd035cd1a618063c656e03c52a3
Remove unused _instance_update() method in compute api

The _instance_update() method was previously used in lock/unlock
but that changed when they were converted to use instance objects.

Change-Id: I1f1e00b31792fd13a5b72a15c0cb11cfde75f794
VMwareVCDriver Fix sparse disk copy error on spawn

The same approach of calling VirtualDiskManager.CopyVirtualDisk
without destination disk spec in the cluster driver for fixing 1184807
turns out to work for copying a sparse disk as well because vCenter's behavior
for specless copy is to do the reasonable thing of converting a sparse disk to
thin-provisioned, and a flat disk to preallocated.

Tests done:

Verified using tempest that sparse/thin/preallocated image types deploys
properly through the cluster driver. Tempest output to be included in
the review comments.

Fixes bug 1171226

Change-Id: I6c48866e06c2aa656c89848564f3262fb7b79039
Correct deleted_at value in notification messages

The deleted_at value in notification messages is currently
set from the terminated_at value in the instance record.

A comment in the code says this is to avoid confusion between
terminated_at and deleted_at,  but swapping the names doesn't
seem to be a great way to address that.

In practice "terminated and not deleted" is a transient state
unless an error occurs, and the time gap is very short.  But
deleted_at is always set when the entry is deleted in the DB,
whereas terminated_at can be left unset in some error cases.

Rather than present terminated_at as the deleted_at value in
the message we include both and let the recipient decide which
they want to use.

Fixes bug: 1227080

Change-Id: Ic67f66b6c64be1a8f43f4fdd5b1fac25f1414247
Convert TestCases to NoDBTestCase

NoDBTestCase is faster because it skips initializing a database for
tests which don't actually talk to the database. Its also nicer
because its more explicit about the dependancies of a given test.
This is a second pass at moving test cases over to the database
lacking version, but further work is required here.

Partial-Bug: 1227473

Change-Id: I16313b8febb8a3c681fdf7e7278cc5a09138e542
Convert TestCases to NoDBTestCase

NoDBTestCase is faster because it skips initializing a database for
tests which don't actually talk to the database. Its also nicer
because its more explicit about the dependancies of a given test.
This is a third pass at moving test cases over to the database
lacking version, but further work is required here.

Change-Id: Ibbe86329c846e9d6df16f3bbe53a75efff6fd604
Partial-Bug: 1227473
Update sample config generator script

This patch reverts 13d80020. The help message should be added
in oslo-incubator since generate_sample.sh is synced from there also.

Resolves bug #1204204

9f2b93b Sample config file generator clean up
33f9f78 Replaces relative path to absolute path in conf file generator
c97e17b Refactors if statement in config generator
8b11fda Provide useful defaults for config generator
4c02e0a Unset OS_xx variable before generate configuration

Change-Id: I96fcb39c0c620c147fea5c96416e506a758619ce
Convert TestCases to NoDBTestCase

NoDBTestCase is faster because it skips initializing a database for
tests which don't actually talk to the database. Its also nicer
because its more explicit about the dependancies of a given test.
This is the final pass at moving test cases over to the database
lacking version.

Change-Id: Iba5ec1f5c0a5724f01779eb5b0f164c4e232632a
Closes-Bug: 1227473
libvirt: add test case for _hard_reboot

Closes-bug: #1228763
Co-authored-by: Jian Wen <jian.wen@canonical.com>
Change-Id: I3650ad354353c8a1bd7a6498c42f6745b22f5192
Fix V3 API server metadata XML serialization

The XML serialisation and deserialization when updating
a single server metadata item or retrieving a single server metadata
item through the V3 API is broken as the JSON format was changed
but the corresponding XML serialisation/deserialisation wasn't.

This changeset fixes this bug and adds testcases for the fixes.

Change-Id: I1bd2a729744387337f86a37dc2ff89606edce424
Closes-Bug: #1223803
Adds v3 API samples for ips and server_metadata extensions

DocImpact

Change-Id: I3774db2ab59335e0f8543c4563028b0c35234dc9
v3 API samples for servers

Adds the rest of API samples for the core servers plugin. This is separate
from the other servers api samples because the output is potentially
dependent on all the other extensions and I'm expecting lots of merge
issues.

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

Change-Id: Iffc814f327b0047c3510bfe5b8bbcb9e0e4540db