sureshanaparti commented on code in PR #12880:
URL: https://github.com/apache/cloudstack/pull/12880#discussion_r2987316681
##########
plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/client/ScaleIOGatewayClientImpl.java:
##########
@@ -621,15 +624,27 @@ public boolean revertSnapshot(final String
sourceSnapshotVolumeId, final String
throw new CloudRuntimeException("Unable to revert, source snapshot
volume and destination volume doesn't belong to same volume tree");
}
+ String requestBody =
buildOverwriteVolumeContentRequest(sourceSnapshotVolumeId);
+
Boolean overwriteVolumeContentStatus = post(
"/instances/Volume::" + destVolumeId +
"/action/overwriteVolumeContent",
-
String.format("{\"srcVolumeId\":\"%s\",\"allowOnExtManagedVol\":\"TRUE\"}",
sourceSnapshotVolumeId), Boolean.class);
+ requestBody,Boolean.class);
if (overwriteVolumeContentStatus != null) {
return overwriteVolumeContentStatus;
}
return false;
}
+ private String buildOverwriteVolumeContentRequest(final String
srcVolumeId) {
+ if (isVersionAtLeast(4, 0)) {
+ logger.debug("Using PowerFlex 4.0+ overwriteVolumeContent request
body");
+ return String.format("{\"srcVolumeId\":\"%s\"}", srcVolumeId);
+ }
+ else {
+ logger.debug("Using pre-4.0 overwriteVolumeContent request body");
+ return
String.format("{\"srcVolumeId\":\"%s\",\"allowOnExtManagedVol\":\"TRUE\"}",
srcVolumeId); }
Review Comment:
@owsferraro is `volumeClass` not required for 4.x call?
--
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]