SharedFS: fix NPE when accessing systemvm templates for unsupported hypervisors - #13930
SharedFS: fix NPE when accessing systemvm templates for unsupported hypervisors#13930abh1sar wants to merge 3 commits into
Conversation
… in deploySharedFSVM()
There was a problem hiding this comment.
Pull request overview
This PR addresses an intermittent NullPointerException during SharedFS VM deployment by ensuring unsupported hypervisors (or hypervisors without a downloaded SystemVM template) don’t cause template dereferences, and by tightening the hypervisor list used for SystemVM-based deployments.
Changes:
- Treat the
getSupportedHypervisorTypesboolean flag as “for SystemVM” and use it from the SharedFS deployment path. - Fix SharedFS deployment to continue iterating hypervisors when a SystemVM template is missing, instead of dereferencing a null template.
- Update the SharedFS unit test stubbing and related method signatures to match the new boolean flag name.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/test/java/com/cloud/resource/MockResourceManagerImpl.java | Updates mock method signature to match the renamed boolean parameter. |
| server/src/main/java/com/cloud/resource/ResourceManagerImpl.java | Renames the boolean parameter and keeps filtering logic for SystemVM-oriented hypervisor selection. |
| plugins/storage/sharedfs/storagevm/src/test/java/org/apache/cloudstack/storage/sharedfs/lifecycle/StorageVmSharedFSLifeCycleTest.java | Updates stubs to call getSupportedHypervisorTypes(..., true, ...) for SharedFS deployment tests. |
| plugins/storage/sharedfs/storagevm/src/main/java/org/apache/cloudstack/storage/sharedfs/lifecycle/StorageVmSharedFSLifeCycle.java | Uses SystemVM-filtered hypervisors and prevents NPE by continuing when templates are missing. |
| api/src/main/java/com/cloud/resource/ResourceService.java | Renames the boolean parameter in the API interface to reflect SystemVM intent. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #13930 +/- ##
============================================
+ Coverage 17.71% 17.77% +0.06%
- Complexity 15858 15984 +126
============================================
Files 5926 5928 +2
Lines 533613 534303 +690
Branches 65285 65383 +98
============================================
+ Hits 94517 94988 +471
- Misses 428415 428569 +154
- Partials 10681 10746 +65
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@blueorangutan package |
|
@abh1sar a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18928 |
Description
This PR fixes #13837
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?