Restore libvirt block storage connections on reboot.

Fixes bug 1036902 -- Backported version for stable/essex.

There are a number of cases where block storage connections are not
properly restored, impacting libvirt in particular. The most common
case is a VM which has block storage attached via iSCSI, whereby the
physical system is rebooted. When the system comes back up and
starts nova-compute, the iSCSI connections are NOT recreated for the
instances slated to be resumed (assuming
resume_guests_state_on_host_boot is set).

The patch changes the compute manager to pass block_storage_info via
driver.reboot() and driver.resume_state_on_host_boot(). The fix is
actually only present in the libvirt driver. However, all the other
drivers were updated to accept the additional, optional function
arg.

With the changes in place, iSCSI connections for libvirt are
re-established after a hypervisor reboot with
resume_guests_state_on_host_boot=True and on every hard_reboot.
The latter is intended so that users have a last ditch option for
recovering their VMs without administrative involvement.

Change-Id: I8ab3a138b559ee0aa1535a928282e9c372ec5651
Makes sure instance deletion ok with deleted data

Commit 5ad1dea4 added changed the network deallocation code to
work with deleted instances. This was done by setting the context
to read deleted records. Unfortunately this was done a little too
broadly, leading to a new bug where a deleted floating_ip will
cause an instance to not be able to be deleted.

This fixes the issue by limiting the use of read_deleted context
to only the places it is trying to access the instance record. It
adds a test  to verify that the code works with a duplicate
deleted floating_ip and updates the existing test for a deleted
instance to exercise the entire code path.

Fixes bug 1038266

Change-Id: I1aef94369e5bcf951e78e89b1eded5305cf36b53
(cherry-picked from commit 1f98e28a80077760394201f79de04a0924b9ad3f)
fix unmounting of LXC containers

There were two issues here.

1. There was a global object stored for all instances,
thus the last mounted instance was always unmounted.

2. Even if there was only a single LXC instance in use,
the global object would be lost on restart of Nova.

Therefore we reset the internal state for the mount object,
by passing in the mount point to destroy_container(),
and querying the device in use for that mount point.

Fixes bug: 971621
Change-Id: I5442442f00d93f5e8b82f492d62918419db5cd3b
Cherry-picked: a5184d5dbf67630dac3abb69b1678b60807cfce7
Add error log for live migration.

Fixes bug: 917615
Change-Id: I740c0def3b1f759aec3d4ae5fe3264484c704807
Cherry-picked: adb98d50d2af36fc6215cbec63fe89e3e67d8fa2
Signed-off-by: Takaaki Suzuki <suzuki@midokura.com>
Fix exception handling in libvirt attach_volume()

Currently, the real reason for a failure is dropped when attempting
to unroll the volume connection (with the exception of when it is
VIR_ERR_OPERATION_FAILED). This change uses save_and_reraise_exception()
to correct that so that the actual reason for failure gets logged.

Fixes bug 1029463

Change-Id: Id47db565c4fb5a88d1a263600b41706dd3419726
Signed-off-by: Aaron Rosen <arosen@nicira.com>
Merge "Makes sure instance deletion ok with deleted data" into stable/essex
Merge "Add error log for live migration." into stable/essex
Merge remote-tracking branch 'upstream/stable/essex' into stable/essex
Ported NAS  support to Essex
Merge remote-tracking branch 'remotes/origin/stable/essex' into stable/essex