if libvirt fails to attach disks, call disconnectPhysicalDisk to clean up

This commit is contained in:
Marcus Sorensen 2014-02-20 15:43:27 -07:00
parent e2b13a344a
commit 4fcd0b1a1f

View File

@ -971,6 +971,7 @@ public class KVMStorageProcessor implements StorageProcessor {
return new AttachAnswer(disk);
} catch (LibvirtException e) {
s_logger.debug("Failed to attach volume: " + vol.getPath() + ", due to " + e.toString());
storagePoolMgr.disconnectPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), vol.getPath());
return new AttachAnswer(e.toString());
} catch (InternalErrorException e) {
s_logger.debug("Failed to attach volume: " + vol.getPath() + ", due to " + e.toString());