| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
|
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. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.