Guest OS rules
Description
Currently, ACS provides a feature that enables a guest OS preference for a specific host, prioritizing VMs based on its OS. However, this functionality allows VMs with different OSes to be deployed in a host with a Guest OS defined, as expected as it is only a preference configuration; this is not always desired. For example, keeping proprietary OS in the same host could reduce licensing costs.
This PR tackles this scenario, allowing JavaScript rules, using the JS interpreter introduced in #5909, to direct VMs to specific hosts based on their OS. Different from the guest OS preference, these guest OS rules will be strict. This new feature added a new field, Guest OS as JS rule in the host edit view to allow users the creation of these rules.
This PR depends on #9074, for this reason it is on draft until #9074 is merged.
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
Screenshots (if appropriate):
How Has This Been Tested?
In a local lab with two hosts (host-1 and host-2) I created the guest OS rule vmGuestOs.toLowerCase().indexOf("debian") != -1 for host-2, and deployed multiple VMs using templates and ISOs.
- I deployed VMs with Ubuntu and CentOS and verify that
host-2was filtered during the deployment. - I tried to migrate these VMs to
host-2and verified that it was not possible. - I deployed a Debian VM and verified that both hosts were considered in the deployment process.
- I managed to migrate this VM from
host-1tohost-2and vice versa.
How did you try to break this feature and the system with this change?
I tried to deploy VMs in the same lab without the guest OS rules defined and validated that the deployment of VMs were being done as expected.
Codecov Report
:x: Patch coverage is 52.18447% with 197 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 17.70%. Comparing base (11455f6) to head (ee9c893).
:warning: Report is 8 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #10098 +/- ##
============================================
+ Coverage 17.66% 17.70% +0.03%
- Complexity 14063 14109 +46
============================================
Files 5307 5309 +2
Lines 473814 473854 +40
Branches 55637 55602 -35
============================================
+ Hits 83715 83901 +186
+ Misses 380774 380636 -138
+ Partials 9325 9317 -8
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 17.70% <52.18%> (+0.03%) |
: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.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@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 13624
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13720
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13731
@BryanMLima can you look at the conflicts?
@BryanMLima can you look at the conflicts?
I will take a look this week, apologies for disappearing :sweat_smile: .
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.