bernardodemarco opened a new pull request, #10201: URL: https://github.com/apache/cloudstack/pull/10201
### Description On the allocation process of VM volumes, the reordering of storage pools by capacity is wrongly identifying whether a pool is shared or not. A pool is considered to be shared when its type (represented by the `Storage.StoragePoolType` enum) is shared; however, as can be observed from the enum options, the `VMFS` storage type is considered to be shared. https://github.com/apache/cloudstack/blob/35fe19f096dd38987bd1f892c78e9cce42c05c49/api/src/main/java/com/cloud/storage/Storage.java#L138-L159 As a consequence of that, when trying to deploy VMs in `VMFS` local storages, the allocation of the volumes will fail. Based on the current reordering flow, CloudStack will check that the `VMFS` pool type is shared and set the capacity type to be equal to `Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED`. Then, when the DAO method is executed, the `VMFS` pools will not be present in the returned list of pools, as they require the capacity type `Capacity.CAPACITY_TYPE_LOCAL_STORAGE` to be retrieved. https://github.com/apache/cloudstack/blob/35fe19f096dd38987bd1f892c78e9cce42c05c49/engine/storage/src/main/java/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java#L135-L141 Therefore, this PR proposes to fix this issue by changing the validation of whether a given storage pool is shared. For this check, the `com.cloud.storage.StoragePool#isShared` method is now invoked, which considers a storage pool to be local if it has a scope equal to `HOST`. ### 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 - [ ] BLOCKER - [ ] Critical - [ ] Major - [X] Minor - [ ] Trivial ### Screenshots (if appropriate): ### How Has This Been Tested? To validate the allocation process of VM volumes before the PR changes, I first changed the `vm.allocation.algorithm` value to `firstfitleastconsumed`. Then, when deploying a VM with a local storage compute offering, I checked through the logs that no `VMFS` pool was being retrieved. When reproducing the same steps after applying the PR changes, I verified that the `VMFS` pools were correctly retrieved. -- 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