Skip to content

Add API command remove management server #10325

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

Conversation

nicoschmdt
Copy link
Collaborator

Description

This PR adds a command to mark a Management Server as removed on the database only if its status is marked as Down. To execute the command, it is obligatory to inform the id of the targeted MS.

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

How Has This Been Tested?

In a local lab, I added an MS through the database.

  • With State="Down" I executed through CMK remove managementserver id=<uuid> and verified that the MS wasn't being listed on the UI and was marked as Removed on the database.
  • With State="Up" I executed the same command and verified an error was returned informing it wasn't possible to remove an MS which state was marked as "Up".
  • With State="Down" I executed through a URL http://<IP>:8080/client/api?command=removeManagementServer&response=json&id=<UUID> and verified the MS was marked as removed and wasn't being listed on the UI.
  • With State="Up" I executed the same URL and received an error informing it wasn't possible to remove an MS which state was marked as "Up".
  • Trying to execute the command with a non-existent id returns an error warning the request format may be invalid, the entity may not exist, or the parameter annotation may be wrong.
  • Trying to execute the command without an id, both in CMK and with a URL, returns an error informing the id parameter is obligatory and it is missing.

@bernardodemarco
Copy link
Collaborator

@nicoschmdt, apparently the ManagementServerImpl.java file has conflicts. Could you resolve them, please?

@bernardodemarco bernardodemarco added this to the 4.21.0 milestone Feb 4, 2025
Copy link

github-actions bot commented Feb 5, 2025

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

@bernardodemarco
Copy link
Collaborator

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 3.03030% with 32 lines in your changes missing coverage. Please review.

Project coverage is 16.15%. Comparing base (48f890a) to head (f8aed76).
Report is 148 commits behind head on main.

Files with missing lines Patch % Lines
...nd/admin/management/RemoveManagementServerCmd.java 0.00% 18 Missing ⚠️
...in/java/com/cloud/server/ManagementServerImpl.java 0.00% 11 Missing ⚠️
...com/cloud/api/query/vo/ManagementServerJoinVO.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10325      +/-   ##
============================================
- Coverage     16.15%   16.15%   -0.01%     
  Complexity    13267    13267              
============================================
  Files          5666     5667       +1     
  Lines        498051   498084      +33     
  Branches      60259    60262       +3     
============================================
+ Hits          80454    80455       +1     
- Misses       408589   408621      +32     
  Partials       9008     9008              
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.00% <3.03%> (-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

github-actions bot commented Feb 7, 2025

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

Copy link
Collaborator

@bernardodemarco bernardodemarco left a comment

Choose a reason for hiding this comment

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

clgtm

@JoaoJandre
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@JoaoJandre 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 12461

@nicoschmdt
Copy link
Collaborator Author

@JoaoJandre could we run package again?

@winterhazel
Copy link
Member

@nicoschmdt you do not need any permission to run package

@nicoschmdt
Copy link
Collaborator Author

@blueorangutan package

@blueorangutan
Copy link

@nicoschmdt 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 12490

Copy link

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

@nicoschmdt
Copy link
Collaborator Author

@blueorangutan package

@blueorangutan
Copy link

@nicoschmdt 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 12560

nicoschmdt and others added 7 commits February 26, 2025 10:45
Co-authored-by: Bernardo De Marco Gonçalves <bernardomg2004@gmail.com>
Co-authored-by: Bernardo De Marco Gonçalves <bernardomg2004@gmail.com>
Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
…gement/RemoveManagementServerCmd.java

Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
@nicoschmdt nicoschmdt force-pushed the add-remove-ms-api-command branch from 3345f6e to f8aed76 Compare February 26, 2025 13:46
@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 12569

@nicoschmdt
Copy link
Collaborator Author

@blueorangutan package

@blueorangutan
Copy link

@nicoschmdt 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 12579

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@JoaoJandre
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@JoaoJandre 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 13001

Copy link

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

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