-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix KVM incremental volume snapshot migration between secondary storages #12086
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
base: main
Are you sure you want to change the base?
Fix KVM incremental volume snapshot migration between secondary storages #12086
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12086 +/- ##
==========================================
Coverage 17.55% 17.56%
- Complexity 15535 15549 +14
==========================================
Files 5911 5916 +5
Lines 529359 529690 +331
Branches 64655 64689 +34
==========================================
+ Hits 92949 93022 +73
- Misses 425952 426211 +259
+ Partials 10458 10457 -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:
|
|
@blueorangutan package |
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 bug where KVM incremental volume snapshots were not being migrated when data was transferred between secondary storages. The implementation extends the existing migration process to handle KVM-specific incremental snapshots and their checkpoint files, ensuring the entire snapshot chain is correctly migrated and rebased.
Key changes:
- Added support for migrating KVM incremental snapshot chains with their checkpoint files
- Implemented single-threaded execution per zone for KVM incremental snapshot migrations to maintain chain integrity
- Added new command classes and wrapper for handling snapshot migration between secondary storages
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| StorageManagerImpl.java | Added new configuration key for agent migration timeout |
| QemuImg.java | Enhanced convert method to support backing file specification during conversion |
| LibvirtStorageAdaptor.java | Updated convert call to include new backing file parameter |
| LibvirtMigrateSnapshotsBetweenSecondaryStoragesCommandWrapper.java | New handler for executing snapshot migration commands on KVM agents |
| SnapshotObject.java | Added methods to retrieve parent and child snapshot chains |
| SnapshotDataFactoryImpl.java | Sets KVM incremental snapshot flag based on checkpoint path presence |
| StorageOrchestrator.java | Core migration orchestration logic for handling KVM incremental snapshots |
| DataMigrationUtility.java | Updated to identify and build KVM incremental snapshot chains for migration |
| StorageManager.java | Defined new configuration key for migration timeout |
| SnapshotInfo.java | Added interface methods for retrieving snapshot chain relationships |
| MigrateSnapshotsBetweenSecondaryStoragesCommand.java | New command class for snapshot migration requests |
| MigrateBetweenSecondaryStoragesCommandAnswer.java | New answer class for migration command responses |
Comments suppressed due to low confidence (1)
plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/qemu/QemuImg.java:1
- [nitpick] Extra whitespace before 'new QemuImageOptions' parameter. Should have consistent single-space separation between parameters.
// Licensed to the Apache Software Foundation (ASF) under one
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ns/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
Outdated
Show resolved
Hide resolved
...hestration/src/main/java/org/apache/cloudstack/engine/orchestration/StorageOrchestrator.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
|
@blueorangutan package |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15849 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-14880) |
| throw new CloudRuntimeException("Unable to migrate KVM incremental snapshots to another secondary storage"); | ||
| } | ||
| } catch (final OperationTimedoutException | AgentUnavailableException e) { | ||
| throw new CloudRuntimeException("Error while migrating KVM incremental snapshot chain. Check the logs for more information.", e); |
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.
We could inform which snapshot failed.
| String resourceCurrentPath = imagePool.getLocalPathFor(snapshot.getPath()); | ||
|
|
||
| if (imagePoolUrl.equals(srcDataStore.getUrl()) && snapshotsIdToMigrate.contains(snapshot.getId())) { | ||
| parentSnapshotPath = copyResourceToDestDataStore(snapshot, resourceCurrentPath, destImagePool, parentSnapshotPath); | ||
| parentSnapshotWasMigrated = true; | ||
| } else { | ||
| if (parentSnapshotWasMigrated) { | ||
| parentSnapshotPath = rebaseResourceToNewParentPath(resourceCurrentPath, parentSnapshotPath); | ||
| } else { | ||
| parentSnapshotPath = resourceCurrentPath; | ||
| } | ||
| parentSnapshotWasMigrated = false; |
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.
we could add some logging for these decisions
|
[SF] Trillian test result (tid-14882)
|
Description
ACS allows data to be migrated from one secondary storage to another; however, this process disregards incremental volume snapshots created using the KVM hypervisor.
Since then, the migration process has been extended to also allow the migration of these resources.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
migrateResourceToAnotherSecondaryStoragemigrateSecondaryStorageDatamigrateSecondaryStorageDataHow did you try to break this feature and the system with this change?