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
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
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
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
Fixes error message for flavor-create duplicate ID

Fixes bug 1056918

Change-Id: I516153211504b67f6e8b8ebb138abcef4be4d73e
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
Added compute node stats to HostState

Added compute node statistics to the HostState class for use
by scheduler filters.  These are statistics pre-computed on the
compute side of the house and are of general interest for filter
authors.

Change-Id: I6d979b1a9f26b8390c20b4ebbde3c9cb8f000396
libvirt: allows attach and detach from all domains

Previously attaching/detaching from a shutoff domain would fail.

Fixes bug 1057730

Change-Id: I876872700da125cb078746401b1b80da265880ff
libvirt: continue detach if instance not found

Currently the libvirt code will always logout of the iscsi target
during detach error, but the exception will cause the volume to
remain in an attached state. This needs to be more consistent, so
This patch checks specifically for not found and logs a warning
and explicitly detaches. Any other exception will leave iscsi
logged in and leave the volume in the attached state.

Fixes bug 1057756

Change-Id: I23bb7f27e8a9b20fdbf62b0629ca8cc448f427c5
Max I/O ops per host scheduler filter

Provide ability to filter hosts based on the number of concurrent
build, resize, and image snapshot operations in progress.

FLAGS.max_io_ops_per_host is used to control the number of concurrent
permitted operations.

Change-Id: I77feca00a6b6b248de8423cef7fb8da2cf704930
Merge "optimize slightly device lookup with LXC umounts"
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
Add api samples to cloudpipe extension

Change-Id: I0c9d5ac191c9c9dc6c74f955857aebf7c1952b94
Merge "Added compute node stats to HostState"