You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "sureshanaparti (via GitHub)" <gi...@apache.org> on 2026/01/28 13:46:49 UTC

[PR] Update storage usage / size in backup usage response [cloudstack]

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

   ### Description
   
   This PR updates storage usage / size in backup usage response.
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ******************************************************************************* -->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ******************************************************************************* -->
   
   ### 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)
   - [x] 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
   - [x] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

   @sureshanaparti can you check @abh1sar 's comments and we can merge this


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

   @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] Update storage usage / size in backup usage response [cloudstack]

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


##########
server/src/main/java/com/cloud/api/ApiResponseHelper.java:
##########
@@ -4377,9 +4377,11 @@ public UsageRecordResponse createUsageResponse(Usage usageRecord, Map<String, Se
                             .append(" (").append(backupOffering.getUuid()).append(", user ad-hoc/scheduled backup allowed: ")
                             .append(backupOffering.isUserDrivenBackupAllowed()).append(")");
                 }
-
             }
+            builder.append(" with size ").append(toHumanReadableSize(usageRecord.getVirtualSize()));

Review Comment:
   Can we put both 
   builder.append(" with size ").append(toHumanReadableSize(usageRecord.getSize()));
   builder.append(" and with Virtual size ").append(toHumanReadableSize(usageRecord.getVirtualSize()));



-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

   @abh1sar , tested with the last changes. The `size` and `virtualsize` fields are now correctly included in the `listUsageRecords` API response for usage type 28 (Backup), along with an updated description format showing both size values.
   
   
   ### API Response Verification
   
   - Created VM with backup offering assigned
   - Created backup for the VM
   - Waited for usage aggregation to process backup usage events
   
   ```
   (localcloud) 🐱 > listUsageRecords usagetype=28 startdate=2026-01-30 enddate=2026-01-31 account=admin | python3 -c "import sys,json; d=json.load(sys.stdin); print(json.dumps([r for r in d.get('usagerecord',[]) if r.get('usagetype')==28][-1], indent=2))"
   {
     "account": "admin",
     "accountid": "61127bf6-fd41-11f0-98c7-1e00370002e0",
     "description": "Backup usage for VM backup-test-vm (8367f058-03de-4d85-9250-2d4ac1ca5f66) and backup offering test (bcc29bb8-b727-4fc1-abbe-e3a3d7899d69, user ad-hoc/scheduled backup allowed: true) with size (1000 bytes) 1000 and with virtual size (100 bytes) 100",
     "domain": "ROOT",
     "domainid": "1db1a70d-fd41-11f0-98c7-1e00370002e0",
     "domainpath": "/",
     "enddate": "2026-01-30T12:16:59+0000",
     "name": "i-2-3-VM",
     "rawusage": "0.25",
     "size": 1000,
     "startdate": "2026-01-30T12:02:00+0000",
     "tags": [],
     "usage": "0.25 Hrs",
     "usageid": "8367f058-03de-4d85-9250-2d4ac1ca5f66",
     "usagetype": 28,
     "virtualmachineid": "8367f058-03de-4d85-9250-2d4ac1ca5f66",
     "virtualsize": 100,
     "zoneid": "bdb1d48b-6c33-4484-882c-a0b61d4887c9"
   }
   ```


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/12539?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 4.02%. Comparing base ([`35e6d7c`](https://app.codecov.io/gh/apache/cloudstack/commit/35e6d7c5ba8f921c7611ab6c0c84d7b3db557456?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`6d7808a`](https://app.codecov.io/gh/apache/cloudstack/commit/6d7808ab7bb8e99770cf912ce65b9af14b022881?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   > :exclamation:  There is a different number of reports uploaded between BASE (35e6d7c) and HEAD (6d7808a). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (35e6d7c) | HEAD (6d7808a) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               4.20   #12539       +/-   ##
   =============================================
   - Coverage     16.26%    4.02%   -12.24%     
   =============================================
     Files          5658      402     -5256     
     Lines        499494    32755   -466739     
     Branches      60625     5840    -54785     
   =============================================
   - Hits          81232     1319    -79913     
   + Misses       409214    31281   -377933     
   + Partials       9048      155     -8893     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/12539/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/12539/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.02% <ø> (ø)` | |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/12539/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/12539?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> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [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] Update storage usage / size in backup usage response [cloudstack]

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

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


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

   @sureshanaparti can you please test, what are the displayed values for size and virtual size. If they are correct?


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

   <b>[SF] Trillian test result (tid-15339)</b>
   Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
   Total time taken: 55977 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12539-t15339-kvm-ol8.zip
   Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_05_vmschedule_test_e2e | `Failure` | 361.92 | test_vm_schedule.py
   


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

   @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] Update storage usage / size in backup usage response [cloudstack]

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

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


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

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


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

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


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

   @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] Update storage usage / size in backup usage response [cloudstack]

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


##########
server/src/main/java/com/cloud/api/ApiResponseHelper.java:
##########
@@ -4377,9 +4377,11 @@ public UsageRecordResponse createUsageResponse(Usage usageRecord, Map<String, Se
                             .append(" (").append(backupOffering.getUuid()).append(", user ad-hoc/scheduled backup allowed: ")
                             .append(backupOffering.isUserDrivenBackupAllowed()).append(")");
                 }
-
             }
+            builder.append(" with size ").append(toHumanReadableSize(usageRecord.getVirtualSize()));

Review Comment:
   updated @abh1sar 



-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

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


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

   > @sureshanaparti can you check @abh1sar 's comments and we can merge this
   
   done @borisstoyanov 


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

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


Re: [PR] Update storage usage / size in backup usage response [cloudstack]

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


##########
server/src/main/java/com/cloud/api/ApiResponseHelper.java:
##########
@@ -4377,9 +4377,11 @@ public UsageRecordResponse createUsageResponse(Usage usageRecord, Map<String, Se
                             .append(" (").append(backupOffering.getUuid()).append(", user ad-hoc/scheduled backup allowed: ")
                             .append(backupOffering.isUserDrivenBackupAllowed()).append(")");
                 }
-
             }
+            builder.append(" with size ").append(toHumanReadableSize(usageRecord.getVirtualSize()));

Review Comment:
   Can we put both 
   builder.append(" with size ").append(toHumanReadableSize(usageRecord.getSize()));
   builder.append(" and with virtual size ").append(toHumanReadableSize(usageRecord.getVirtualSize()));



-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

   @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] Update storage usage / size in backup usage response [cloudstack]

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

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


-- 
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] Update storage usage / size in backup usage response [cloudstack]

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

   @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