weizhouapache opened a new pull request, #9761: URL: https://github.com/apache/cloudstack/pull/9761
### Description Currently, when resize a volume, ACS checks if the current storage pool can accommodate the new size, and simply return true if pool has enough capacity, or false if there are not enough capacity. This PR - add global and zone setting volume.resize.allowed.beyond.allocation and pool.storage.allocated.resize.capacity.disablethreshold - add API parameter automigrate to resizeVolume API. when resize a volume - check if the pool capacity (with new volume size) is above disable threshold `pool.storage.allocated.capacity.disablethreshold` - if pool capacity is below disable threshold, operation succeeds. - if pool capacity is above disable threshold * if `volume.resize.allowed.beyond.allocation` is `false`, go to migration step * if `volume.resize.allowed.beyond.allocation` is `true`, it will check pool capacity for resize threshold `pool.storage.allocated.resize.capacity.disablethreshold`. * if yes, operation succeeds. * if not, go to migration step - migrate volume to another pool * find storage pools by tags, storage types, pool allocation capacity (consider current volume size), and etc * filter storage pool by resize capacity threshold (consider new volume size) * if no pool found, operation fails. * if automigrate is false, operation fails * if automigrate is true, try to migrate volume to another pool - if migration succeeds (for example vm is stopped), operation succeeds - if migration fails (for example vm is running on KVM), operation succeeds prior to this change  With this change  <!--- 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 - [ ] 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-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org