Damans227 commented on code in PR #14393:
URL: https://github.com/apache/cloudstack/pull/14393#discussion_r4270796479
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java:
##########
@@ -1761,15 +1822,23 @@ to support snapshots(backuped) as qcow2 files. */
r.ioCtxDestroy(io);
} catch (QemuImgException | LibvirtException e) {
String srcFilename = srcFile != null ? srcFile.getFileName() :
null;
- String destFilename = destFile != null ?
destFile.getFileName() : null;
- logger.error(String.format("Failed to convert from %s to %s
the error was: %s", srcFilename, destFilename, e.getMessage()));
+ logger.error("Failed to convert from {} to RBD image {} the
error was: {}", srcFilename, rbdDestPath, maskRbdKey(e.getMessage()));
newDisk = null;
+ if (destCreatedByCopy) {
+ removeRbdImageQuietly(destPool, name);
Review Comment:
what happens on a timeout? qemu-img gets killed, so ceph still sees it on
the image for about 30s and the remove here likely fails with "image has
watchers"
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java:
##########
@@ -1761,15 +1822,23 @@ to support snapshots(backuped) as qcow2 files. */
r.ioCtxDestroy(io);
} catch (QemuImgException | LibvirtException e) {
String srcFilename = srcFile != null ? srcFile.getFileName() :
null;
- String destFilename = destFile != null ?
destFile.getFileName() : null;
- logger.error(String.format("Failed to convert from %s to %s
the error was: %s", srcFilename, destFilename, e.getMessage()));
+ logger.error("Failed to convert from {} to RBD image {} the
error was: {}", srcFilename, rbdDestPath, maskRbdKey(e.getMessage()));
Review Comment:
should the rbd to rbd copy further down get the same fix? it still logs the
key and leaves the image behind when it fails
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]