From 8068a1d18249f5b871e2df3b27b2fb7141d1cc57 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Mon, 18 Mar 2013 13:51:50 -0400 Subject: [PATCH] libvirt: Tolerate existing vm(s) with cdrom(s) When there is an existing vm with cdrom (not started by Nova), we should tolerate missing file attribute (just skip those) Fixes LP# 1144756 Change-Id: I43d45872e2d7348801b2e54cd43651609676f372 (cherry picked from commit cb369dab7184e72f24e70554828a7c4ca754d268) --- nova/virt/libvirt/driver.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 9ef21b81337..060f8640368 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -2717,6 +2717,12 @@ def get_instance_disk_info(self, instance_name): locals()) continue + if not path: + LOG.debug(_('skipping disk for %(instance_name)s as it' + ' does not have a path') % + locals()) + continue + # get the real disk size or # raise a localized error if image is unavailable dk_size = int(os.path.getsize(path))