Add a tunable to control how many ARPs are sent.

This new flag, send_arp_for_ha_count, controls how many
ARPs are sent when binding a floating IP address to an
instance.  Also increased the default number to 3 from 1,
to make this more robust and guarantee other network
devices see them.

Fixes bug 1043796.

Change-Id: Ib9118fcc5334ef4a8c5d7a5e765364e26fea68da
Fix EC2 cinder volume creation as an admin user.

Updates the EC2 API _format_volume function so that it
only tries to add project_id and host to responses if those
keys are present.  This resolves a KeyError that would occur when
using Cinder because volumes from it don't contain this
information.

Fixes LP Bug #1046464.

Change-Id: I56b977cfd1ae482f2559a3f1fda8d1543d3ea227
Specify the conf file when creating a volume.

Updates the tgt-admin command to actually use the config file
we create for the volume being created.

This fixes an issue introduced in
66f6a9edce3ccd624aba5d2a6bf3362901ed57f7 which breaks iscsi
volume creation.

Fixes LP Bug #1046985.

Change-Id: I58bd23ef6dd0055a329ace8e4b09d86886aa38e9
Implement paginate query use marker in nova-api

1.add limit and marker param to db.instance_get_all_by_filters()
2.set the filter use marker
3.execute limit before sqlarchmy get_all()
4.add testcase 'test_db_api.test_instance_get_all_by_filters_paginate'
5.related testcase:
    test_get_servers_with_marker()
    test_get_servers_with_limit_and_marker()
  in nova/tests/api/openstack/compute/test_servers.py
    test_instance_get_all_by_filters_paginate()
  in nova/tests/test_db_api.py
6.add InvalidSortkey exception

Implement bp:efficient-limiting.

Change-Id: Iea3eeb7b51194b6017d624506aafc6469d7338e4
Fake requests in tests should be to v1

v2 does not exist, yet.

(cherry-picked from cinder commit ac1b465)

Change-Id: Id3a332c4d78c87882a7db1a8b98479a3881b0a5f
Use volume driver specific exceptions

Change generic use of exception.NovaException in the nova/volume directory
to specific exceptions. The exceptions used in this patch are:

 exception.VolumeBackendAPIException
 exception.InvalidInput
 exception.InvalidVolume
 exception.VolumeAtatched

Patch includes updates to the appropriate tests as well.

(cherry picked from cinder commit 3905a99)

Change-Id: I10407ff3f5babe64e88f445d3529269b7665ee16
rbd: implement create_volume_from_snapshot

In an upcoming release, rbd will support creating volumes from
snapshots ('cloning'). To clone a snapshot, it must first be
'protected', which means it cannot be deleted until it is unprotected.
A snapshot can only be unprotected if no clones depend on it. Thus,
translate a failure to unprotect into a SnapshotIsBusy exception.

Also check for remaining snapshots before deleting a volume,
and raise VolumeIsBusy if any exist. While we're here, tidy up
the shell arguments to be more readable.

This is backwards compatible since it does not use the new features
unless they are available in the installed version of rbd.

(cherry picked from cinder commit ff45e32)

Change-Id: If4105e7af7ba33f09a15103b53ad675aceb2ebb4
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Call driver for attach/detach_volume

The volume driver may want to know which guest is going to be
attached to a volume. The manager now calls down into the driver
on attach_volume and detach_volume.

Fixes bug 1038109.

(cherry picked from cinder commit 17538890)

Change-Id: I084c2d09a1871fa158312f9ba479abb474da1d28
Fix typo in tgtadm LOG.error() call

Fixes bug #1046875

Fix typo in LOG.error, it should be vol_id rather than volume_id.

(cherry picked from cinder commit d6a5d0f)

Change-Id: Id162c6f185a110b63e8f9f509f5cde75f3626cbf
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Stop lock decorator from leaving tempdirs in tests

In some versions of python 2.7, we must use the nonlocal keyword to
give an inline function access to a variable in the enclosing scope.
This leads to a tempdir not beaing cleaned up because a boolean in
the synchronized decorator doesn't get set properly. Since we are
still supporting python 2.6, this patch removes the method call
completely so we don't have to worry about locality.

The patch also moves acquiring the lock  inside the try, except to
make sure the tempdir is still cleaned even if there is some issue
with getting the lock.

Fixes bug 1047530

Change-Id: Ie3da18262e67de076b1e474c24edd2e4e5208646
Merge "Fix EC2 cinder volume creation as an admin user."
Merge "Add a tunable to control how many ARPs are sent."
Correct ephemeral disk cache filename.

Fixes a typo that was added in 23987c19c4f10f31b3000c75a2431e170e78daa4.

Fixes LP Bug #1047628.

Change-Id: Ia525288b758c2f5a4825394b24810c509962c961
Merge "Implement paginate query use marker in nova-api"
Merge "Fake requests in tests should be to v1"
Refer to correct column names in migration 98

Database migration 98 was referring to local variables rather than
actual column names in update calls. This patch changes those
references to be the actual column names.

Fixes bug 1047633

Change-Id: I8ceead5be32f5f56b7d15c8bed23836b29fb382a
Merge "Use volume driver specific exceptions"
xenapi: Make dom0 serialization consistent.

The dom0 plugin code had been using `pickle` for serializing input and
`json` for serializing output which was needlessly inconsistent. This
patch makes the code use `pickle`--chosen for its better handling of
`datetime` objects--for both sending and receiving data.

This patch also refactors the code so that neither the caller nor the
callee need to explicitly worry about serialization: the caller just
passes in args and kwargs, and the callee's function signature just
accepts the args and kwargs as usual.

Bonus: Removes unecessary imports

Change-Id: I3abb42eeebd8d37d67e6c26fa7bcae66d876b3ee
Add Server Detail and Metadata tests

Change-Id: Ic5386478a706ee5af8301315bfd3a2842af5a781
Set install_requires in setup.py.

Updates setup.py to set install_requires using parse_requirements from
openstack-common.  This allows DevStack to install nova requirements, as
currently they are not handled.

Also relaxes the version requirement for lxml to >=2.3,<3.  This allows
DevStack to install nova requirements without needing to install lxml
over the installed python-xml system package, currently 2.3.2.

Change-Id: Iccebf9604ba5c6fcacb4c5fa5004f9fcb08944f3