-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix restore from NAS backup when datadisk is older than the root disk. #11258
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #11258 +/- ##
==========================================
Coverage 16.15% 16.15%
+ Complexity 13277 13274 -3
==========================================
Files 5657 5656 -1
Lines 497939 497811 -128
Branches 60386 60372 -14
==========================================
- Hits 80443 80436 -7
+ Misses 408532 408423 -109
+ Partials 8964 8952 -12
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:
|
@blueorangutan package |
@sureshanaparti 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. |
.../main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java
Show resolved
Hide resolved
There was a problem hiding this 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 restore issue with NAS backups where the wrong disk could be identified as the root disk during restoration, causing silent failures. The fix ensures volumes are processed in the correct order by sorting by deviceId instead of relying on database ID order.
- Sort volumes by deviceId during backup creation and restore operations to maintain correct disk ordering
- Improve error handling in LibvirtRestoreBackupCommandWrapper to return proper errors instead of failing silently
- Standardize backup validation logic between volume attach and detach operations
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 |
---|---|
BackupManagerImpl.java | Sort volumes by deviceId when creating volume info for backups |
VolumeApiServiceImpl.java | Refactor backup validation logic and consistently apply to both attach/detach |
NASBackupProvider.java | Sort volumes by deviceId during backup and restore operations |
LibvirtRestoreBackupCommandWrapper.java | Improve error handling to return proper error messages instead of silent failures |
VolumeApiServiceImplTest.java | Update test method calls to reflect refactored validation method names |
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java
Show resolved
Hide resolved
.../main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java
Outdated
Show resolved
Hide resolved
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14294 |
@blueorangutan test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
@blueorangutan test |
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm @abh1sar , but can you consider CoPilot’s comments?
[SF] Trillian test result (tid-13843)
|
@blueorangutan package |
@sureshanaparti 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
The reported issue is not present anymore. I followed the steps given in the issue that is fixed.
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14308 |
Description
This PR fixes #11257.
deviceId
.id
in thevolumes
table.id
in thevolumes
table than the root volume, restore mistakenly assumes the data disk to be the root disk.Another minor issue exists with Volume attach and detach operations on Instances that have an associated backup offering:
Changes done
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?