[AI Generated] Fix Azure VM size mismatch skip reason message#4418
Closed
[AI Generated] Fix Azure VM size mismatch skip reason message#4418
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves the Azure platform capability-selection skip messaging so that VM size/image requirement mismatches report a specific, actionable reason instead of being overwritten by a generic “unknown reason” message.
Changes:
- Preserve previously computed skip reasons in
_get_azure_capabilities()by only using the generic fallback when no specific error was set. - Emit a clearer “Requirement mismatch” message in
_get_allowed_capabilities()when a user explicitly requests a VM size but no capabilities are found.
| error = ( | ||
| "Requirement mismatch: requested VM size " | ||
| f"'{node_runbook.vm_size}' is unavailable in '{location}' " | ||
| "or incompatible with current test requirements." |
There was a problem hiding this comment.
Consider adding an explicit remediation hint to this skip reason (e.g., verify the VM size is offered in the region and supports the requested image architecture/requirements, or choose a different size/location) so it’s immediately actionable for users.
Suggested change
| "or incompatible with current test requirements." | |
| "or incompatible with current test requirements. Verify that " | |
| "the VM size is offered in this region and supports the " | |
| "requested image architecture and other requirements, or " | |
| "choose a different VM size or location." |
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
Test case details
|
Collaborator
Author
|
Just for testing purpose. |
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.
Problem
When a test is run with a specific VM size that is incompatible with the requested image (e.g., x86-only
Standard_HC44-16rswith an Arm64 Ubuntu image), LISA showed a misleading skip reason:Root Cause
In
_get_allowed_capabilities(), whennot allowed_capabilitiesand a specificvm_sizewas set, the error was a generic "no vm size found..." message. Then in_get_azure_capabilities(), theelse:branch unconditionally overwrote any specific error set earlier with the generic "unknown reason" fallback.Fix
_get_allowed_capabilities(): Whennot allowed_capabilitiesandnode_runbook.vm_sizeis explicitly set, emit a clear message:"Requirement mismatch: requested VM size '<size>' is unavailable in '<location>' or incompatible with current test requirements."_get_azure_capabilities(): Changedelse:→elif not error:so the generic "unknown reason" fallback only fires when no specific error was already populated.Validation
Repro with
Standard_HC44-16rs+22_04-lts-arm64image inwestus3now shows: