-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix volume allocation on local VMFS storage #10201
base: 4.19
Are you sure you want to change the base?
Fix volume allocation on local VMFS storage #10201
Conversation
@blueorangutan package |
@bernardodemarco 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #10201 +/- ##
=========================================
Coverage 15.13% 15.13%
- Complexity 11272 11275 +3
=========================================
Files 5408 5408
Lines 473958 473979 +21
Branches 57811 57814 +3
=========================================
+ Hits 71721 71730 +9
- Misses 394219 394232 +13
+ Partials 8018 8017 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12100 |
...rage/src/main/java/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
Show resolved
Hide resolved
[LL] Trillian Build Failed (tid-7057) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm
not tested yet
[LL]Trillian test result (tid-7064)
|
The integration test errors appear to be related to environment issues. The three test cases returned the following error message: Cannot migrate VM, destination host pr10201-t7064-kvm-rocky8-kvm2 (ID: 2b59b904-b34b-475a-a997-fa5de6ac584f) is not in correct state, has status: Connecting, state: Enabled
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
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, theVMFS
storage type is considered to be shared.cloudstack/api/src/main/java/com/cloud/storage/Storage.java
Lines 138 to 159 in 35fe19f
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 theVMFS
pool type is shared and set the capacity type to be equal toCapacity.CAPACITY_TYPE_STORAGE_ALLOCATED
. Then, when the DAO method is executed, theVMFS
pools will not be present in the returned list of pools, as they require the capacity typeCapacity.CAPACITY_TYPE_LOCAL_STORAGE
to be retrieved.cloudstack/engine/storage/src/main/java/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
Lines 135 to 141 in 35fe19f
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 toHOST
.Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
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 tofirstfitleastconsumed
. Then, when deploying a VM with a local storage compute offering, I checked through the logs that noVMFS
pool was being retrieved. When reproducing the same steps after applying the PR changes, I verified that theVMFS
pools were correctly retrieved.