Update Instance from database after destroy

In cases where Nova falls back to simply locally deleting an
instance, the Instance object was not updated with the deleted_at
generated by the database implementation. Due to this, the
notification emitted to signify that the delete finished was
getting emitted without a deleted_at value.

This change uses the result from the instance_destroy call to
update the Instance object with the latest state from the database.
Thus, the compute.instance.delete.end notification is emitted
with the proper deleted_at value.

Closes-Bug: #1250206
Change-Id: I55ed37cf89dd6eb8ea901c6f813191a0ce1058e8
Use a dictionary to eliminate the inner loop in _choose_host_filters()

it looks like an o(n²) algorithm, we can use a dictionary to eliminate
the inner loop.

Change-Id: I32747120ae1f2f1bc0a3810a03e0cd9baa7a8d2c
XenAPI: Synchronize on all VBD plug/unplug per VM

Dynamically adding or removing a device needs to be synchronized
to work around a bug in XenServer 6.1 and 6.2 where simultaneous
events can be partially ignored, leading to a failure to plug or
unplug.  The bug is between two internal components in XenServer
which pass messages - the first component will ignore all messages
from the second while a plug/unplug is in progress, expecting
only one message to be received.  If two plug/unplugs occur in
this time, an internal assertion is raised as XAPIs internal state
is inconsistent.

Change I7b86325714e38b00a2f51bbf083b5532a6c51fa9 attempted to
work around the issue by retrying - however that does not catch
all failures.  This change should eliminate some of the known
INTERNAL_ERROR failures, but not all, so I7b8 need not be
reverted.

Change Ie7a64c481a9e3874df9d5924fbb050ac7ab117db does the same
as this, but only for VBD.plug.

Change-Id: If78d4e5f1dd84f1d4a588f25b8f887a7b125bbea
Closes-bug: 1217972
Don't replace instance.info_cache on each save

If we are working on an Instance that came from an older client,
we should not replace an older nested .info_cache object with a
newer one for no reason during a save().

Related-Bug: #1258256
Change-Id: I8cf4a629d454de1a5de16ea4032f39e36aab505a
Merge "Use a dictionary to eliminate the inner loop in _choose_host_filters()"
Merge "XenAPI: Synchronize on all VBD plug/unplug per VM"
Merge "Don't replace instance.info_cache on each save"
Merge "Update Instance from database after destroy"