Skip to content

Conversation

@sudo87
Copy link
Collaborator

@sudo87 sudo87 commented Dec 11, 2025

Description

This PR cleans up following vm and volume allocation algorithms which are redundant and behave same as “random" and “firstfit”, without the "userconcentrated" :

  1. userconcentratedpod_random
  2. userconcentratedpod_firstfit

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?

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 8.33333% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.46%. Comparing base (cfe9602) to head (3bbbb26).

Files with missing lines Patch % Lines
...ava/com/cloud/upgrade/dao/Upgrade42210to42300.java 0.00% 7 Missing ⚠️
...in/java/com/cloud/upgrade/dao/Upgrade410to420.java 0.00% 2 Missing ⚠️
...torage/allocator/AbstractStoragePoolAllocator.java 0.00% 0 Missing and 1 partial ⚠️
...gent/manager/allocator/impl/FirstFitAllocator.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #12233   +/-   ##
=========================================
  Coverage     17.45%   17.46%           
- Complexity    15513    15516    +3     
=========================================
  Files          5913     5913           
  Lines        529385   529392    +7     
  Branches      64679    64680    +1     
=========================================
+ Hits          92426    92448   +22     
+ Misses       426541   426525   -16     
- Partials      10418    10419    +1     
Flag Coverage Δ
uitests 3.58% <ø> (ø)
unittests 18.52% <8.33%> (+<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.

@sudo87 sudo87 requested a review from DaanHoogland December 11, 2025 07:22
@DaanHoogland
Copy link
Contributor

I edtitted the description @sudo87, hope you like my version. looks good other wise but needs testing to make sure it is complete.

@sudo87 sudo87 force-pushed the cleanupRedundantVMAlgos branch from b0c4f5b to 3bbbb26 Compare December 11, 2025 12:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes redundant allocation algorithms userconcentratedpod_random and userconcentratedpod_firstfit which behaved identically to their base counterparts random and firstfit respectively.

Key Changes:

  • Removed enum values for redundant allocation algorithms from DeploymentPlanner.AllocationAlgorithm
  • Updated configuration descriptions and options to exclude the deprecated algorithms
  • Simplified code logic that previously checked for the redundant algorithm names
  • Added database migration scripts to automatically convert existing configurations to use the base algorithm names

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
api/src/main/java/com/cloud/deploy/DeploymentPlanner.java Removed userconcentratedpod_random and userconcentratedpod_firstfit from the AllocationAlgorithm enum
api/src/main/java/com/cloud/deploy/DeploymentClusterPlanner.java Updated ConfigKey description and options to exclude deprecated algorithms for VM allocation
engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java Updated ConfigKey description and options to exclude deprecated algorithms for volume allocation
server/src/main/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java Simplified conditional logic by removing check for userconcentratedpod_random
engine/storage/src/main/java/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java Simplified conditional logic by removing check for userconcentratedpod_random
engine/schema/src/main/resources/META-INF/db/schema-42210to42300.sql Added SQL migration to convert existing configurations from deprecated to base algorithm names
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42210to42300.java Implemented getPrepareScripts() to execute the migration SQL script
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade410to420.java Changed from enum references to string literals to maintain backward compatibility after enum values are removed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

@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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16051

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.

5 participants