Skip to content

Conversation

@abh1sar
Copy link
Collaborator

@abh1sar abh1sar commented Jan 16, 2026

Description

This PR fixes #12415

The agent.properties contains "nfsVersion = null" if the global settings secstorage.nfs.version is not set.
NfsSecondaryStorageResource picks up the nfsVersion as "null" String in CopyCommand and some other commands, and tries to mount the secondary storage with vers=null option leading to mount failures in logs.

Screenshot 2026-01-16 at 12 40 19 PM

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.23%. Comparing base (f1f779a) to head (050e0ed).

Files with missing lines Patch % Lines
.../secondarystorage/SecondaryStorageManagerImpl.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #12445   +/-   ##
=========================================
  Coverage     16.23%   16.23%           
- Complexity    13381    13382    +1     
=========================================
  Files          5657     5657           
  Lines        499024   499025    +1     
  Branches      60562    60562           
=========================================
+ Hits          81029    81033    +4     
+ Misses       408959   408957    -2     
+ Partials       9036     9035    -1     
Flag Coverage Δ
uitests 4.03% <ø> (ø)
unittests 17.09% <0.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@abh1sar
Copy link
Collaborator Author

abh1sar commented Jan 16, 2026

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16391

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

@abh1sar , this looks good, but you mention, "in CopyCommand and some other commands”. Does this mean this construct needs to be applied in several locations? (and hence methodised)

@abh1sar
Copy link
Collaborator Author

abh1sar commented Jan 16, 2026

@abh1sar , this looks good, but you mention, "in CopyCommand and some other commands”. Does this mean this construct needs to be applied in several locations? (and hence methodised)

All the commands take the value from the same place.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where the string literal "null" is written to the SSVM agent.properties file when the global setting secstorage.nfs.version is not configured. This causes NFS mount failures in the secondary storage VM because it attempts to mount with vers=null option.

Changes:

  • Added a null check before appending nfsVersion to boot arguments in finalizeVirtualMachineProfile method
Comments suppressed due to low confidence (1)

services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/SecondaryStorageManagerImpl.java:333

  • The same issue exists here where nfsVersion could be the string literal 'null' when secstorage.nfs.version is not configured. Consider adding a null check similar to the fix applied in finalizeVirtualMachineProfile (lines 1228-1230) to prevent setting null values on the command. This would be: if (nfsVersion != null) { setupCmd.setNfsVersion(nfsVersion); }
                String nfsVersion = imageStoreDetailsUtil.getNfsVersion(ssStore.getId());
                setupCmd.setNfsVersion(nfsVersion);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DaanHoogland
Copy link
Contributor

@abh1sar , this looks good, but you mention, "in CopyCommand and some other commands”. Does this mean this construct needs to be applied in several locations? (and hence methodised)

All the commands take the value from the same place.

meaning they all pass through this big ass finalizeVirtualMachineProfile() right? in that case 👍 .

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm, (of course this method needs chopping up.)

@abh1sar
Copy link
Collaborator Author

abh1sar commented Jan 16, 2026

@abh1sar , this looks good, but you mention, "in CopyCommand and some other commands”. Does this mean this construct needs to be applied in several locations? (and hence methodised)

All the commands take the value from the same place.

meaning they all pass through this big ass finalizeVirtualMachineProfile() right? in that case 👍 .

Yes, they all read the value of nfsVersion from agent.properties which is set via finalizeVirtualMachineProfile()

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16393

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.

5 participants