Skip to content

NAS backup provider: Support backup and restore with Shared mount point primary storage. #11204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2025

Conversation

abh1sar
Copy link
Collaborator

@abh1sar abh1sar commented Jul 15, 2025

Description

This PR fixes #11117 and #11118 by handling backup and restore when volumes are hosted on Shared mount point.

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?

Tested backup and restore with volumes on a Shared mount point storage backed by NFS.

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

Copy link

codecov bot commented Jul 15, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 16.15%. Comparing base (ba0204f) to head (575563f).
Report is 26 commits behind head on 4.20.

Files with missing lines Patch % Lines
...rg/apache/cloudstack/backup/NASBackupProvider.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               4.20   #11204    +/-   ##
==========================================
  Coverage     16.15%   16.15%            
+ Complexity    13277    13273     -4     
==========================================
  Files          5657     5656     -1     
  Lines        497939   497730   -209     
  Branches      60386    60361    -25     
==========================================
- Hits          80443    80418    -25     
+ Misses       408532   408361   -171     
+ Partials       8964     8951    -13     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.00% <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.

This was linked to issues Jul 15, 2025
@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 ✔️ debian ✔️ suse15. SL-JID 14195

@DaanHoogland
Copy link
Contributor

@blueorangutan test keepEnv

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-13788)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 52922 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11204-t13788-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@abh1sar abh1sar requested a review from Pearl1594 July 18, 2025 04:42
@rajujith rajujith self-requested a review July 22, 2025 10:38
@rajujith rajujith self-assigned this Jul 22, 2025
Copy link

@rajujith rajujith left a comment

Choose a reason for hiding this comment

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

LGTM.

Tested with sharedmountpoint on KVM. Instance backup,restore on NAS Repos are working fine.

@rajujith rajujith removed their assignment Jul 23, 2025
Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

clgtm

@sureshanaparti sureshanaparti requested a review from Copilot July 23, 2025 10:17
Copy link

@Copilot 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 enhances the NAS backup provider to support backup and restore operations for volumes hosted on Shared mount point primary storage. The change addresses issues with volume path resolution when using different storage pool types.

  • Adds support for SharedMountPoint storage pool type in volume path calculation
  • Restructures the conditional logic to handle multiple storage pool types appropriately
  • Uses the storage pool's path directly for SharedMountPoint storage pools instead of the default UUID-based path

@@ -246,9 +246,13 @@ private List<String> getVolumePaths(List<VolumeVO> volumes) {
if (Objects.isNull(storagePool)) {
throw new CloudRuntimeException("Unable to find storage pool associated to the volume");
}
String volumePathPrefix = String.format("/mnt/%s", storagePool.getUuid());
String volumePathPrefix;
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider initializing volumePathPrefix with a default value or restructuring the logic to avoid uninitialized variable concerns. While the current logic covers all cases, explicit initialization would improve code clarity.

Suggested change
String volumePathPrefix;
String volumePathPrefix = "";

Copilot uses AI. Check for mistakes.

@DaanHoogland DaanHoogland merged commit 0ebf72d into apache:4.20 Jul 23, 2025
23 of 25 checks passed
@DaanHoogland DaanHoogland deleted the nas-shared-mount-point branch July 23, 2025 10:45
@DaanHoogland DaanHoogland mentioned this pull request Jul 23, 2025
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.

NAS Restore fail NAS backup fail on stopped VM
5 participants