cloudstack
cloudstack copied to clipboard
server,cks: check if vm is cks node during vm destroy
Description
Fixes #8902
Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] 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
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 Report
Attention: Patch coverage is 29.78723% with 33 lines in your changes missing coverage. Please review.
Project coverage is 14.96%. Comparing base (
87e7c57) to head (11b2156). Report is 21 commits behind head on 4.19.
Additional details and impacted files
@@ Coverage Diff @@
## 4.19 #9057 +/- ##
============================================
- Coverage 14.96% 14.96% -0.01%
+ Complexity 10995 10988 -7
============================================
Files 5373 5373
Lines 469005 469071 +66
Branches 58953 61186 +2233
============================================
- Hits 70198 70184 -14
- Misses 391036 391120 +84
+ Partials 7771 7767 -4
| Flag | Coverage Δ | |
|---|---|---|
| uitests | 4.31% <ø> (ø) |
|
| unittests | 15.66% <29.78%> (-0.01%) |
:arrow_down: |
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.
@shwstppr I am not sure if we should disallow the operation.
would it be a valid use case for users to
- drain the node in CKS
- remove the node vm from cloudstack
- scale the cks cluster to get a new node
for your information, in Autoscale VM group, users can destroy a specific VM when the vm group is disabled. the corresponding reference/map in database and load balancer rules are also removed. of course, cks cluster is totally different from AS vm group.
@shwstppr I am not sure if we should disallow the operation.
would it be a valid use case for users to
* drain the node in CKS * remove the node vm from cloudstack * scale the cks cluster to get a new nodefor your information, in Autoscale VM group, users can destroy a specific VM when the vm group is disabled. the corresponding reference/map in database and load balancer rules are also removed. of course, cks cluster is totally different from AS vm group.
@weizhouapache understood. Though destroying a valid cks node is also allowed right now. @Pearl1594 @nvazquez do we plan to add an API to remove a VM/node from CKS cluster? If there is, then the case mentioned by Wei should get handled? User can:
- drain node
- remove it from k8s cluster
- destroy the vm
@shwstppr I am not sure if we should disallow the operation. would it be a valid use case for users to
* drain the node in CKS * remove the node vm from cloudstack * scale the cks cluster to get a new nodefor your information, in Autoscale VM group, users can destroy a specific VM when the vm group is disabled. the corresponding reference/map in database and load balancer rules are also removed. of course, cks cluster is totally different from AS vm group.
@weizhouapache understood. Though destroying a valid cks node is also allowed right now. @Pearl1594 @nvazquez do we plan to add an API to remove a VM/node from CKS cluster? If there is, then the case mentioned by Wei should get handled? User can:
- drain node
- remove it from k8s cluster
- destroy the vm
thanks @shwstppr looks like a good idea to add a new API .
@weizhouapache on the special case discussed earlier, @Pearl1594 made me aware that we already have an option with scaleKubernetesCluster API to delete a specific node using nodeids param. We also show a delete action in the UI so the use-case that you mentioned should get covered by that,
@weizhouapache on the special case discussed earlier, @Pearl1594 made me aware that we already have an option with scaleKubernetesCluster API to delete a specific node using
nodeidsparam. We also show a delete action in the UI so the use-case that you mentioned should get covered by that,
That is great, thanks @shwstppr
Overall this pr looks good to me.
Can we add the information above in the error message, if user tries to delete a cks node?
@blueorangutan package
@shwstppr 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.
Packaging result [SF]: ✖️ el7 ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 9656
@blueorangutan package
@shwstppr 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.
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9665
@blueorangutan package
@shwstppr 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.
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9695
@blueorangutan test
@shwstppr a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
[SF] Trillian test result (tid-10283) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 42160 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9057-t10283-kvm-centos7.zip Smoke tests completed. 131 look OK, 0 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|
Added test API calls in the PR description