Guard OS type update for iso/template with existing vms#11215
Guard OS type update for iso/template with existing vms#11215sureshanaparti merged 5 commits intoapache:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11215 +/- ##
============================================
- Coverage 16.58% 16.57% -0.01%
- Complexity 13991 14057 +66
============================================
Files 5745 5772 +27
Lines 510757 512956 +2199
Branches 62144 62308 +164
============================================
+ Hits 84690 85023 +333
- Misses 416598 418451 +1853
- Partials 9469 9482 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@blueorangutan package |
|
@abh1sar 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]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14209 |
| sc.addAnd("state", SearchCriteria.Op.NEQ, State.Expunging); | ||
| List<VMInstanceVO> vms = _vmInstanceDao.search(sc, null); | ||
| if (vms != null && !vms.isEmpty()) { | ||
| if (!Boolean.TRUE.equals(cmd.getForceUpdateOsType())) { |
There was a problem hiding this comment.
for backwards compatibility, I suggest to force update vm os types by default.
on UI, we can uncheck the checkbox by default.
There was a problem hiding this comment.
@weizhouapache I can make this change, but the issue will still be there for the api calls.
Do you foresee this impacting any workflows? My initial thought was it would be relatively uncommon for users to change the OS type of a template or ISO after deploying VMs from them, so the risk of breaking existing setups seems low. Happy to proceed as you recommend. let me know your thoughts.
There was a problem hiding this comment.
@abh1sar
I am good with both.
@DaanHoogland @sureshanaparti
Your advise ?
There was a problem hiding this comment.
@abh1sar I would say, keep existing functionality as default in the API as @weizhouapache says. We can change the default at any time if users massively protest.
|
@blueorangutan package |
|
@sureshanaparti 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]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14282 |
|
@blueorangutan test |
|
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-13835)
|
There was a problem hiding this comment.
LGTM.
Force update is disabled by default in the UI. Changing the OS type with force update disabled, results in an error (if Instances created from that ISO - exist).
Changing the OS Type with "Force update OS type" enabled - is possible.
Via the API - changing OS type is possible without having to use the 'forceupdateostype' flag. If it is set to 'false' the OS type is not updated.
Same behavior is valid for Templates.
There was a problem hiding this comment.
@abh1sar check the cmk error msg cc @rosi-shapeblue
msg looks ok, with the updated results. |
* Guard OS type update for iso/template with existing vms * fix identation * rename vm -> instance * force update iso/template as true by default via api * add missing message.success.update.iso label
Description
This PR fixes #10588
The behaviour is as follows:
If no VMs are present which were deployed using the ISO/Template - OS type change is allowed
If VMs are present which were deployed using the ISO/Template - OS type change is disallowed but can still be done using the
forceupdateostypeparameter. In the UI, this field is displayed only if the OS type is changed.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
Force option not visible by default

Only visible if the OS type is changed

The error:

How Has This Been Tested?
How did you try to break this feature and the system with this change?