Skip to content

Commit

Permalink
core: Fail when getVolumeInfo fails during OVF read
Browse files Browse the repository at this point in the history
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 <bzlotnik@redhat.com>
  • Loading branch information
bennyz committed Nov 27, 2023
1 parent d48b5f1 commit b2150e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ protected void executeQueryCommand() {
// image. If there are multiple volumes, skip the image and move on to the next.
if (volumesList.size() != 1) {
getQueryReturnValue().setSucceeded(false);
log.info("Skipping a disk with snapshots: {}", diskId);

// Add context for why the query did not succeed. Not great, but it is what it is
DiskImage diskImage = new DiskImage();
diskImage.setDiskSnapshot(true);
diskImage.setDescription(String.format("snapshot-%s", diskId));
getQueryReturnValue().setReturnValue(diskImage);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ protected void executeQueryCommand() {
if (unregQueryReturn.getSucceeded()) {
unregisteredDisks.add(unregQueryReturn.getReturnValue());
} else {
log.debug("Could not get populated disk: {}", unregQueryReturn.getExceptionString());
DiskImage returnValue = unregQueryReturn.getReturnValue();
if (returnValue.isDiskSnapshot() &&
String.format("snapshot-%s", unregisteredDiskId).equals(returnValue.getDescription())) {
continue;
}

log.error("Could not get populated disk: {}", unregQueryReturn.getExceptionString());
getQueryReturnValue().setSucceeded(false);
}
}
getQueryReturnValue().setReturnValue(unregisteredDisks);
Expand Down

0 comments on commit b2150e6

Please sign in to comment.