summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasanori Itoh <itoumsn@nttdata.co.jp>2011-04-12 02:09:29 +0900
committerMasanori Itoh <itoumsn@nttdata.co.jp>2011-04-12 02:09:29 +0900
commit92df1dc754126895a052bb648c1613201455f714 (patch)
tree03884755086eae9c92270f102b27601bda2c6c27
parente4f7f5cacad59153045bbbae49278298b206e8d3 (diff)
debug tree status checkpoint 2.
-rw-r--r--nova/virt/libvirt_conn.py40
1 files changed, 22 insertions, 18 deletions
diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py
index 567e17a91..0b1ed2a93 100644
--- a/nova/virt/libvirt_conn.py
+++ b/nova/virt/libvirt_conn.py
@@ -487,6 +487,28 @@ class LibvirtConnection(driver.ComputeDriver):
instance['id'], state)
if state == power_state.RUNNING:
LOG.debug(_('instance %s: rebooted'), instance['name'])
+
+ # Fix lp747922
+ instance_id = instance['id']
+ for vol in db.volume_get_all_by_instance(
+ context.get_admin_context(), instance_id):
+ # LOG.debug(_("re-attaching: %s") % vol['ec2_id'])
+ # instance-id : instance-00000001
+ # device_path : /dev/etherd/e0.1, etc
+ # mountpoint : /dev/sdh
+ # dev_path is not stored anywhere, and it has driver
+ # specific format. Therefore, noway other than calling
+ # discover_driver here.
+ dev_path = nova.volume.driver.discover_volume(self,
+ context,
+ vol)
+ LOG.debug(_("instance_id: %s, volume_id: %s, mountpoint: %s") %
+ (instance_id, dev_path, vol['mountpoint']))
+ self.attach_volume(instance['name'],
+ dev_path,
+ vol['mountpoint']);
+ # Fix lp747922
+
timer.stop()
except Exception, exn:
LOG.exception(_('_wait_for_reboot failed: %s'), exn)
@@ -497,24 +519,6 @@ class LibvirtConnection(driver.ComputeDriver):
timer.f = _wait_for_reboot
timer_result=timer.start(interval=0.5, now=True)
-
- # Fix lp747922
- instance_id = instance['id']
- for vol in db.volume_get_all_by_instance(context.get_admin_context(),
- instance_id):
-# LOG.debug(_("re-attaching: %s") % vol['ec2_id'])
-# instance-id : instance-00000001
-# device_path : /dev/etherd/e0.1, /dev/mapper/nova--volumes-volume--00000001
-# mountpoint : sdh
-# BTW, is iSCSI working?
- LOG.debug(_("instance_id: %s, volume_id: %s, mountpoint: %s") %
- (instance_id, vol['id'], vol['mountpoint']))
-# self.attach_volume(instance['name'], vol['id'], vol['mountpoint'])
-
- self.attach_volume(instance['name'],
- '/dev/mapper/nova--volumes-volume--00000001',
- 'vdb')
-
return timer_result
@exception.wrap_exception