Skip hypervisors with no systemvm template when creating a shared filesystem - #14086
Closed
nagaboinaramgopal wants to merge 1 commit into
Closed
nagaboinaramgopal wants to merge 1 commit into
nagaboinaramgopal wants to merge 1 commit into
Conversation
deploySharedFSVM iterates the zone's supported hypervisors looking for one with a systemvm template. It only threw when the template was missing on the last hypervisor, so a missing template on any earlier one fell through to template.getId() and hit a NullPointerException. In a zone with more than one hypervisor type where one has no systemvm template this failed the shared filesystem VM deployment at random depending on the shuffled order. Skip a hypervisor that has no template and move to the next, and throw only when none of them has one, mirroring the existing continue-on-hasNext handling further down the same loop. Fixes: apache#13825
Contributor
Author
|
Closing as a duplicate. I see #13830 already merged the same fix for #13825 (skip hypervisors without a system template, keep the final CloudRuntimeException). Thanks @Dogface2k, that covers it. |
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
Creating a shared filesystem fails with a NullPointerException in a zone that has more than one hypervisor type when one of those types has no systemvm template (for example an External or MaaS cluster next to a KVM cluster).
deploySharedFSVM walks the zone's supported hypervisors looking for one with a systemvm template, but it only threw when the template was missing on the last hypervisor. A missing template on any earlier one fell through to template.getId() and hit the NPE. Because the hypervisor list is shuffled, this failed at random.
Now a hypervisor with no template is skipped and the loop moves to the next one, and it only throws when none of them has a template. This mirrors the continue-on-hasNext handling already used for InsufficientCapacityException further down the same loop.
Fixes: #13825
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
N/A
How Has This Been Tested?
Added a unit test with two supported hypervisors where neither has a systemvm template. Before this change the deploy throws a NullPointerException, after it throws the intended CloudRuntimeException that says the template was not found. The existing shared filesystem lifecycle tests still pass.
How did you try to break this feature and the system with this change?
Checked the single hypervisor case still throws the same not-found error, so there is no regression when only one type is supported. The change only adds a skip to the next hypervisor when a template is missing and never touches the path where a template is found, so a normal deploy is unaffected.