Skip to content

[4.22] Prevent unmanaging VM from CloudStack if it is part of a CKS cluster#12800

Open
nvazquez wants to merge 4 commits intoapache:4.22from
shapeblue:422-fix-cks-node-unmanage-vm
Open

[4.22] Prevent unmanaging VM from CloudStack if it is part of a CKS cluster#12800
nvazquez wants to merge 4 commits intoapache:4.22from
shapeblue:422-fix-cks-node-unmanage-vm

Conversation

@nvazquez
Copy link
Contributor

Description

This PR prevents unmanaging a VM from CloudStack if it belongs to a CKS cluster

Fixes: #12783

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 Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.70%. Comparing base (09ee092) to head (8fd6b8f).

❗ There is a different number of reports uploaded between BASE (09ee092) and HEAD (8fd6b8f). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (09ee092) HEAD (8fd6b8f)
unittests 1 0
Additional details and impacted files
@@              Coverage Diff              @@
##               4.22   #12800       +/-   ##
=============================================
- Coverage     17.61%    3.70%   -13.91%     
=============================================
  Files          5917      448     -5469     
  Lines        531423    38028   -493395     
  Branches      64973     7036    -57937     
=============================================
- Hits          93586     1409    -92177     
+ Misses       427280    36432   -390848     
+ Partials      10557      187    -10370     
Flag Coverage Δ
uitests 3.70% <ø> (ø)
unittests ?

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.

@kiranchavala kiranchavala self-assigned this Mar 12, 2026
Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

clgtm

@nvazquez
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@nvazquez
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-15632)

@nvazquez
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-15633)

@kiranchavala
Copy link
Member

@blueorangutan test

@nvazquez
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-15671)

@nvazquez
Copy link
Contributor Author

@blueorangutan test keepEnv

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-15672)

@nvazquez nvazquez force-pushed the 422-fix-cks-node-unmanage-vm branch from 8935377 to ac7a0fe Compare March 16, 2026 18:27
@nvazquez
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@nvazquez 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 17160

@nvazquez
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-15677)

@nvazquez
Copy link
Contributor Author

@blueorangutan test keepEnv

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-15678)

@nvazquez
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@nvazquez 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 17168

@kiranchavala
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

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

Copy link
Member

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

@nvazquez Please provide proper error message when a end user unamanges a instance which is a part of a cks cluster

Image
(localcloud) 🐱 > unmanage virtualmachine id=0aa8147a-1002-49e9-bcc6-5af4b35f05d2
{
  "account": "admin",
  "accountid": "7f089b6c-21c6-11f1-92f3-1e004e000380",
  "cmd": "org.apache.cloudstack.api.command.admin.vm.UnmanageVMInstanceCmd",
  "completed": "2026-03-17T07:33:20+0000",
  "created": "2026-03-17T07:33:20+0000",
  "domainid": "28ca91c8-21c6-11f1-92f3-1e004e000380",
  "domainpath": "ROOT",
  "jobid": "59a56976-d640-419b-b135-86706c5fee19",
  "jobinstanceid": "0aa8147a-1002-49e9-bcc6-5af4b35f05d2",
  "jobinstancetype": "VirtualMachine",
  "jobprocstatus": 0,
  "jobresult": {
    "errorcode": 530,
    "errortext": "No bean named 'com.cloud.kubernetes.cluster.KubernetesServiceHelper' available"
  },
  "jobresultcode": 530,
  "jobresulttype": "object",
  "jobstatus": 2,
  "userid": "7f09fbfa-21c6-11f1-92f3-1e004e000380"
}
🙈 Error: async API failed for job 59a56976-d640-419b-b135-86706c5fee19

The message can be similar to the one when a end user tries to destroy a machine which is part of the cks cluster

Image

@nvazquez
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

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.

CKS cluster goes into alert state when worker node is unmanaged

5 participants