cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Add API command remove management server

Open nicoschmdt opened this issue 1 year ago • 43 comments

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)
  • [x] 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
  • [x] 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.

nicoschmdt avatar Feb 04 '25 15:02 nicoschmdt

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

bernardodemarco avatar Feb 04 '25 18:02 bernardodemarco

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

github-actions[bot] avatar Feb 05 '25 02:02 github-actions[bot]

@blueorangutan package

bernardodemarco avatar Feb 05 '25 11:02 bernardodemarco

@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 avatar Feb 05 '25 11:02 blueorangutan

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

blueorangutan avatar Feb 05 '25 12:02 blueorangutan

Codecov Report

:x: Patch coverage is 5.26316% with 36 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 16.71%. Comparing base (7632814) to head (fb3e7de). :warning: Report is 227 commits behind head on main.

Files with missing lines Patch % Lines
...nd/admin/management/RemoveManagementServerCmd.java 0.00% 18 Missing :warning:
...in/java/com/cloud/server/ManagementServerImpl.java 0.00% 15 Missing :warning:
...com/cloud/api/query/vo/ManagementServerJoinVO.java 0.00% 3 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10325      +/-   ##
============================================
+ Coverage     16.57%   16.71%   +0.13%     
- Complexity    13868    14144     +276     
============================================
  Files          5719     5731      +12     
  Lines        507178   517729   +10551     
  Branches      61571    66058    +4487     
============================================
+ Hits          84085    86536    +2451     
- Misses       413674   421532    +7858     
- Partials       9419     9661     +242     
Flag Coverage Δ
uitests 4.26% <ø> (+0.29%) :arrow_up:
unittests 17.61% <5.26%> (+0.15%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Feb 05 '25 13:02 codecov[bot]

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

github-actions[bot] avatar Feb 07 '25 12:02 github-actions[bot]

@blueorangutan package

JoaoJandre avatar Feb 14 '25 11:02 JoaoJandre

@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 avatar Feb 14 '25 11:02 blueorangutan

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

blueorangutan avatar Feb 14 '25 12:02 blueorangutan

@JoaoJandre could we run package again?

nicoschmdt avatar Feb 17 '25 18:02 nicoschmdt

@nicoschmdt you do not need any permission to run package

winterhazel avatar Feb 17 '25 18:02 winterhazel

@blueorangutan package

nicoschmdt avatar Feb 17 '25 18:02 nicoschmdt

@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 avatar Feb 17 '25 19:02 blueorangutan

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

blueorangutan avatar Feb 17 '25 20:02 blueorangutan

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

github-actions[bot] avatar Feb 24 '25 20:02 github-actions[bot]

@blueorangutan package

nicoschmdt avatar Feb 25 '25 13:02 nicoschmdt

@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 avatar Feb 25 '25 13:02 blueorangutan

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

blueorangutan avatar Feb 25 '25 13:02 blueorangutan

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

blueorangutan avatar Feb 26 '25 14:02 blueorangutan

@blueorangutan package

nicoschmdt avatar Feb 26 '25 14:02 nicoschmdt

@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 avatar Feb 26 '25 14:02 blueorangutan

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

blueorangutan avatar Feb 26 '25 17:02 blueorangutan

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

blueorangutan avatar Feb 26 '25 17:02 blueorangutan

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

blueorangutan avatar Feb 27 '25 09:02 blueorangutan

@blueorangutan package

JoaoJandre avatar Apr 09 '25 19:04 JoaoJandre

@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 avatar Apr 09 '25 19:04 blueorangutan

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

blueorangutan avatar Apr 09 '25 20:04 blueorangutan

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

github-actions[bot] avatar Apr 28 '25 08:04 github-actions[bot]

@blueorangutan package

DaanHoogland avatar May 07 '25 05:05 DaanHoogland