Skip to content

Introduce volume allocation algorithm global configuration #10696

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

sudo87
Copy link
Collaborator

@sudo87 sudo87 commented Apr 11, 2025

Description

This PR introduces separate global configuration for Volume allocation algorithm.

Volume allocation has been using vm.allocation.algorithm config value. It can be confusing and limitting user to use same allocation algorithm for both VM and Volume.
This new configuration will allow vm and volume allocators to use different algoritms independently without being tied together.

Doc PR apache/cloudstack-documentation#499

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)
  • 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?

Local dev testing is done by deployment of instances against simulator after setting different values for "volume.allocation.algorithm".

How did you try to break this feature and the system with this change?

Volume allocation has been using vm.allocation.algorithm config value. This change will allow them to be configured in isolation.
Copy link

codecov bot commented Apr 11, 2025

Codecov Report

Attention: Patch coverage is 58.49057% with 22 lines in your changes missing coverage. Please review.

Project coverage is 16.52%. Comparing base (ffc0d51) to head (9721484).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...gent/manager/allocator/impl/FirstFitAllocator.java 15.38% 10 Missing and 1 partial ⚠️
...torage/allocator/AbstractStoragePoolAllocator.java 73.33% 2 Missing and 2 partials ⚠️
...n/java/com/cloud/capacity/dao/CapacityDaoImpl.java 57.14% 3 Missing ⚠️
...stack/engine/orchestration/VolumeOrchestrator.java 77.77% 0 Missing and 2 partials ⚠️
...torage/allocator/ZoneWideStoragePoolAllocator.java 75.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10696      +/-   ##
============================================
+ Coverage     16.31%   16.52%   +0.20%     
- Complexity    13464    13626     +162     
============================================
  Files          5676     5673       -3     
  Lines        499412   500101     +689     
  Branches      60395    60504     +109     
============================================
+ Hits          81503    82626    +1123     
+ Misses       408829   408263     -566     
- Partials       9080     9212     +132     
Flag Coverage Δ
uitests 4.00% <ø> (+0.01%) ⬆️
unittests 17.39% <58.49%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rajujith rajujith self-requested a review April 11, 2025 05:32
@rajujith
Copy link

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@Pearl1594 Pearl1594 added this to the 4.21.0 milestone Apr 11, 2025
@sudo87
Copy link
Collaborator Author

sudo87 commented Apr 14, 2025

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@sudo87
Copy link
Collaborator Author

sudo87 commented Apr 15, 2025

@blueorangutan test

@blueorangutan
Copy link

@sudo87 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@weizhouapache
Copy link
Member

code lgtm

However, I think we need to think of the upgrade
for example, now the vm/volume allocation algorithm is set to firstfit, when uprgade to a new version with this PR, the vm allocation algorithm is still firstfit, but volume allocation algorithm will be the default value random.

@sudo87

@blueorangutan
Copy link

[SF] Trillian test result (tid-12988)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 54138 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10696-t12988-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@sudo87
Copy link
Collaborator Author

sudo87 commented Apr 16, 2025

code lgtm

However, I think we need to think of the upgrade for example, now the vm/volume allocation algorithm is set to firstfit, when uprgade to a new version with this PR, the vm allocation algorithm is still firstfit, but volume allocation algorithm will be the default value random.

@sudo87

Thank you @weizhouapache, I have handled it in latest commit.

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@weizhouapache
Copy link
Member

"random" can be replaced by VolumeAllocationAlgorithm.getDefaultValue()

@sudo87
Copy link
Collaborator Author

sudo87 commented Apr 17, 2025

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@sudo87
Copy link
Collaborator Author

sudo87 commented Apr 17, 2025

@blueorangutan test

@blueorangutan
Copy link

@sudo87 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

@blueorangutan
Copy link

[SF] Trillian test result (tid-13028)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 56146 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10696-t13028-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_11_destroy_ssvm Error 3.23 test_ssvm.py

Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@sudo87
Copy link
Collaborator Author

sudo87 commented Apr 23, 2025

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Copy link

@rajujith rajujith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Tested with multiple shared NFS primary storage. If the logging for the firstfitleastconsumed can print the available capacity as well in the logs it will be useful.

'List of pools in descending order of available capacity [[1, 2]].'

@sudo87
Copy link
Collaborator Author

sudo87 commented Apr 25, 2025

LGTM. Tested with multiple shared NFS primary storage. If the logging for the firstfitleastconsumed can print the available capacity as well in the logs it will be useful.

'List of pools in descending order of available capacity [[1, 2]].'

Thanks @rajujith for suggestion! Change is made to enhance log to show available capacity for host/pool.

Screenshot from 2025-04-25 15-50-40

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants