From e5b92d600c4f393bcb7d276b863b0198713f560e Mon Sep 17 00:00:00 2001 From: Michael Still Date: Wed, 5 Dec 2012 14:07:33 +1100 Subject: Catch ProcessExecutionError when building config drives. There's not a lot we can do here, the instance is invalid. However, the better log message will hopefully make this easier for operators to diagnose. Partially addresses bug 872489. Change-Id: Ib650cb114e57956bfe911370dd52aa4fdd4adc78 --- nova/virt/configdrive.py | 6 ++++++ nova/virt/hyperv/vmops.py | 4 ++++ nova/virt/libvirt/driver.py | 6 ++++++ 3 files changed, 16 insertions(+) (limited to 'nova/virt') diff --git a/nova/virt/configdrive.py b/nova/virt/configdrive.py index ad6e0240a..f5f881532 100644 --- a/nova/virt/configdrive.py +++ b/nova/virt/configdrive.py @@ -136,6 +136,12 @@ class ConfigDriveBuilder(object): shutil.rmtree(mountdir) def make_drive(self, path): + """Make the config drive. + + :param path: the path to place the config drive image at + + :raises ProcessExecuteError if a helper process has failed. + """ if CONF.config_drive_format == 'iso9660': self._make_iso9660(path) elif CONF.config_drive_format == 'vfat': diff --git a/nova/virt/hyperv/vmops.py b/nova/virt/hyperv/vmops.py index 480eb394f..fea1034f4 100644 --- a/nova/virt/hyperv/vmops.py +++ b/nova/virt/hyperv/vmops.py @@ -197,6 +197,10 @@ class VMOps(baseops.BaseOps): cdb = configdrive.ConfigDriveBuilder(instance_md=inst_md) try: cdb.make_drive(configdrive_path_iso) + except exception.ProcessExecutionError, e: + LOG.error(_('Creating config drive failed with error: %s'), + e, instance=instance) + raise finally: cdb.cleanup() diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index b2a90e862..ee7551a19 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -1439,7 +1439,13 @@ class LibvirtDriver(driver.ComputeDriver): configdrive_path = basepath(fname='disk.config') LOG.info(_('Creating config drive at %(path)s'), {'path': configdrive_path}, instance=instance) + cdb.make_drive(configdrive_path) + except exception.ProcessExecutionError, e: + LOG.error(_('Creating config drive failed with error: %s'), + e, instance=instance) + raise + finally: cdb.cleanup() -- cgit