Skip to content

Management Server - Prepare for Maintenance and Cancel Maintenance improvements #10995

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 3 commits into
base: main
Choose a base branch
from

Conversation

sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Jun 10, 2025

Description

This PR has the following improvements for Management Server - Prepare for Maintenance and Cancel Maintenance.

  • Added new setting 'management.server.maintenance.ignore.maintenance.hosts' to ignore hosts in maintenance states while preparing management server for maintenance. This skips agent transfer and agents count check for hosts in maintenance, and unblocks Management Server in "preparing for maintenance" state when any Host stuck in "prepare for maintenance" (due to connectivity/race condition issues) or in other maintenance states.
  • Rebalance indirect agents after cancel maintenance, using rebalance parameter in cancelMaintenance API, to initiate the rebalancing of the indirect agents immediately instead of waiting for the 'indirect.agent.lb.check.interval' time.
  • Force maintenance after maintenance window timeout, using forced parameter in prepareForMaintenance API, in case migrate agents failed & they can re-connect to other available management node.
  • Propagate 'indirect.agent.lb.check.interval' setting change to the host agents.

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?

…provements:

- Added new setting 'management.server.maintenance.ignore.maintenance.hosts' to ignore hosts in maintenance states  while preparing management server for maintenance. This skips agent transfer and agents count check for hosts in maintenance.
- Rebalance indirect agents after cancel maintenance, using rebalance parameter in cancelMaintenance API
- Force maintenance after maintenance window timeout, using forced parameter in prepareForMaintenance API.
- Propagate 'indirect.agent.lb.check.interval' setting change to the host agents.
@sureshanaparti sureshanaparti force-pushed the ms_maintenance_new_setting_and_api_changes branch from e97cff3 to 835a5ab Compare June 10, 2025 09:09
@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti 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

codecov bot commented Jun 10, 2025

Codecov Report

Attention: Patch coverage is 16.48352% with 152 lines in your changes missing coverage. Please review.

Project coverage is 16.57%. Comparing base (41b4f0a) to head (835a5ab).
Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
...loudstack/agent/lb/IndirectAgentLBServiceImpl.java 10.93% 56 Missing and 1 partial ⚠️
.../src/main/java/com/cloud/host/dao/HostDaoImpl.java 0.00% 25 Missing ⚠️
.../cloud/configuration/ConfigurationManagerImpl.java 0.00% 18 Missing ⚠️
...enance/ManagementServerMaintenanceManagerImpl.java 51.61% 13 Missing and 2 partials ⚠️
...cloud/agent/manager/ClusteredAgentManagerImpl.java 0.00% 13 Missing ⚠️
agent/src/main/java/com/cloud/agent/Agent.java 0.00% 9 Missing ⚠️
...apache/cloudstack/agent/lb/SetupMSListCommand.java 0.00% 4 Missing ⚠️
...e/cloudstack/api/command/CancelMaintenanceCmd.java 0.00% 3 Missing ⚠️
...oudstack/api/command/PrepareForMaintenanceCmd.java 0.00% 3 Missing ⚠️
...pareForMaintenanceManagementServerHostCommand.java 25.00% 3 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10995      +/-   ##
============================================
- Coverage     16.57%   16.57%   -0.01%     
+ Complexity    13870    13869       -1     
============================================
  Files          5719     5719              
  Lines        507200   507314     +114     
  Branches      61574    61593      +19     
============================================
+ Hits          84093    84100       +7     
- Misses       413688   413792     +104     
- Partials       9419     9422       +3     
Flag Coverage Δ
uitests 3.96% <ø> (-0.01%) ⬇️
unittests 17.45% <16.48%> (-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.

@blueorangutan
Copy link

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

@sureshanaparti
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@sureshanaparti 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-13488)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 60623 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10995-t13488-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

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

@harikrishna-patnala
Copy link
Contributor

@sureshanaparti I guess this is ready for review ?

@sureshanaparti sureshanaparti marked this pull request as ready for review June 11, 2025 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

4 participants