Skip to content

fix priority for volume copy operation #11109

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shrikantjoshi-hpe
Copy link

Description

This PR adds support to set the priority to high for volume copy operations using the Primera plugin.
This enhancement allows volume copy tasks handled by the Primera plugin to be prioritized as high, improving performance for critical operations. No changes to existing workflows or APIs; only the priority for copy operations is updated.


Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

N/A

How Has This Been Tested?

  • Manually tested the volume copy operation using the Primera plugin.
  • Verified that the copy operation is executed with high priority.

How did you try to break this feature and the system with this change?

  • Tested with multiple concurrent copy operations to ensure prioritization works as expected.
  • Confirmed no impact on unrelated features or plugins.

Copy link

boring-cyborg bot commented Jun 30, 2025

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)
Here are some useful points:

Copy link

codecov bot commented Jul 1, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 16.57%. Comparing base (16c60c7) to head (59d5012).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
...rage/datastore/adapter/primera/PrimeraAdapter.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #11109   +/-   ##
=========================================
  Coverage     16.57%   16.57%           
- Complexity    13968    13969    +1     
=========================================
  Files          5743     5743           
  Lines        510494   510495    +1     
  Branches      62075    62075           
=========================================
+ Hits          84617    84621    +4     
+ Misses       416415   416411    -4     
- Partials       9462     9463    +1     
Flag Coverage Δ
uitests 3.90% <ø> (ø)
unittests 17.47% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@shrikantjoshi-hpe
Copy link
Author

@DaanHoogland Is anything expected from us regarding the status:needs-testing label? I haven’t found any test coverage for the Primera plugin in the repository. Please advise.

@DaanHoogland
Copy link
Contributor

@DaanHoogland Is anything expected from us regarding the status:needs-testing label? I haven’t found any test coverage for the Primera plugin in the repository. Please advise.

@shrikantjoshi-hpe , If there is no external hard- or software required, then we require an “external” reviewer to test it. So preferably not yourself. It will lower the bar if you add as extensive a test description as possible. If there is any proprietary stuff involved we “just” require regression tests performed.

In any case a second review and testing is “external” required.

@shrikantjoshi-hpe
Copy link
Author

shrikantjoshi-hpe commented Jul 3, 2025

@DaanHoogland, Thank you for the details. With this change there is no proprietary information involved. Regarding testing, we performed multiple tests related to these code changes, mainly following the workflow of bringing up instances in CloudStack using templates and monitoring the volume copy task performance using Primera plugin. There is no change in workflow for end users; this update simply improves the performance of volume copy tasks on the array.

@DaanHoogland
Copy link
Contributor

@shrikantjoshi-hpe , great. Try to find a second reviewer. Preferably someone still active that has changed the code that you touched. Couldn’t hurt to look at other storage vendors as well.
cc @slavkap , @rp- , @harikrishna-patnala this looks simple enough so shouldn’t require much thinking ;)

Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@sureshanaparti sureshanaparti requested a review from Copilot July 4, 2025 12:27
Copy link

@Copilot Copilot AI left a 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 plugin’s volume copy operation by always assigning it high priority.

  • Always sets the copy request’s priority to high (1)
  • No changes to workflows or APIs beyond priority level adjustment
Comments suppressed due to low confidence (2)

plugins/storage/volume/primera/src/main/java/org/apache/cloudstack/storage/datastore/adapter/primera/PrimeraAdapter.java:314

  • Add unit or integration tests to verify that the priority parameter is correctly set to high for copy operations so this behavior is validated automatically.
        parms.setPriority(1);

@@ -311,6 +311,7 @@ public ProviderVolume copy(ProviderAdapterContext context, ProviderAdapterDataOb

parms.setDestVolume(targetVolumeInfo.getExternalName());
parms.setOnline(false);
parms.setPriority(1);
Copy link
Preview

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace the magic number 1 with a named constant or enum (e.g., PRIORITY_HIGH) to clarify its meaning and improve maintainability.

Copilot uses AI. Check for mistakes.

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14040

@shrikantjoshi-hpe
Copy link
Author

@DaanHoogland, code change has been reviewed by a second reviewer as well. Can you now consider it for merging?

Copy link
Contributor

@slavkap slavkap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

5 participants