You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "winterhazel (via GitHub)" <gi...@apache.org> on 2025/03/11 16:35:51 UTC

[PR] Fix secondary storage selectors feature [cloudstack]

winterhazel opened a new pull request, #10546:
URL: https://github.com/apache/cloudstack/pull/10546

   ### Description
   
   The secondary storage selectors feature is not working in the 4.20 and main branches.
   
   PR #9873 changed the return of `org.apache.cloudstack.storage.heuristics.presetvariables.GenericHeuristicPresetVariable#toString`; however, as this method is used to build the secondary storage selection script, the changes made it stop working.
   
   Here's how the script looked like before #9873:
   
   ```js
   secondaryStorages = [{"id":"f7e21c42-f621-4412-8994-36e077f0faec","protocol":"nfs","totalDiskSize":104028176384,"usedDiskSize":47059042304,"name":"sec"}, {"id":"0d88afc2-93eb-4070-8fbf-d8909f62364d","protocol":"nfs","totalDiskSize":104028176384,"usedDiskSize":47059042304,"name":"sec-2"}]; snapshot = {"hypervisorType":"KVM","size":52428800,"name":"e"}; account = {"domain":{"id":"40815ad7-28b2-11ef-a04e-6ac09c2b3d6b","name":"ROOT"},"id":"60b92e66-28b2-11ef-a04e-6ac09c2b3d6b","name":"admin"}; '0d88afc2-93eb-4070-8fbf-d8909f62364d';
   ```
   
   And how it looks like now:
   
   ```js
   secondaryStorages = [GenericHeuristicPresetVariable {"id":"865197af-0bcc-4041-b031-8e6590cf41c4","protocol":"nfs","totalDiskSize":51460964352,"usedDiskSize":37255905280,"name":"sec-a-zn-1"}, GenericHeuristicPresetVariable {"id":"16babc8c-a6e8-4bb3-b581-c37afad4b442","protocol":"nfs","totalDiskSize":51460964352,"usedDiskSize":37255905280,"name":"sec-b-zn-1"}]; snapshot = GenericHeuristicPresetVariable {"hypervisorType":"KVM","size":52428800,"name":"a"}; account = GenericHeuristicPresetVariable {"domain":"GenericHeuristicPresetVariable {\"id\":\"40815ad7-28b2-11ef-a04e-6ac09c2b3d6b\",\"name\":\"ROOT\"}","id":"60b92e66-28b2-11ef-a04e-6ac09c2b3d6b","name":"admin"}; '16babc8c-a6e8-4bb3-b581-c37afad4b442';
   ```
   
   This PR reverts the method to its previous state.
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] 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
   
   #### Bug Severity
   
   - [X] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### How Has This Been Tested?
   
   1. I created a heuristic rule to direct snapshots to a specific secondary storage
   
   ```
   (admin) 🐒 > create secondarystorageselector description=a name=a zoneid=065b0fd8-f562-480a-b278-ea3d9306a326  heuristicrule="'0d88afc2-93eb-4070-8fbf-d8909f62364d';" type=SNAPSHOT
   ```
   
   2. I tried to take a snapshot
   
   Before the changes, the snapshot process would fail due to an exception thrown by the JS interpreter. Applying the patch made it work again and correctly directed the snapshot to the secondary storage that I specified.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2717218742

   lgtm, @vishesh92 , can you check if there was a pressing reason the string `GenericHeuristicPresetVariable` was included in `toString()`?


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "winterhazel (via GitHub)" <gi...@apache.org>.
winterhazel commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2715019167

   @blueorangutan package


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on code in PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#discussion_r1991049054


##########
server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariable.java:
##########
@@ -38,8 +38,6 @@ public void setName(String name) {
 
     @Override
     public String toString() {
-        return String.format("GenericHeuristicPresetVariable %s",
-                ReflectionToStringBuilderUtils.reflectOnlySelectedFields(
-                        this, fieldNamesToIncludeInToString.toArray(new String[0])));
+        return ReflectionToStringBuilderUtils.reflectOnlySelectedFields(this, fieldNamesToIncludeInToString.toArray(new String[0]));

Review Comment:
   @winterhazel PR looks good but can you add a comment to avoid similar issues in the future.



-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2745252549

   <b>[SF] Trillian test result (tid-12802)</b>
   Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 61383 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10546-t12802-kvm-ol8.zip
   Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2727118407

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


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "vishesh92 (via GitHub)" <gi...@apache.org>.
vishesh92 commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2717231055

   > lgtm, @vishesh92 , can you check if there was a pressing reason the string `GenericHeuristicPresetVariable` was included in `toString()`?
   
   It was just to improve logging.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland merged PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2727151114

   Packaging result [SF]: βœ”οΈ el8 βœ”οΈ el9 βœ”οΈ debian βœ”οΈ suse15. SL-JID 12795


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "winterhazel (via GitHub)" <gi...@apache.org>.
winterhazel commented on code in PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#discussion_r1991132606


##########
server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariable.java:
##########
@@ -38,8 +38,6 @@ public void setName(String name) {
 
     @Override
     public String toString() {
-        return String.format("GenericHeuristicPresetVariable %s",
-                ReflectionToStringBuilderUtils.reflectOnlySelectedFields(
-                        this, fieldNamesToIncludeInToString.toArray(new String[0])));
+        return ReflectionToStringBuilderUtils.reflectOnlySelectedFields(this, fieldNamesToIncludeInToString.toArray(new String[0]));

Review Comment:
   I'll add some tests 



-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2715036891

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/10546?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 4.00%. Comparing base [(`b8359e8`)](https://app.codecov.io/gh/apache/cloudstack/commit/b8359e8f62e23910e11548740e54aeb99a69ee93?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`7e724be`)](https://app.codecov.io/gh/apache/cloudstack/commit/7e724be0e9c50867b7c7516f741bd0ec3298157d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 5 commits behind head on 4.20.
   
   > :exclamation:  There is a different number of reports uploaded between BASE (b8359e8) and HEAD (7e724be). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (b8359e8) | HEAD (7e724be) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               4.20   #10546       +/-   ##
   =============================================
   - Coverage     16.00%    4.00%   -12.01%     
   =============================================
     Files          5651      397     -5254     
     Lines        495841    32487   -463354     
     Branches      60044     5760    -54284     
   =============================================
   - Hits          79365     1301    -78064     
   + Misses       407613    31037   -376576     
   + Partials       8863      149     -8714     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/10546/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Ξ” | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/10546/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.00% <ΓΈ> (ΓΈ)` | |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/10546/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/10546?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary>πŸš€ New features to boost your workflow: </summary>
   
   - ❄ [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - πŸ“¦ [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2744206504

   @blueorangutan test


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2715200718

   Packaging result [SF]: βœ”οΈ el8 βœ”οΈ el9 βœ”οΈ debian βœ”οΈ suse15. SL-JID 12741


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2715020733

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


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "winterhazel (via GitHub)" <gi...@apache.org>.
winterhazel commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2727117637

   @blueorangutan package


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix secondary storage selectors feature [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10546:
URL: https://github.com/apache/cloudstack/pull/10546#issuecomment-2744210438

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org