storage: validate NFS secondary storage mount using SSVM during image store discovery#12678
Open
SURYAS1306 wants to merge 2 commits intoapache:4.22from
Open
storage: validate NFS secondary storage mount using SSVM during image store discovery#12678SURYAS1306 wants to merge 2 commits intoapache:4.22from
SURYAS1306 wants to merge 2 commits intoapache:4.22from
Conversation
shwstppr
reviewed
Feb 23, 2026
shwstppr
reviewed
Feb 23, 2026
Contributor
shwstppr
left a comment
There was a problem hiding this comment.
Will need validation for a new zone
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent registering unusable NFS secondary storage by performing fail-fast validation during image store discovery, using a Secondary Storage VM (SSVM) to verify the mount before proceeding.
Changes:
- Injects
SecondaryStorageVmManagerintoStorageManagerImpl. - Adds SSVM-based validation logic inside
discoverImageStoreand rolls back the image store on validation failure. - Returns an error to the API caller when SSVM setup/mount validation fails.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12678 +/- ##
============================================
- Coverage 17.60% 17.60% -0.01%
- Complexity 15659 15660 +1
============================================
Files 5917 5917
Lines 531394 531447 +53
Branches 64970 64977 +7
============================================
- Hits 93575 93563 -12
- Misses 427269 427335 +66
+ Partials 10550 10549 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… store (CLOUDSTACK-12674)
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
This PR addresses issue #12674 where CloudStack allows adding a secondary storage (image store) even when the provided NFS mount path is invalid.
Currently during image store discovery, CloudStack persists the image store in the database without validating whether the Secondary Storage VM (SSVM) can access the NFS export.
The failure only appears later during system VM template seeding (setup-sysvm-tmplt), producing errors in logs while the API/UI reports successful storage addition.
This leads to an inconsistent state where unusable secondary storage is registered in the system.
Previously validation occurred only during System VM template seeding; this change introduces fail-fast validation during image store discovery.
This PR performs immediate validation using SSVM during image store discovery:
If the SSVM setup command fails:
This prevents unusable secondary storage from being registered and avoids late failures during system VM template registration.
Fixes: #12674
Types of changes
Bug Severity
How Has This Been Tested?
Environment
Test Scenarios
Valid NFS mount
Invalid NFS mount
Regression check
Unit tests executed:
mvn -pl server -Dtest=StorageManagerImplTest,SecondaryStorageManagerImplTest testHow did you try to break this feature and the system with this change?
In all cases, storage creation failed correctly and no invalid store was registered.