Add a soft host-tag VM placement preference (affinity processor) - #14083
Open
nagaboinaramgopal wants to merge 1 commit into
Open
Add a soft host-tag VM placement preference (affinity processor)#14083nagaboinaramgopal wants to merge 1 commit into
nagaboinaramgopal wants to merge 1 commit into
Conversation
Adds a host-tag affinity processor. An affinity group of type "host tag affinity" takes the group name as a host tag; when a member VM is deployed, routing hosts carrying that tag in the VM's zone get their deployment priority raised. It is a preference and not a constraint: no host is ever added to the avoid set, so deployment still succeeds when no tagged host is available, and check() never fails a planned destination. The raised priority is not consulted by automatic DRS. Unit tests cover the three paths: tagged hosts get priority raised (nothing excluded), an empty match is a no-op, and check() returns true.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new affinity group processor for a soft host-tag placement preference. A group of type "host tag affinity" uses the group name as a host tag, and when a member VM deploys, hosts in its zone with that tag get a higher deployment priority. It is only a preference: no host is excluded, deployment still works when no tagged host is free, and check() never fails a destination. This is the soft counterpart to the existing strict host tag on service and disk offerings. The raised priority is a planner hint and is not used by automatic DRS.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
N/A
How Has This Been Tested?
Unit tests cover the three paths: tagged hosts get a higher priority, no matching tag is a no-op, and check() returns true.
Also on a live lab with three KVM hosts in one zone: tagged a single host, created a "host tag affinity" group named after the tag, and deployed. All the VMs in the group landed on the tagged host, and a VM outside the group landed on an untagged host.
How did you try to break this feature and the system with this change?
Deployed with no host carrying the tag: the processor does nothing and the VM still deploys. Ran a VM outside the group to confirm the untagged host was a valid target, so the tag preference is what steered placement, not a lack of options. Since it only raises priority and never excludes a host, a full or missing tagged host cannot block a deployment.