XenAPI: Tidy calls to get_all_ref_and_rec

get_all_records is more efficient than getting them individually in the
old get_all_ref_and_rec implementation.

Replaced some cases of get_all_records with a faster and more
specific API call.

Change-Id: I4725c3f1fdebdf1737941cb7db69b19afb22df9f
XenAPI: Speedup get_vhd_parent_uuid

In many cases the VDI record has already been retrieved.
Use it rather than expensively getting a new VDI record from XAPI.

Change-Id: I469e2a415c1f1924010f47d3927ca18c45a7b8f8
Remove XML support from v3 API plugins

Remove XML support from the following v3 compute API plugins:

 - hosts
 - hypervisors
 - instance_actions
 - ips
 - keypairs

Part of blueprint remove-v3-xml-api
DocImpact

Change-Id: I49da82632c884cdac36ee37674a4d0fc360fdd83
Remove XML support from flavor v3 API plugins

Remove XML support from the following v3 compute API plugins:

 - flavor_access
 - flavor_manage
 - flavor_rxtx
 - flavors
 - flavors_extraspecs

Part of blueprint remove-v3-xml-api

DocImpact

Change-Id: I9745285cb6053dcb634c23002f1f24412dc62021
Remove XML support from quota and scheduler_hints v3 API plugins

Remove XML support from the following v3 compute API plugins:

 - quota_classes
 - quota_sets
 - scheduler_hints

Part of blueprint remove-v3-xml-api

DocImpact

Change-Id: I3ce2bcb1a7d7e152b0bfb96316ce8f1aab10061d
Remove XML support from some server v3 API plugins

Remove XML support from the following v3 compute API plugins:

 - security_groups
 - server_diagnostics
 - server_metadata
 - server_password
 - server_usage

Part of blueprint remove-v3-xml-api

DocImpact

Change-Id: If3e8d82d6db2a2ff328ba477bffd5081f098be9a
Remove XML support from some extension v3 API plugins

Remove XML support from the following v3 compute API plugins:

 - extended_server_attributes
 - extended_status
 - extended_volumes
 - extension_info

Part of blueprint remove-v3-xml-api

DocImpact

Change-Id: I4f3785fbdac7257370458a3bdd859d46ef83f415
Remove XML support from some v3 API plugins(e.g. services)

Remove XML support from the following v3 compute API plugins:

 - config_drive
 - services
 - simple_tenant_usage
 - versions

Part of blueprint remove-v3-xml-api

DocImpact

Change-Id: I58a29974253a5acfb04f42cf4712ba290203cb5a
Remove XML support from certificates v3 API

This patch removes XML support from certificates v3 API.

Part of blueprint remove-v3-xml-api

DocImpact

Change-Id: If34053c1dce851dc6b3fd2bd1b8ebd03849bae53
Remove XML support from admin_password V3 API plugin

Removes all XML support from the V3 API admin_password
plugin.

Partially implements blueprint remove-v3-xml-api

Change-Id: Ib45a04d34704bc259ef6e457d6dfb6f79c929edf
DocImpact: XML no longer suported for the admin_password plugin
Remove duplicated method in mock_key_mgr

The method _generate_key_id was duplicated in
nova/keymgr/mock_key_mgr.py

This patchset removes one of the duplicates.

Change-Id: Idb30fca9d392fe5f5b4063ba1b22a967329987f6
Shelve: The snapshot should be removed when delete instance.

When deleting a vm with state "shelved" or "shelved-offloaded",
the vm's snapshot like ‘shelved image’ should also be removed.

Change-Id: Ie9b0f8dec8f85351ef188f70e0fe9414e332aafe
Closes-Bug: #1259462
Add block device mapping objects implementation

This patch introduces the basic block device mapping objects and list
classes and adds tests for the basic functionality.

Related to blueprint: icehouse-objects

Change-Id: I24ace8f730978d2e7046986f212c34604c7b7f20
Move compute API is_volume_backed to BDM objects

This patch makes is_volume_backed_instance use block device objects. It
is a first step towards using new-world BDM objects in code paths that
do not need to send them over RPC.

It will also be the way to go forward when getting rid of legacy block
device usage anywhere outside of the v2 API.

This patch also moves some of the uses of the compute API
_get_bdm_image_metadata method over the block device objects list class
root_metadata method, which has some of the code duplicated. The
duplication is however necessary, since we still need to be able to deal
with old-style block devices until we deprecate the v2 API.

Related to blueprint: icehouse-objects
Related to blueprint: clean-up-legacy-block-device-mapping

Change-Id: Ibfb120ccdeb89291059ffe355957f386aec75007
Make volume_snapshot_{create,delete} use objects

This patch makes the volume_snapshot_create and delete methods use
new-world Instance objects.

It bumps the version of the compute rpc API, and starts passing objects
to the rpc layer. It also makes the driver methods that touch instance
use the dot notation to access the attributes.

It also makes sure that the backwards compatibility is kept by
decorating the manager methods with object_compat decorator.

Part of the blueprint: icehouse-objects
Part of the blueprint: clean-up-legacy-block-device-mapping

Change-Id: I967061cef36b4da06073736fce871fc3f3d28f97
Make snapshot_volume_backed use new-world objects

This patch makes snapshotting of a volume backed instance code path use
new-world block device objects, and thus transitions snapshotting to use
block device mapping v2 data format.

This means that all images that are created by snapshotting volume
backed instances after this change will have new block device mapping
format in their properties. To be able to distinguish between those, an
additional field (bdm_v2) was added to the image properties. This flag
will be taken into account when booting an instance and all necessary
conversions will be done so that both formats are supported. The legacy
block device format will continue to be supported in images, even when
we deprecate it in the API (after v2).

Another noteworthy point is that block device mapping data added to the
image will no longer contain the device name, as it will be dependent on
the configuration when booting a new instance. The mapping will however
keep the boot order.

The code in snapshot will also take care that all of the mappings
present in the image properties are handled and not re-created on
booting an instance from the snapshot image.

Part of the blueprint: icehouse-objects
Part of the blueprint: clean-up-legacy-block-device-mapping

Change-Id: I441cf8f2df0b92a9cc4096e77a90c37a06270eb5
Remove XML support from some v3 API plugins

Remove XML support from the following v3 compute API plugins:

 - access_ips
 - agents
 - availability_zone
 - block_device_mapping
 - cells
 - extended_availability_zone

Part of blueprint remove-v3-xml-api

DocImpact

Change-Id: I9cf3017668774e93d4679067e41da2c8301606a0
Merge "Remove XML support from some server v3 API plugins"
Merge "Remove XML support from flavor v3 API plugins"
Merge "Remove XML support from quota and scheduler_hints v3 API plugins"