You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "sathvikaragi (via GitHub)" <gi...@apache.org> on 2026/09/29 06:22:04 UTC
[PR] when nothing is changed in volume resize wizard directl… [cloudstack]
sathvikaragi opened a new pull request, #14259:
URL: https://github.com/apache/cloudstack/pull/14259
Calling resizeVolume with the existing volume size still invoked the storage driver, causing an unnecessary driver resize request for volumes.
### Description
This PR...
<!--- 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)
- [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
#### Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [X] Minor
- [ ] Trivial
### Screenshots (if appropriate):
actually resizes (IN UI)
<img width="1441" height="638" alt="Screenshot 2026-09-24 at 4 36 00 PM" src="https://github.com/user-attachments/assets/8430eaa3-947e-41d4-8573-518f7831d7f0" />
Shows success immediately:
<img width="1471" height="728" alt="Screenshot 2026-09-24 at 4 28 37 PM" src="https://github.com/user-attachments/assets/9cdd57b0-2b1f-4550-9830-46f87c439061" />
### 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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#issuecomment-6287169088
@sathvikaragi , would you be able to generate some unit test code for your changes?
--
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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "nvazquez (via GitHub)" <gi...@apache.org>.
nvazquez commented on PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#issuecomment-6500588182
@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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#issuecomment-6287160753
@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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "sathvikaragi (via GitHub)" <gi...@apache.org>.
sathvikaragi commented on code in PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#discussion_r4257705852
##########
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java:
##########
@@ -1446,11 +1446,12 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep
if (currentSize != newSize || !compareEqualsIncludingNullOrZero(newMaxIops, volume.getMaxIops()) || !compareEqualsIncludingNullOrZero(newMinIops, volume.getMinIops())) {
volumeResizeRequired = true;
}
- if (!volumeMigrateRequired && !volumeResizeRequired && newDiskOffering != null) {
- _volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId());
+ if (!volumeMigrateRequired && !volumeResizeRequired) {
volume = _volsDao.findById(volume.getId());
- updateStorageWithTheNewDiskOffering(volume, newDiskOffering);
-
+ if (newDiskOffering != null) {
Review Comment:
I agree, I have added that check to compare newdiskofferingID and volume's diskoffering ID. Now when same ID is given driver call is skipped and volume is returned.
--
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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "sathvikaragi (via GitHub)" <gi...@apache.org>.
sathvikaragi commented on code in PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#discussion_r4257732594
##########
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java:
##########
@@ -1446,11 +1446,12 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep
if (currentSize != newSize || !compareEqualsIncludingNullOrZero(newMaxIops, volume.getMaxIops()) || !compareEqualsIncludingNullOrZero(newMinIops, volume.getMinIops())) {
volumeResizeRequired = true;
}
- if (!volumeMigrateRequired && !volumeResizeRequired && newDiskOffering != null) {
- _volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId());
+ if (!volumeMigrateRequired && !volumeResizeRequired) {
volume = _volsDao.findById(volume.getId());
Review Comment:
volume is now fetched here only after the DB update to pass on to updateStorageWithTheNewDiskOffering(volume, newDiskOffering);
--
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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#issuecomment-6497801633
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19833
--
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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#issuecomment-5947884858
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/14259?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 3.71%. Comparing base ([`510d0ec`](https://app.codecov.io/gh/apache/cloudstack/commit/510d0ec3785efe3cce65ccd1247682b91f4492d0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`762a4c9`](https://app.codecov.io/gh/apache/cloudstack/commit/762a4c97c9d3cfeaeb2cef1f0853204fd1bc02b6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on main.
> :exclamation: There is a different number of reports uploaded between BASE (510d0ec) and HEAD (762a4c9). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (510d0ec) | HEAD (762a4c9) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #14259 +/- ##
=============================================
- Coverage 19.91% 3.71% -16.21%
=============================================
Files 6373 487 -5886
Lines 577230 41992 -535238
Branches 70696 7942 -62754
=============================================
- Hits 114942 1558 -113384
+ Misses 449722 40208 -409514
+ Partials 12566 226 -12340
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/14259/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/14259/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.71% <ø> (ø)` | |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/14259/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 Harness](https://app.codecov.io/gh/apache/cloudstack/pull/14259?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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "nvazquez (via GitHub)" <gi...@apache.org>.
nvazquez commented on PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#issuecomment-6495208493
@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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "sathvikaragi (via GitHub)" <gi...@apache.org>.
sathvikaragi commented on code in PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#discussion_r4257721448
##########
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java:
##########
@@ -1446,11 +1446,12 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep
if (currentSize != newSize || !compareEqualsIncludingNullOrZero(newMaxIops, volume.getMaxIops()) || !compareEqualsIncludingNullOrZero(newMinIops, volume.getMinIops())) {
volumeResizeRequired = true;
}
- if (!volumeMigrateRequired && !volumeResizeRequired && newDiskOffering != null) {
- _volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId());
+ if (!volumeMigrateRequired && !volumeResizeRequired) {
volume = _volsDao.findById(volume.getId());
- updateStorageWithTheNewDiskOffering(volume, newDiskOffering);
-
+ if (newDiskOffering != null) {
+ _volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId());
+ updateStorageWithTheNewDiskOffering(volume, newDiskOffering);
+ }
return volume;
}
Review Comment:
Volume is now reloaded after _volsDao.updateDiskOffering, hence this issue won't be faced.
--
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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#issuecomment-6521386096
<b>[SF] Trillian test result (tid-17325)</b>
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 67965 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr14259-t17325-kvm-ol8.zip
Smoke tests completed. 156 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
test_isolate_network_password_server | `Failure` | 14.17 | test_password_server.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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "sathvikaragi (via GitHub)" <gi...@apache.org>.
sathvikaragi commented on PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#issuecomment-5926160332
@weizhouapache @DaanHoogland @nvazquez
--
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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#issuecomment-6500618845
@nvazquez 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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "Damans227 (via GitHub)" <gi...@apache.org>.
Damans227 commented on code in PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#discussion_r4231811331
##########
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java:
##########
@@ -1446,11 +1446,12 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep
if (currentSize != newSize || !compareEqualsIncludingNullOrZero(newMaxIops, volume.getMaxIops()) || !compareEqualsIncludingNullOrZero(newMinIops, volume.getMinIops())) {
volumeResizeRequired = true;
}
- if (!volumeMigrateRequired && !volumeResizeRequired && newDiskOffering != null) {
- _volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId());
+ if (!volumeMigrateRequired && !volumeResizeRequired) {
volume = _volsDao.findById(volume.getId());
- updateStorageWithTheNewDiskOffering(volume, newDiskOffering);
-
+ if (newDiskOffering != null) {
Review Comment:
should we also skip this when the new offering is the same as the current one? nothing changes then but the storage driver still gets called here
--
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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#discussion_r4218231740
##########
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java:
##########
@@ -1446,11 +1446,12 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep
if (currentSize != newSize || !compareEqualsIncludingNullOrZero(newMaxIops, volume.getMaxIops()) || !compareEqualsIncludingNullOrZero(newMinIops, volume.getMinIops())) {
volumeResizeRequired = true;
}
- if (!volumeMigrateRequired && !volumeResizeRequired && newDiskOffering != null) {
- _volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId());
+ if (!volumeMigrateRequired && !volumeResizeRequired) {
volume = _volsDao.findById(volume.getId());
- updateStorageWithTheNewDiskOffering(volume, newDiskOffering);
-
+ if (newDiskOffering != null) {
+ _volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId());
+ updateStorageWithTheNewDiskOffering(volume, newDiskOffering);
+ }
return volume;
}
Review Comment:
`volume` is reloaded *before* updating the disk offering, so the returned `volume` (and the `volume` passed into `updateStorageWithTheNewDiskOffering`) can be stale when `newDiskOffering != null`. This differs from the previous behavior (reload after update) and can cause inconsistent state or incorrect downstream logic if `updateStorageWithTheNewDiskOffering` expects `volume` to already reflect the new offering. Consider reloading after `_volsDao.updateDiskOffering(...)` (or moving the reload into the `newDiskOffering != null` block and after the update) so both the returned object and any downstream call sees the updated state.
##########
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java:
##########
@@ -1446,11 +1446,12 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep
if (currentSize != newSize || !compareEqualsIncludingNullOrZero(newMaxIops, volume.getMaxIops()) || !compareEqualsIncludingNullOrZero(newMinIops, volume.getMinIops())) {
volumeResizeRequired = true;
}
- if (!volumeMigrateRequired && !volumeResizeRequired && newDiskOffering != null) {
- _volsDao.updateDiskOffering(volume.getId(), newDiskOffering.getId());
+ if (!volumeMigrateRequired && !volumeResizeRequired) {
volume = _volsDao.findById(volume.getId());
Review Comment:
This forces an extra DB fetch even when `newDiskOffering == null` and you’re returning early because nothing changed. If the intent is only to refresh state when an update occurred, consider fetching only in the disk-offering update path (or returning the existing `volume` when no changes were applied) to avoid unnecessary DAO calls on no-op submissions.
--
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] Driver is called when nothing is changed in volume resize wizard [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #14259:
URL: https://github.com/apache/cloudstack/pull/14259#issuecomment-6495250901
@nvazquez a [SL] Jenkins job has been kicked to build packages. It will be bundled with no 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