Set the image_meta for the instance booted from a volume

If the VM is booted from a volume, image_meta should be retrieved from the field
volume_image_metadata in volume.

Fixed Bug 1191069.

Change-Id: I4df185ab5eeb819327606163565501c845411a7e
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
fix libguestfs mount order when inspecting

variable `mounts` sorted value is
[
    ('/boot', '/dev/vda1'),
    ('/', '/dev/vda2'),
    ('/var', '/dev/vda5'),
    ('/home', '/dev/vda6'),
    ('/home/q', '/dev/vda7')
]
but `/boot` directory is in `/` partition.

Fixes: Bug #1210371
Change-Id: I3d9cd59237bc4fc277415104c9170d2e372a1c25
Handle NeutronClientException in secgroup create

When networking is provided by Neutron and a security group or a security group
rules quota is exceeded, we get a NeutronClientException with status_code 409
and message "NeutronClientException: Quota exceeded for resources"

This patch updates the neutron security group driver to handle this exception
and translate it to nova's SecurityGroupLimitExceeded

test_neutron_driver is also updated to provide unit tests for this patch

Change-Id: I0fa57b02694221507885ab4bfdb5805e936450e2
Fixes: bug #1209446
Port disk_config API to v3 Part 2

This patch contains the changes required to adapt the agent
extension and the corresponding unittest to the v3 framework.
Moves the commented out tests from the v3 version of test_servers
to the user data extension unittests.

Partially implements: bp v3-api-extension-versioning
Partially implements blueprint nova-v3-api

Change-Id: I7eef3ba18d7cc36c1ef78d093f50fd9122ac26c7
Demote personalities from core of API v3 as extensions os-personality

This patch move 'personality' from core into extensions.
* demote personality the attribute of server from servers
* add corresponding tests
* move some tests about personality from test_servers to test_personality

Partially implements blueprint nova-v3-api

Change-Id: I62254a94476271b1d8bcc206dfda1236f155960b
Offer a paginated version of flavor_get_all

Implements nova.compute.flavors.get_all_flavors_sorted_list to
optimise get_all_flavors.

Fixes: bug #1028494
Change-Id: Ie0406c1d4b47a51473979910c0908b153497d503
Don't pass RPC connection to pre_start_hook

In review I5bf7795fca21627566ef4f688d45dc83bb953d1b (commit 3349417) we
passed an rpc_connection argument to pre_start_hook() so that we could
create additional queues.

See review Idf12c418a8ce1bc873e7ad6f702351e95d31aca3 for how this was
intended to be used. With oslo.messaging, we'd support doing something
like this by adding support for multiple targets to RPCServer since the
concept of a messaging connection isn't really exposed by the API in
quite the same way.

In any case, this rpc_connection parameter has never been used since it
was introduced, so let's remove it. Let's also move the invocation of
this hook back to where it originally was.

blueprint: oslo-messaging
Change-Id: I9181a3567a1b5a8a6077e78c85f4d28660f275a6
Add Migration object

This adds a migration object implementation and tests.

Related to blueprint compute-api-objects

Change-Id: Iec0e45f4768cf3fc2f31c1c23c1aadfdefefa797
Make API part of instance boot use new BDM format

This patch makes the API part of the instance boot process rely on the
new BDM format. It adds additional validations that are enabled due to
using the new format.

Since the new format will allow to specify devices that will be created
as images on the hypervisor (if the hypervisor enables it), in order
to prevent a DOS, a new config option 'max_local_block_devices' was
added. This option allows the operator to set a limit on the number of
destination_type='local' block devices a user can specify per VM.

This patch also refactors and simplifies how block devices are handled
during boot, and makes sure that validation errors are caught and
transformed to expected HTTP errors.

Change-Id: I62e0807fcff0a284ff72555d107cac1c9864e46d
blueprint: improve-block-device-handling
Change RPC to use new BDM format for instance boot

This patch makes rpc calls that are the result of booting an instance
propagate the new block device mapping format.

The way this is done is by adding a 'legacy_bdm' flag to the conductor
(task) API. Since both the scheduler and the compute service propagate
the block device mapping as part of the request_spec field, a flag named
legacy_bdm_in_spec to indicate that was introduced in their respective
APIs.

Currently block_device_mapping is not used by any of the in-tree filters
in the scheduler, so it is assumed that scheduler's boot functionality
has now transitioned to the new format.

This patch also bumps RPC versions of the task, scheduler and compute
manager classes.

Finally this patch propagates the legacy_bdm_in_spec through the
run_instance callback of the compute manager so that, in case of error -
the instance is re-scheduled with the proper flag set.

blueprint: improve-block-device-handling

Change-Id: I5f25ddd4d586dda91061f065c1796be726b0ede3
Merge "Handle NeutronClientException in secgroup create"
Merge "Personality files can be injected during server rebuild"
Merge "Add Migration object"
Merge "Don't pass RPC connection to pre_start_hook"
Merge "Set the image_meta for the instance booted from a volume"
Merge "Offer a paginated version of flavor_get_all"
Merge "Port disk_config API to v3 Part 2"
Merge "Demote personalities from core of API v3 as extensions os-personality"
Merge "fix libguestfs mount order when inspecting"