Skip to content

Conversation

@sudo87
Copy link
Collaborator

@sudo87 sudo87 commented Sep 29, 2025

Description

This PR fixes #11606

With this change, allocation algorithm will take Instance in starting state as well for allocation.

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?

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

@sudo87 sudo87 changed the base branch from main to 4.20 September 29, 2025 10:54
@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.17%. Comparing base (5dfeb79) to head (5a27bd6).
⚠️ Report is 4 commits behind head on 4.20.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #11751      +/-   ##
============================================
- Coverage     16.17%   16.17%   -0.01%     
  Complexity    13296    13296              
============================================
  Files          5656     5656              
  Lines        498223   498240      +17     
  Branches      60454    60457       +3     
============================================
  Hits          80577    80577              
- Misses       408676   408693      +17     
  Partials       8970     8970              
Flag Coverage Δ
uitests 4.00% <ø> (-0.01%) ⬇️
unittests 17.02% <ø> (-0.01%) ⬇️

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.

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

@sudo87
Copy link
Collaborator Author

sudo87 commented Sep 29, 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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15222

@sudo87
Copy link
Collaborator Author

sudo87 commented Sep 29, 2025

@blueorangutan test

@blueorangutan
Copy link

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

@harikrishna-patnala harikrishna-patnala added this to the 4.20.2 milestone Sep 30, 2025
Copy link
Contributor

@shwstppr shwstppr 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-14477)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 59326 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11751-t14477-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 Sep 30, 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.

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

@blueorangutan
Copy link

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

@weizhouapache
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File
all_test_routers Skipped --- test_routers.py
all_test_safe_shutdown Skipped --- test_safe_shutdown.py
all_test_scale_vm Skipped --- test_scale_vm.py
all_test_secondary_storage Skipped --- test_secondary_storage.py
all_test_service_offerings Skipped --- test_service_offerings.py
all_test_set_sourcenat Skipped --- test_set_sourcenat.py
all_test_sharedfs_lifecycle Skipped --- test_sharedfs_lifecycle.py
all_test_snapshots Skipped --- test_snapshots.py
all_test_ssvm Skipped --- test_ssvm.py
all_test_staticroles Skipped --- test_staticroles.py
all_test_storage_policy Skipped --- test_storage_policy.py
all_test_templates Skipped --- test_templates.py
all_test_update_security_group Skipped --- test_update_security_group.py
all_test_usage_events Skipped --- test_usage_events.py
all_test_usage Skipped --- test_usage.py
all_test_vm_autoscaling Skipped --- test_vm_autoscaling.py
all_test_vm_deployment_planner Skipped --- test_vm_deployment_planner.py
all_test_vm_life_cycle Skipped --- test_vm_life_cycle.py
all_test_vm_lifecycle_unmanage_import Skipped --- test_vm_lifecycle_unmanage_import.py
all_test_vm_schedule Skipped --- test_vm_schedule.py
all_test_vm_snapshot_kvm Skipped --- test_vm_snapshot_kvm.py
all_test_vm_snapshots Skipped --- test_vm_snapshots.py
all_test_vm_strict_host_tags Skipped --- test_vm_strict_host_tags.py
all_test_vnf_templates Skipped --- test_vnf_templates.py
all_test_volumes Skipped --- test_volumes.py
all_test_vpc_ipv6 Skipped --- test_vpc_ipv6.py
all_test_vpc_redundant Skipped --- test_vpc_redundant.py
all_test_vpc_router_nics Skipped --- test_vpc_router_nics.py
all_test_vpc_vpn Skipped --- test_vpc_vpn.py
all_test_webhook_delivery Skipped --- test_webhook_delivery.py
all_test_webhook_lifecycle Skipped --- test_webhook_lifecycle.py
all_test_host_maintenance Skipped --- test_host_maintenance.py
all_test_hostha_kvm Skipped --- test_hostha_kvm.py

@sudo87
Copy link
Collaborator Author

sudo87 commented Oct 1, 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

this PR makes sense to me, however it is difficult to validate
I think we can merge if there is no regression.
what do you think ? @shwstppr @DaanHoogland

@sudo87
Copy link
Collaborator Author

sudo87 commented Oct 1, 2025

@weizhouapache, agreed. It needs testing with larger env. That said, I did a basic validation (suggested in the issue) by spinning off 4 instances in 2 different envs running 4.20, one with this change and other without. Both were configured with userdispersing vm allocation algo.

for i in {01..4}; do cloudstack deployVirtualMachine serviceofferingid=XXX templateid=YYY zoneid=ZZZ name=test-${i} & done

Results:

  • With this change: Instances were evenly distributed across 2 hosts (2-2)
  • w/o: 3 were placed on host1, 1 on host2

@weizhouapache
Copy link
Member

@weizhouapache, agreed. It needs testing with larger env. That said, I did a basic validation (suggested in the issue) by spinning off 4 instances in 2 different envs running 4.20, one with this change and other without. Both were configured with userdispersing vm allocation algo.

for i in {01..4}; do cloudstack deployVirtualMachine serviceofferingid=XXX templateid=YYY zoneid=ZZZ name=test-${i} & done

Results:

  • With this change: Instances were evenly distributed across 2 hosts (2-2)
  • w/o: 3 were placed on host1, 1 on host2

@sudo87
can you deploy more (e.g. 20) instances with smaller memory ?

@sudo87
Copy link
Collaborator Author

sudo87 commented Oct 1, 2025

@weizhouapache, agreed. It needs testing with larger env. That said, I did a basic validation (suggested in the issue) by spinning off 4 instances in 2 different envs running 4.20, one with this change and other without. Both were configured with userdispersing vm allocation algo.

for i in {01..4}; do cloudstack deployVirtualMachine serviceofferingid=XXX templateid=YYY zoneid=ZZZ name=test-${i} & done

Results:

  • With this change: Instances were evenly distributed across 2 hosts (2-2)
  • w/o: 3 were placed on host1, 1 on host2

@sudo87 can you deploy more (e.g. 20) instances with smaller memory ?

End result is same for both envs, each host has 10 instances running. Transition from Initialize -> Starting -> Running is small for a lean image.

@weizhouapache
Copy link
Member

End result is same for both envs, each host has 10 instances running. Transition from Initialize -> Starting -> Running is small for a lean image.

ok, so it may happen only if starting vms take a bit long time than usual

@blueorangutan
Copy link

[SF] Trillian test result (tid-14491)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 56552 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11751-t14491-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

@weizhouapache weizhouapache merged commit ca7138b into apache:4.20 Oct 2, 2025
26 checks passed
@DaanHoogland DaanHoogland deleted the considerStartingAllocate branch October 3, 2025 06:39
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Oct 17, 2025
…gorithm (apache#11751)

* Consider Instance in Starting state as well for allocation algorithm

* use IN instead of OR statement
sandeeplocharla pushed a commit to NetApp/cloudstack that referenced this pull request Oct 21, 2025
…gorithm (apache#11751)

* Consider Instance in Starting state as well for allocation algorithm

* use IN instead of OR statement
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.

Userdispersing algorithm does not consider VMs in starting state

5 participants