cluster-drs: trigger DRS on VM power-state events and add a combined cpu+memory metric - #14043
Open
nagaboinaramgopal wants to merge 2 commits into
Open
cluster-drs: trigger DRS on VM power-state events and add a combined cpu+memory metric#14043nagaboinaramgopal wants to merge 2 commits into
nagaboinaramgopal wants to merge 2 commits into
Conversation
drs.metric gains a "both" option. Cluster imbalance and each candidate migration's post-imbalance are measured as the worse (max) of the cpu and memory imbalance, so DRS acts whenever either resource is contended instead of only the single configured metric.
Adds drs.event.driven.enable (default false) and drs.event.driven.interval (default 5 min). When enabled for a cluster, ClusterDrsServiceImpl subscribes to the vm.powerstate message bus, resolves the affected cluster on each event and generates a plan for it within minutes (rate- limited per cluster), off the message-bus thread. The existing poll then executes the plan. Requires drs.automatic.enable.
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
Two cluster-DRS improvements.
Event-driven DRS. Cluster DRS previously ran only on the periodic timer, so an imbalance created when a VM starts or stops was not corrected until the next scheduled run. This subscribes the DRS service to VM power-state events and triggers a DRS pass for the affected cluster when one fires. Two new cluster-scoped settings control it:
drs.event.driven.enable(default false, off) anddrs.event.driven.interval(default 5, the minimum seconds between event-driven runs, so a burst of power events is debounced into a single pass). Event-driven runs still require automatic DRS to be enabled for the cluster and honour the existing DRS algorithm and thresholds. Off by default, so nothing changes until an operator opts in.A "both" DRS metric. In addition to balancing on cpu or memory, the new
bothmetric balances on both together by scoring a candidate migration on the worse of its cpu and memory post-migration imbalance, so a cluster is only considered balanced when both dimensions are.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
Added unit tests in
ClusterDrsServiceImplTest:testShouldTriggerEventDrivenDrsDisabledByDefault: no event-driven run when the setting is off (the default).testShouldTriggerEventDrivenDrsRequiresAutomaticDrs: event-driven runs only when automatic DRS is enabled.testShouldTriggerEventDrivenDrsEnabledThenDebounced: a second event within the interval is debounced.testTriggerEventDrivenDrsForVmSchedulesWhenEnabledandtestTriggerEventDrivenDrsForVmDoesNotScheduleWhenDisabled: a VM power-state event schedules a DRS pass only when enabled.Also built the standard packages and deployed on a KVM advanced zone.