Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
| Boolean overwriteVolumeContentStatus = post( | ||
| "/instances/Volume::" + destVolumeId + "/action/overwriteVolumeContent", | ||
| String.format("{\"srcVolumeId\":\"%s\",\"allowOnExtManagedVol\":\"TRUE\"}", sourceSnapshotVolumeId), Boolean.class); | ||
| String.format("{\"srcVolumeId\":\"%s\"}",sourceSnapshotVolumeId),Boolean.class); |
There was a problem hiding this comment.
this will break the func with 3.x (and < 4.5) version
| String pathWithScaleIOVolumeName = ScaleIOUtil.updatedPathWithVolumeName(volumeIds.get(index), volumeSnapshotName); | ||
| vmSnapshotDetails.add(new VMSnapshotDetailsVO(vmSnapshot.getId(), "Vol_" + volumeTOs.get(index).getId() + "_Snapshot", pathWithScaleIOVolumeName, false)); | ||
| } | ||
| */ |
There was a problem hiding this comment.
remove the comment is not needed
| vmSnapshotDetails.add(new VMSnapshotDetailsVO(vmSnapshot.getId(), "Vol_" + volumeTOs.get(index).getId() + "_Snapshot", pathWithScaleIOVolumeName, false)); | ||
| } | ||
| */ | ||
| // Invert the srcVolumeDestSnapshotMap: snapshotName -> srcVolumePath |
There was a problem hiding this comment.
| // Invert the srcVolumeDestSnapshotMap: snapshotName -> srcVolumePath |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12880 +/- ##
============================================
- Coverage 18.02% 18.02% -0.01%
- Complexity 16450 16451 +1
============================================
Files 5968 5968
Lines 537086 537102 +16
Branches 65961 65964 +3
============================================
+ Hits 96819 96820 +1
- Misses 429347 429362 +15
Partials 10920 10920
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
This PR fixes two bugs in the PowerFlex storage integration.
Fix 1: Snapshot volume ID ordering mismatch for VMs with multiple volumes
When taking a group snapshot of a VM with multiple volumes, CloudStack calls snapshotGroup.getVolumeIds() from the PowerFlex API to retrieve the resulting snapshot volume IDs and maps them positionally against a locally-built list of volumeTO objects. The PowerFlex API provides no guarantee that the returned snapshot volume IDs are in the same order as the source volumes were submitted. When PowerFlex returns the IDs in a different order, the snapshot volumes are recorded with incorrect associations in the CloudStack database, which can cause data integrity issues on restore.
The fix resolves this by matching each returned snapshot volume ID back to its corresponding source volume ID rather than relying on positional ordering.
Fix 2: Remove deprecated allowOnExtManagedVol parameter from overwriteVolumeContent
The PowerFlex API method overwriteVolumeContent, used during snapshot revert, accepted an allowOnExtManagedVol parameter in API version 3.5 that was removed in version 4.x. Passing this parameter against a PowerFlex 4.x deployment causes the API call to fail, breaking snapshot revert functionality entirely.
The fix removes the allowOnExtManagedVol parameter from the overwriteVolumeContent call to align with the PowerFlex 4.x API.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Triggered a group snapshot on a VM with multiple volumes against a PowerFlex environment where the API returns snapshot volume IDs in a different order than the source volumes were submitted, and verified that all snapshot-to-volume associations are recorded correctly in the database.
Verified that snapshot revert (overwriteVolumeContent) completes successfully against a PowerFlex 4.6 deployment.
Verified no regression in snapshot and revert behaviour on standard single-volume VM snapshots.
How did you try to break this feature and the system with this change?
Tested group snapshots with varying numbers of volumes to confirm ordering is resolved correctly in all cases, not just a two-volume scenario.
Confirmed that removing allowOnExtManagedVol does not cause issues on the revert path beyond the version compatibility fix it addresses.