CLOUDSTACK-5857: for some reasons, delete secondary pool failed during copy template from secondary storage to primary storage, but the volume is already copied to primary storage, we didn't clean up the volume on primary storage, then all the following copy the same template to primary storage failed, as we are always using the same uuid when creating a new volume, libvirt complaining that the volume already exists.

Current fix is ignoring "the delete secondary storage error".
This commit is contained in:
edison 2014-01-13 14:55:47 -08:00 committed by Anthony Xu
parent d4c7574f12
commit d1d855fef4
3 changed files with 13 additions and 4 deletions

View File

@ -242,8 +242,12 @@ public class KVMStorageProcessor implements StorageProcessor {
} catch (CloudRuntimeException e) {
return new CopyCmdAnswer(e.toString());
} finally {
if (secondaryPool != null) {
secondaryPool.delete();
try {
if (secondaryPool != null) {
secondaryPool.delete();
}
} catch(Exception e) {
s_logger.debug("Failed to clean up secondary storage", e);
}
}
}

View File

@ -609,7 +609,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
}
s_logger.error("failed in umount retry");
}
throw new CloudRuntimeException(e.toString());
throw new CloudRuntimeException(e.toString(), e);
}
}

View File

@ -249,7 +249,12 @@ public class LibvirtStoragePool implements KVMStoragePool {
@Override
public boolean delete() {
return this._storageAdaptor.deleteStoragePool(this);
try {
return this._storageAdaptor.deleteStoragePool(this);
} catch (Exception e) {
s_logger.debug("Failed to delete storage pool", e);
}
return false;
}
@Override