Don't allow inadvertent deletion of hidden details via API#7880
Don't allow inadvertent deletion of hidden details via API#7880weizhouapache merged 3 commits intoapache:4.18from
Conversation
7c2aabf to
b57ad1b
Compare
DaanHoogland
left a comment
There was a problem hiding this comment.
code looks good. one remark about the integration test
|
@blueorangutan package |
|
@weizhouapache a [SF] 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 package |
|
@weizhouapache a [SF] 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 6843 |
|
@blueorangutan test |
|
@weizhouapache a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7497)
|
Co-authored-by: dahn <daan.hoogland@gmail.com>
|
@blueorangutan test |
|
@mlsorensen a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
Codecov Report
@@ Coverage Diff @@
## 4.18 #7880 +/- ##
============================================
+ Coverage 13.04% 13.06% +0.02%
- Complexity 9067 9089 +22
============================================
Files 2720 2720
Lines 257236 257299 +63
Branches 40103 40120 +17
============================================
+ Hits 33552 33620 +68
+ Misses 219474 219456 -18
- Partials 4210 4223 +13
... and 10 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
[SF] Trillian test result (tid-7519)
|
|
tested on a xcpng environment, the hidden vm setting is still there before vm setting change after |
Description
This PR fixes the case where someone updates the VM details via API and the non-displayable details that cloudstack uses for managing config internally get deleted. An example of a non-displayable detail is
configDriveLocation. If a user is using host based config drive, then configDriveLocation = "HOST". If any detail is updated/changed, then this non-displayable detail is wiped. It was never visible via the API, so there's no chance someone could preserve it during a detail update.In the case that the VM is stopped, a detail is updated, and then the VM delete is attempted, VM deletion can fail because it can't find the proper config drive location. A workaround for this specific situation is to start the VM, which will rewrite the missing detail. However, this surfaced the issue that these hidden details aren't preserved if details are updated.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Tested as user and as admin manually.
Provided a Marvin test for updateVirtualMachine to cover common situations.