Skip to content

Guest OS rules #10098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft

Guest OS rules #10098

wants to merge 19 commits into from

Conversation

BryanMLima
Copy link
Contributor

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)
  • 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

Screenshots (if appropriate):

image

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-2 was filtered during the deployment.
  • I tried to migrate these VMs to host-2 and 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-1 to host-2 and 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.

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 3.90%. Comparing base (41b4f0a) to head (5c9e4ea).
Report is 51 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (41b4f0a) and HEAD (5c9e4ea). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (41b4f0a) HEAD (5c9e4ea)
unittests 1 0
Additional details and impacted files
@@              Coverage Diff              @@
##               main   #10098       +/-   ##
=============================================
- Coverage     16.57%    3.90%   -12.68%     
=============================================
  Files          5719      414     -5305     
  Lines        507200    33748   -473452     
  Branches      61574     6076    -55498     
=============================================
- Hits          84093     1317    -82776     
+ Misses       413688    32275   -381413     
+ Partials       9419      156     -9263     
Flag Coverage Δ
uitests 3.90% <ø> (-0.07%) ⬇️
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.

Copy link

github-actions bot commented Jan 8, 2025

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

Copy link

github-actions bot commented Feb 1, 2025

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13624

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13720

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13731

@DaanHoogland
Copy link
Contributor

@BryanMLima can you look at the conflicts?

@BryanMLima
Copy link
Contributor Author

@BryanMLima can you look at the conflicts?

I will take a look this week, apologies for disappearing 😅 .

# Conflicts:
#	engine/schema/src/main/java/com/cloud/host/dao/HostDao.java
#	engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java
#	server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
#	server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
#	ui/src/views/infra/HostUpdate.vue
Copy link

github-actions bot commented Jul 3, 2025

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

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.

4 participants