fix(templates): skip CPU-limited VMs gracefully instead of failing the play#45
Open
t0kubetsu wants to merge 1 commit into
Open
fix(templates): skip CPU-limited VMs gracefully instead of failing the play#45t0kubetsu wants to merge 1 commit into
t0kubetsu wants to merge 1 commit into
Conversation
When a template VM has more vm_cores than the host's physical CPU count,
qm start fails with "MAX X vcpus allowed per VM on this node". Previously
this failed the entire play, blocking all remaining templates.
Changes:
- Add 'MAX' to the START task failed_when ignore list so the play continues
- Build templates_started (VMs that started) and templates_skipped_cpu
(VMs that hit the CPU limit) from the start results
- Run WAIT, DETACH, RE-ATTACH, CONVERT only on templates_started
- Display a clear warning listing skipped templates and why
The template vm_cores definitions are intentionally preserved — they
represent the intended sizing tier. Users on hosts with more physical
CPUs will get all templates; users on smaller hosts get a warning
instead of a playbook failure.
Applies to: blank_scenario_2_subnets, blank_scenario_4_subnets,
blank_scenario_6_subnets
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.
Fixes #43
Summary
Why not cap vm_cores?
PR #44 took that approach and was closed as wrong: capping vm_cores changes the actual template spec and causes cloned VMs to have fewer CPUs than intended. The template definitions are correct — the playbook just needs to handle the case where the current host cannot fulfil them.
Test plan