Re-attach volumes after instance resize

Fixes bug 1051600.

Update the compute manager to pass block_device_info to three
additional driver entry points and update all virtualization drivers
to accept it as an optional argument.

Within libvirt, migrate_disk_and_power_off() will now iterate and disconnect
any existing connections.  finish_migration() simply updates its use
of to_xml(), passing block_device_info, which returns a libvirt XML
fully populated with volumes.  Finally, finish_revert_migration() no
longer uses the on-disk XML file, instead generating it via to_xml; as
the former lacks volume configuration.

Change-Id: I7dccd03ef9cc7d2848f07764d4def3787e41e202
Raise BadRequest while creating server with invalid personality

Handle UnicodeDecodeError raises from compute api while trying to
create server with invalid personality content and throw it as
HTTPBadRequest

Fixed bug 1050409

Change-Id: I27d47bbc9ed89abfa9827512fbfb3b16a0d87160
make ensure_default_security_group() call sgh

This change makes sure that sgh is called when default
security group is created.

Fixes bug 1050982

Change-Id: I483e33d8977b2bfbd7456a7c7c0d1fe7803708f8
Fix race condition in CacheConcurrencyTestCase

Fixes bug 1052641

Recent changes made to fix bug 1035426 ended up creating a race
condition in the tests for CacheConcurrencyTestCase. Since two
greenthreads are used, the changes to utils.synchronized() can
cause a race where one thread is deleting the lock directory out
from under the other thread.

An unrelated bug caused this race condition to be ignored since
the greenthreads were never waited on and as a result, the exceptions
never had a chance to be raised in the test case.

Change-Id: I86b45414bbacd12bd3f5af323d26e0861c354ba8
Update quota when deleting volume that failed to be scheduled

If one volume was failed to get scheduled, removing such volume should
also clean up reservation.
Also when create_volume is ready to send to scheduler, reservation
should be committed no matter backend can successfully create that
volume or not since deleting volume call will do a minus reservation
even on volume with 'error' status.

This change updates RPC API to version 2.2

Fix bug 1052052

Change-Id: Ia632a0e49318d534f0acbd3df5c9f6bb86eefa2a
Merge "Update quota when deleting volume that failed to be scheduled"
Merge "make ensure_default_security_group() call sgh"
Merge "Raise BadRequest while creating server with invalid personality"
Add Keypairs extension to API samples test.

NOTE: This include two samples of post request: One to create the keypair and
another to import from a public key

Change-Id: I754fd5998cf8be46a96e69e3459c91d4f767575e
Merge "Fix race condition in CacheConcurrencyTestCase"
Merge "Add Keypairs extension to API samples test."
Merge "Re-attach volumes after instance resize"
Mark 2012.2 final in prep for RC1

Mark 2012.2 Final=True as we prepare to publish Nova Folsom RC1

Change-Id: I72731bded164aeec3c7e47f6bfe44fb219a9ea56
xapi: fix create hypervisor pool

Fixes bug 1049099.

Fixing problems with the rpc api when creating hypervisor pools with
xenapi. Rpc calls were not using the compute_rpcapi approach, thus were
not properly versioned. Apart from that, the slave parameters were not
forwarded to the master. A new (2.2) version is introduced where the rpc
calls have the slave_info payload. Added tests to cover the pool cases.
Some trivial extract methods performed on pool, to decouple the pool
functionality from its dependencies.

Change-Id: Ie44a1c09ef204affc4a657c71557691e83b22c22
(cherry picked from commit b8b46cbd6c06cb4979fa2f443892a2a1d60cc7bb)
Fix over rate limit error response

Fixes bug 1046021

Changing overLimitFault element in response to overLimit and setting
the returned Content-Type appropriately. Also adding retryAfter
attribute to provide the same information as the Retry-after header.

Change-Id: I8c32fe7075b918afa62da3f84f1d3b35315e2b9b
(cherry picked from commit e8c37d13eac37210bc34b4ca99e4539c67457120)
Correct IetAdm remove_iscsi_target

Remove logical units should be done before delete the target while
unexport iSCSI volume. Or ietd will show "No such file or directory"
error.

Fix bug 1043107

Change-Id: I06ac561898dbcee078c807ea5368c03e558b4fa9
(cherry picked from commit b46f224f7555e3065b0daacd101b65d86117f0c1)
Improve error handling of scheduler

Modifies scheduler errors to report instance faults and to set
instance_state back to None on failure.

Related to bug 1051066
Fixes bug 1052993

Change-Id: Id9f36a75370849db7baf3fe24ce96c6f4284255d
(cherry picked from commit 0cba85cb267994018c8a0d5e40b2ed0b5a7837df)
Fix marker pagination for /servers

Fixes bug 1053028.

Recent changes to pagination required passing in full sqlalchemy objects
into paginate_query. However, calls to paginate_query were passing in
strings.

Change-Id: Ib1396a78a12aef1a9cdc31f3624af30f19da44b5
(cherry picked from commit 09b903ed5e3306cf200328f41ce6df371923d03d)
Don't include auto_assigned ips in usage

Fix a regression - auto_assigned floating ips should not be included in
the quota_usages table.

Fixes bug 1052997

Change-Id: Ifa98a5d44cf2a8a8d4c73b4f56b9615dd74b8383
(cherry picked from commit 5d18503be6981ab7e6bbf7743f2ee7505e0c1128)
Fix aggregate_hosts.host migration for sqlite

* Make sure data is not lost during migration
* Changes migration 111_general_aggregates
* Adds test for change

Fix bug 1053131

Change-Id: Idbf0cbd5fdb7758ea1794019807d83d159270cba
(cherry picked from commit a5dbdb53da470916248c8ef8715ef6e06dfa1d0f)