Skip to content

sharedfs: skip hypervisors without system templates - #13830

Open
Dogface2k wants to merge 1 commit into
apache:4.22from
Dogface2k:fix/issue-13825-sharedfs-template
Open

sharedfs: skip hypervisors without system templates#13830
Dogface2k wants to merge 1 commit into
apache:4.22from
Dogface2k:fix/issue-13825-sharedfs-template

Conversation

@Dogface2k

Copy link
Copy Markdown
Collaborator

Fixes #13825

Summary

Prevent CreateSharedFileSystem from dereferencing a missing system VM template when a zone contains mixed hypervisor types.

Root cause

deploySharedFSVM() shuffles the supported hypervisors. When a hypervisor has no ready system VM template and another hypervisor remains, the existing null check fell through to template.getId() instead of trying the next hypervisor. This caused the reported intermittent NPE for mixed zones such as VMware plus External/MaaS.

Fix

Skip hypervisors without a ready system VM template while alternatives remain. Preserve the existing explicit CloudRuntimeException when the final candidate also has no template.

Validation

  • Reproduced the issue twice on the live CloudStack installation using an enabled, hostless External cluster alongside VMware; the exact template is null NPE occurred on the External-first attempt.
  • Removed all temporary clusters and test resources after reproduction; the zone returned to its original VMware-only state.
  • The focused regression test fails on the unfixed 4.22 branch with the exact NPE.
  • The focused Maven reactor test passes after the fix: 10 tests, 0 failures, 0 errors.

Scope

This is limited to SharedFS hypervisor template selection and its regression test. No UI, API contract, database schema, or deployment behavior is changed.

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.69%. Comparing base (5328528) to head (a42798a).

Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #13830      +/-   ##
============================================
- Coverage     17.69%   17.69%   -0.01%     
  Complexity    15835    15835              
============================================
  Files          5925     5925              
  Lines        533539   533541       +2     
  Branches      65274    65275       +1     
============================================
- Hits          94427    94424       -3     
- Misses       428435   428442       +7     
+ Partials      10677    10675       -2     
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 18.77% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants