-
Notifications
You must be signed in to change notification settings - Fork 1.2k
added online/offline copy method for Primera storage adapter #11298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
@blueorangutan package |
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11298 +/- ##
============================================
- Coverage 16.76% 16.76% -0.01%
+ Complexity 14285 14283 -2
============================================
Files 5767 5767
Lines 512657 512685 +28
Branches 62359 62363 +4
============================================
- Hits 85950 85942 -8
- Misses 417108 417145 +37
+ Partials 9599 9598 -1
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the Primera storage adapter to implement intelligent volume copy method selection based on size requirements. The adapter now automatically chooses between online copy (fast clone) for same-size volumes and offline copy for resize operations.
- Added automatic copy method detection that compares source and target volume sizes
- Implemented online copy for same-size volumes using immediate cloning with deduplication
- Implemented offline copy for volume resize operations with background task monitoring
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
PrimeraAdapter.java | Enhanced copy method with size-based online/offline copy selection and detailed logging |
FlashArrayAdapter.java | Updated method signature to include newSize parameter (not yet implemented) |
AdaptiveDataStoreDriverImpl.java | Modified to pass destination size to adapter copy method |
ProviderAdapter.java | Updated interface to include newSize parameter in copy method signature |
targetVolumeInfo.getName(), sourceVolume.getAllocatedSizeInBytes()); | ||
this.create(context, targetVolumeInfo, null, sourceVolume.getAllocatedSizeInBytes()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For offline copy mode, the target volume is being created with the source volume size instead of the newSize parameter. This contradicts the logic that offline copy is used when sizes differ, and the target should be created with the desired newSize.
targetVolumeInfo.getName(), sourceVolume.getAllocatedSizeInBytes()); | |
this.create(context, targetVolumeInfo, null, sourceVolume.getAllocatedSizeInBytes()); | |
targetVolumeInfo.getName(), newSize); | |
this.create(context, targetVolumeInfo, null, newSize); |
Copilot uses AI. Check for mistakes.
if (!onlineCopy) { | ||
// Offline copy requires waiting for task completion | ||
logger.debug("PrimeraAdapter: Offline copy initiated - waiting for task completion (TaskID: {})", taskref.getTaskid()); | ||
waitForTaskToComplete(taskref.getTaskid(), "copy volume " + sourceVolumeInfo.getExternalName() + " to " + | ||
targetVolumeInfo.getExternalName(), taskWaitTimeoutMs); | ||
logger.debug("PrimeraAdapter: Offline copy operation completed successfully"); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The waitForTaskToComplete call is only executed for offline copy, but it should be within the offline copy conditional block for better code organization and readability.
if (!onlineCopy) { | |
// Offline copy requires waiting for task completion | |
logger.debug("PrimeraAdapter: Offline copy initiated - waiting for task completion (TaskID: {})", taskref.getTaskid()); | |
waitForTaskToComplete(taskref.getTaskid(), "copy volume " + sourceVolumeInfo.getExternalName() + " to " + | |
targetVolumeInfo.getExternalName(), taskWaitTimeoutMs); | |
logger.debug("PrimeraAdapter: Offline copy operation completed successfully"); | |
} else { | |
if (onlineCopy) { |
Copilot uses AI. Check for mistakes.
@@ -367,7 +367,8 @@ public ProviderSnapshot getSnapshot(ProviderAdapterContext context, ProviderAdap | |||
|
|||
@Override | |||
public ProviderVolume copy(ProviderAdapterContext context, ProviderAdapterDataObject sourceDataObject, | |||
ProviderAdapterDataObject destDataObject) { | |||
ProviderAdapterDataObject destDataObject, Long newSize) { | |||
// Add new parameter as newSize to match method declaration but not used anywhere |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment indicates the newSize parameter is not implemented yet. Consider adding a TODO comment or proper documentation about the planned implementation to make the intention clearer for future development.
// Add new parameter as newSize to match method declaration but not used anywhere | |
// TODO: The newSize parameter is currently unused. It may be implemented in the future | |
// to allow resizing the destination volume during the copy operation. |
Copilot uses AI. Check for mistakes.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14386 |
@blueorangutan test |
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Description
Enhanced the Primera storage adapter's volume copy functionality to implement copy method selection based on volume size requirements. The adapter now automatically determines whether to use online copy (fast clone) or offline copy to optimize performance and resource utilization.
Key Changes:
• Added automatic copy method detection based on source and target volume size comparison
• Implemented online copy for same-size volumes (immediate cloning with deduplication)
• Implemented offline copy for volume resize operations (background task with high priority)
• Enhanced logging with detailed copy method selection rationale and operation progress
• Added proper task monitoring and completion handling for offline copy operations
• Optimized copy parameters (provisioning type settings)
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
N/A - Backend storage adapter enhancement
How Has This Been Tested?
Copy Operation Test Scenarios:
Same-Size Volume Copy (Online Copy Path):
• Verified fast cloning with immediate completion
• Confirmed deduplication and compression enabled
Different-Size Volume Copy (Offline Copy Path):
• Tested volume resize during copy operations
• Verified background task creation with high priority
• Confirmed proper target volume pre-creation with correct size
• Validated task completion monitoring and timeout handling
Copy Method Selection Logic:
• Tested size comparison logic (newSize vs sourceSize)
• Verified online copy selection when sizes match exactly
• Confirmed offline copy selection when sizes differ
Copy Configuration Validation:
• Verified online copy parameters
• Verified offline copy parameters, background execution
• Tested proper request parameter assignment
Error Handling and Logging
• Verified detailed logging for copy method selection decisions
How did you try to break this feature and the system with this change?
Copy Operation Stress Testing
• Initiated multiple concurrent copy operations to test Primera API limits
• Tested copy operations with very large volumes (>100GB)
Edge Cases and Boundary Conditions:
• Tested with minimum volume sizes
Integration Testing:
• Tested copy operations within CloudStack volume lifecycle (templates)
The enhancement maintains full backward compatibility while providing significant performance improvements for volume copy operations through method selection.