Bump next version to 2012.2.1

Open stable/folsom by bumping next version to 2012.2.1.

Change-Id: I18d56849f786cf3ba48bec8f4acd72b2fc777a00
Replace builtin hash with MD5 to solve 32/64-bit issues.

It seems that Python's builtin hash returns different
values on 32-bit and 64-bit architectures, so it's
safer to use a well-defined hash like MD5.

bug 1050359

Change-Id: Ibb49f7b9028085d2aedaf05b94e1e1dcdf5e4cb4
Fix startup with DELETED instances

Make sure that compute manager with DELETED and SOFT_DELETED instances
starts up properly. Before it was possible to end up with only the db
entry and no local configuration allowing a successful restart (even
then it would be the wrong decision to try).

Fixes bug 1053441

Change-Id: Iab1ca81068733a5e8546c32ad122f1d60d22310b
Fix CloudPipe extension XML serialization

It is completely broken right now and this fixes it to properly
traverse a list of cloudpipe instance dictionaries, resulting
in XML output that matches the API spec.

Fixes bug: 1056242

Change-Id: Ic768afeaa76d776fd55a4f618d14fa41ed4c8a63
libvirt: Improve the idempotency of iscsi detach

When detaching an iscsi volume it is possible for the iscsi commands
to run concurrently, causing a target to be deleted by one greenthread
while the other is continuing. When removing the iscsi connection,
we should always ignore exit code 21 because that means that the
target has already been removed.

Fixes bug 1057719

Change-Id: I0c9f2623f85a817e2be506f9a6d523d45c76848a
Restore SIGPIPE default action for subprocesses

Python ignores SIGPIPE on startup, because it prefers to check every
write and raise an IOError exception rather than taking the signal. Most
Unix subprocesses don't expect to work this way. This patch (adapted
from Colin Watson's post at http://tinyurl.com/2a7mzh5) sets SIGPIPE
back to the default action for nova.utils.execute and nova-rootwrap
created subprocesses.

Fixes bug 1053364

Change-Id: I17e1629bb4ef4268515c6734ddb6e12746739c52
Fix booting a raw image on XenServer

Fixes bug 1055413.

ImageType.from_string removed, as it was only used by its test.
Introduced ImageType.get_role, that returns the image's role within the
VM. In case of DISK_* image types, the role is always 'root'. Role
should be the key when accessing the vdis dictionary.

Change-Id: Ieb952a9246d06a8280510113a98b888237abcc65
Fix XenServer's ability to boot xen type images

Fixes bug 1055431.

As the scheduler wants to boot a vm_mode=xen type of image, the host's
"supported_instances" capability is used for finding a good candidate.
In the Xapi case, this field was not populated.

This fix modifies the xapi xenhost plugin, so the Xen host capabilities
are returned back to the compute node, as "host_capabilities".
On the compute side, the mentioned information is used, to extract the
"supported_instances" information.

Change-Id: I2da11ab81f74b5b52e2c30832a694470978e21b0
Deleting security group does not mark rules as deleted

Adds query to also delete rules for parent_group_id

Fixes bug 1056380

Change-Id: I3d041b49703bf298a80d2ebe19c1298eecf2d98d
Bump the version of SQLAlchemy in pip-requires

Fixes bug 1057145

Change-Id: I5960b28f4c4feb3f68b21ae09c6d7de0f098b8e5
ip_protocol for ec2 security groups

fix for bug 1057196.
-Enforce restrictions on IP protocol in AuthorizeSecurityGroupIngress call.
 This value may only be: 'tcp', 'udp', 'icmp', '6', '17' or '1'
-Ensure that ip protocol returned from DescribeSecurityGroups is in lower case,
 in case security group was set improperly in previous versions
-Update EC2APIError in nova/exception.py to remove the HTTP error code from the
 message. The HTTP error code is inserted in nova.api.ec2.faults.Fault. Inserting
 the code in the EC2APIError causes the HTTP code to appear twice in the message
-Update unit tests to expect new error message when invalid protocol is entered.
-Fixing pep8 issues

Change-Id: Iffe0f38abde327288e6a3960a72ad6a273f78aca
Set read_deleted='yes' for instance_id_mappings.

Since the migration that creates the instance_id_mappings does
not populated the 'deleted' column, queries to this table should
not limit results to 'deleted=0'.  Limiting to non-deleted rows
results in duplicate mappings being created for existing instance
mappings after an upgrade, and throws off the entire EC2 instance
ID to UUID mapping.

Fixes LP: #1061166

Change-Id: I8893954fcae94a71dcc284c1b3b23b53901437eb
(cherry picked from commit 1d0402cf65458c941639f01334a996c11e592018)
Pass block_device_info to destroy in revert_resize

Fixes bug #1056285

Passing block_device_info allows the driver to clean up block
device mappings (detaching) properly on the newly resized instance

Change-Id: I2527f883883c741dbf4d20be0ca33dbef6f9f36a
(cherry picked from commit a9fc0c43873ef7dfe3c2ee0e57b219ddd6746df3)
Set defaultbranch in .gitreview to stable/folsom

This allows people run git-review without any arguments.

Change-Id: I52dd7ddaa8c7e635178b7f9718de281b2d074abd
Avoid RPC calls while holding iptables lock.

This exhibitied itself as very slow instance starts on a Canonical
test cluster. This was because do_referesh_security_group_rules()
was making rpc calls while holding the iptables lock. This refactor
avoids that while making no functional changes (I hope).

Fixes bug: 1062314
Change-Id: I36f805bd72f7bd06082cfe96c58d637203bcffb7
Cherry-picked: ba585524e32965697c1a44c8fd743dea060bb1af
read_deleted snapshot and volume id mappings.

Since the migration that creates the volume_id_mappings and
snapshot_id_mappings tables does not populate the 'deleted' column,
queries to this table should not limit results to 'deleted=0'.
Limiting to non-deleted rows results in duplicate mappings being
created for existing instance mappings after an upgrade, and
throws off volume and snapshot ID to UUID mapping.

This is a stop-gap measure to ensure avoid serious breakage during
an upgrade.  The NULL columns in this table are actually unused
currently and can be populated in later grizzly migrations, if they
end up being used.

Fixes bug 1065785.

Change-Id: I893c994362a203288b9984f0ede24cbb274bfcc5
(cherry picked from commit 43bf8344488a6af1046344c255bdb2edd7450475)
Merge "Set defaultbranch in .gitreview to stable/folsom" into stable/folsom
Merge "Pass block_device_info to destroy in revert_resize" into stable/folsom
Merge "Fix startup with DELETED instances" into stable/folsom
Merge "libvirt: Improve the idempotency of iscsi detach" into stable/folsom