Skip to content

Commit f797221

Browse files
bennyzahadas
authored andcommitted
core: Fail when getVolumeInfo fails during OVF read
In a scenario where we managed to list the images on the storage, but failed to read get their information from vdsm, we will end up with engine assuming the OVF_STOREs are missing. Instead this patch treats a failure to retrieve the infromation as a failure to force the user to retry. Bug-Url: https://bugzilla.redhat.com/2244641 Signed-off-by: Benny Zlotnik <[email protected]>
1 parent 9fa9d7d commit f797221

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/image/GetUnregisteredDiskQuery.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ protected void executeQueryCommand() {
8383
// image. If there are multiple volumes, skip the image and move on to the next.
8484
if (volumesList.size() != 1) {
8585
getQueryReturnValue().setSucceeded(false);
86+
log.info("Skipping a disk with snapshots: {}", diskId);
87+
88+
// Add context for why the query did not succeed. Not great, but it is what it is
89+
DiskImage diskImage = new DiskImage();
90+
diskImage.setDiskSnapshot(true);
91+
diskImage.setDescription(String.format("snapshot-%s", diskId));
92+
getQueryReturnValue().setReturnValue(diskImage);
8693
return;
8794
}
8895

backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/image/GetUnregisteredDisksQuery.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ protected void executeQueryCommand() {
7878
if (unregQueryReturn.getSucceeded()) {
7979
unregisteredDisks.add(unregQueryReturn.getReturnValue());
8080
} else {
81-
log.debug("Could not get populated disk: {}", unregQueryReturn.getExceptionString());
81+
DiskImage returnValue = unregQueryReturn.getReturnValue();
82+
if (returnValue.isDiskSnapshot() &&
83+
String.format("snapshot-%s", unregisteredDiskId).equals(returnValue.getDescription())) {
84+
continue;
85+
}
86+
87+
log.error("Could not get populated disk: {}", unregQueryReturn.getExceptionString());
88+
getQueryReturnValue().setSucceeded(false);
8289
}
8390
}
8491
getQueryReturnValue().setReturnValue(unregisteredDisks);

0 commit comments

Comments
 (0)