xenapi: Do not retry snapshot upload on 500

If Glance returns a 500 response on an initial attempt to upload
a snapshot image, it will set the image status to killed.  Any retry
attempts will fail with a 409 response.

Hence, Nova should not attempt to retry the upload in this case, which
will eliminate many pointless retries.

Closes-Bug: 1349933

Change-Id: I1a8f2416923a368b02cf8963c747ebbb24d749a1
Add valid method check for quota resources

ReservableResource and CountableResource comes down to
the method used to count the in-use
resources.  For ReservableResource, the count is based on the number of
database objects matching the project ID, whereas with
CountableResource, a counting function has to be specified; otherwise,
the classes are identical and designed to be used identically.indeed,
CountableResource extends ReservableResource and only overrides the
constructor.

This patch add some sanity-checking to limit_check() and
reserve() that ensure that they only work with the correct resource
type(s)

Change-Id: Ibec048a5d8c2c4a8685f5f3cc2076c64b39654a3
Partial-Bug: #1301532
Handle FloatingIpPoolNotFound exception in floating ip creation

If an invalid pool is specified when creating a floating ip
with neutron as the backend a FloatingIpPoolNotFound exception
can be raised. This change handles the exception at the API level.

Change-Id: Iac46d86a11f2c1da0ed7e7861cdb87fd4d4b4c6c
Closes-Bug: 1352141
Add method for deallocating networks on reschedule

The original call to dhcp_options_for_instance() is not a great way to
check whether deallocation of networks should happen on reschedules.

This adds a new virt driver method 'deallocate_networks_on_reschedule'
which can be used by a virt driver to say whether reschedules should
deallocate networks first. This defaults to False and modifies the
baremetal virt driver to return True. Ironic virt driver will also need
to return True.

Closes-Bug: 1342919
Change-Id: I54a3252ab15e2d8b596ccc90eb4755405021f1da
Merge "Add method for deallocating networks on reschedule"
Merge "Handle FloatingIpPoolNotFound exception in floating ip creation"
Merge "Add valid method check for quota resources"
Merge "xenapi: Do not retry snapshot upload on 500"