Fixes snat rules in complex networking configs

There is currently no way to disable nova's snat rule, which causes
problems for some network configurations with an external gateway.
This patch allows the snat to be completely disabled by setting
a blank value for routing_source_ip.

This patch also makes the snat rule a little more specific, only
snatting traffic that is destined for the public interface (or
the floating interface if it is defined). This allows the snat
to work without changing routing_source_ip and also ensures that
an instance assigned multiple ips from different floating pools
will connect from the appropriate address for each pool

Fixes bug 1048765

Change-Id: I18be88a3dbb7a9f4762db7beefc94e07b8310100
Fix volume deletion when device mapper is used

Call dmsetup remove if there is a /dev/mapper/nova--volumes-
element present.

Resolves bug 979020

Change-Id: Iddaaed411a77dda4bd32f9a97687ff17744119eb
Fix volume id conversion in nova-manage volume

  The nova-manage volume commands weren't updated when the switch
  from int volume-id's to uuid's was made.  This updates the
  param2id method to call the appropriate conversion, and doesn't
  attempt to cast the value to an int.

  There is an additional issue with the nova-manage commands with the
  introduction of Cinder.  The calls in nova-manage are direct to the
  nova database which when using Cinder is not valid.  Add an error message
  when trying to use delete or re-attach commands as they don't work.

  This change deprecates the nova-manage delete function as it's now
  implemented as an admin extension (nova commit id: If795599d and
  cinder commit id: I29f4b892).

  The reattach command is only valid for nova-volumes, a similar extension
  will need to be added to cover cinder at which time the nova-manage volume
  reattach can be deprecated as well.

  Partial fix for bug #1051603

Change-Id: I666d4e627dee4a2025f7135560ee36c40f4bf17a
Add console output extension to API samples test.

Change-Id: I0ac1f893b06882acaa7c61dade61eb991a5d0d04
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
Merge "Fix volume deletion when device mapper is used"
Adds new volume API extensions

Adds following extensions:
1. Create volume from image
2. Copy volume to image

Added unit tests.

Implements: blueprint create-volume-from-image

Conflicts:

	cinder/api/openstack/volume/contrib/volume_actions.py
	cinder/tests/api/openstack/fakes.py
	cinder/tests/api/openstack/volume/contrib/test_volume_actions.py
	cinder/tests/policy.json
	nova/api/openstack/volume/volumes.py
	nova/flags.py
	nova/tests/api/openstack/volume/test_volumes.py
	nova/tests/test_volume.py
	nova/utils.py
	nova/volume/api.py
	nova/volume/manager.py

This is based on a cherry-pick of cinder commit
2f5360753308eb8b10581fc3c026c1b66f42ebdc with bug fixes
8c30edff982042d2533a810709308b586267c0e9 and
ffe5036fa0e63ccde2d19aa0f425ec43de338dd7 squashed in.

Change-Id: I9c73bd3fa2fa2e0648c01ff3f4fc66f757d7bc3f
add get_location method for images

This is useful for determining whether the backend storage for the
image in Glance is the same as the storage used in a volume driver.

The direct_url is only available in the v2 images API, so add a
version parameter to each request. As more parts of the v2 API are
used, this parameter will become more useful.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>

Conflicts:

	nova/image/glance.py

This is based on a cherry-pick of cinder commit
171a57a6879683dac5f219a0e8f1080ea687105d

Change-Id: I5ca06b6d80ffe4118f8dd381ed11283573bce71f
add ability to clone images

Given the backend location from Glance, drivers can determine
whether they can clone or otherwise efficiently create a volume
from the image without downloading all the data from Glance.

For now implement cloning for the RBD driver. There's already a
Glance backend that stores images as RBD snapshots, so they're
ready to be cloned into volumes. Fall back to copying all the
data if cloning is not possible.

Implements: blueprint efficient-volumes-from-images
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>

Conflicts:

	nova/volume/api.py
	nova/volume/driver.py

This is based on a cherry-pick of cinder commit
edc11101cbc06bdce95b10cfd00a4849f6c01b33

Change-Id: I71a8172bd22a5bbf64d4c68631630125fcc7fd34
Merge "Fixes snat rules in complex networking configs"
Merge "Add console output extension to API samples test."
Merge "Fix volume id conversion in nova-manage volume"
Merge "Adds new volume API extensions"
Merge "add get_location method for images"
Merge "add ability to clone images"