Catch NotFound exception in FloatingIP add/remove

Catch the FloatingIPNotFoundForAddress exception for add/remove
operations in floating ip extension for non existing floating ips.

Fixes bug 977536

Change-Id: Ied450aa56ef7a52a015c6d78a099d445ab6258b6
all_extensions api_samples testing for server actions

server actions sometimes return servers objects, which means
their output is different when extensions are enabled. This
adds api samples for those cases to give a more realistic view
to the user of what they might expect.

Change-Id: Iaa9a4c3a373dee41931c5dc4f1b805f09a05299f
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
Add servers/ips api_samples tests

Change-Id: I65f8b53b4126458e1522f0bc47559dc1318a473a
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
Collect more accurate bandwidth data for XenServer

This changes the method used to poll xenserver for bandwidth data.
The reccomended way of collecting such data from xenserver (namely the
RRD files provided by the hosts) do not seem to be reliable, they
will sometimes be correct, often will be signifigantly under (> 10%),
and occasionally will show artifacts, such as phantom 4gb bandwidth
'spikes'.

This patch changes that to use the much simpler method of simply polling the
byte counters on the VIF network devices on the host. (We have old non-nova
code that does that on xenserver, and that method is known to work).

This should also make it much easier for other hypervisors other than
xenserver to implement bandwidth polling, as polling the counters is a rather
more universal method.

Fixes bug 1055737

Change-Id: I6a280d8bbfcc74914f888b11bc09349a270a5f58
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
Check that an image is active before spawning instances.

Resolves bug/1054163.

Change-Id: I4095fcac300a161e6da93bdc14eb43257d4f1aee
Modified 404 error response to show specific message

User-friendly messages are returned for invalid
floating-ip and volume inputs

Fixes bug 1056038

Change-Id: I659323b81ac435793152f9b49335b350c0801d81
Fix issues deleting instances in RESIZED state

DB API call migration_get_by_instance_and_status requires admin
context...and it'll also raise an exception if no migration matches.

_delete() in compute/api was not using admin context, and was checking
for a false return from the DB call vs checking for an exception.

Added a test that covers both problems.

Fixes bug 1056601

Change-Id: Ib3c631dccbb2776761cf5acb8bab1d814bf3e282
Replaced default hostname function from gethostname to getfqdn

Fixes bug 1055503

The standard behaviour of the 'gethostname' function in Python differs from
Linux to Windows. A common Linux configuration returns the FQDN, while a
Windows one returns only the host name.

To resolve inconsistent node naming in deployments that mix windows and
Linux, it is proposed to use 'getfqdn' as default function instead of
'gethostname'. This is function is more predictable in all cases.

Change-Id: I3164d9a36df2b8484bbf9a57879c31fa0e342503
xenapi: increase timeout for resetnetwork agent request

Windows can take longer than the default 30 seconds for resetnetwork
requests. Double the timeout for the command to 60 seconds, but add
a flag so it can be changed without code changes in the future.

At the same time, add a flag for all other agent requests too.

Change-Id: Iba91c37fd5596ea0dd63c20f74925972df1ca715
xenapi: Removing legacy swap-in-image.

This patch removes our legacy handling of swap in the image. Now that
we're generating swap on-the-fly, this stop-gap solution can go away.

Change-Id: Ied3198f77af8dabb6cfbf2ab9cfb3a4eb18e32ea
Support for several HA RabbitMQ servers.

Port from openstack-common: https://review.openstack.org/#/c/10305/

Change-Id: Ib44abf115b42c3df42771344f6722ce1db043bbd
Merge "Fix issues deleting instances in RESIZED state"
optimize slightly device lookup with LXC umounts

Only canonicalize the path once, rather than for
each entry in /proc/mounts.

Change-Id: I6e582b44f171a1c4cc151d615e9dcfae1e590a53
Reported-by: Kevin L. Mitchell
Bump the version of SQLAlchemy in pip-requires

Fixes bug 1057145

Change-Id: I5960b28f4c4feb3f68b21ae09c6d7de0f098b8e5
Remove unnecessary check if migration_ref is not None

migration_get_by_instance_and_status will raise MigrationNotFoundByStatus
if the migration isn't found, so the extra check is unnecessary since
migration_ref can never be None.

Change-Id: I640c4f64234f3991e03fcf23789c428854becc87
Merge "Remove unnecessary check if migration_ref is not None"
xenapi: make it easier to recover from failed migrations

If a migration/resize fails, the source VM may or may not have it's name
changed in xapi. This makes recovering from a failed migration more
difficult than it needs to be. Moving the rename to be done first
ensures that it always be renamed.

Change-Id: I9296aa67af01d4a832bc63bcb9b71ee20b1221cc