-
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.55% -0.01%
- Complexity 15535 15540 +5
============================================
Files 5911 5914 +3
Lines 529359 529609 +250
Branches 64655 64674 +19
============================================
+ Hits 92949 92982 +33
- Misses 425952 426168 +216
- Partials 10458 10459 +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 |
|
@hsato03 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. |
|
Packaging result [SF]: ✔️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 15785 |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 15805 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-14849)
|
|
[SF] Trillian test result (tid-14864)
|
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.
| try { | ||
| boolean isQCOW2 = PhysicalDiskFormat.QCOW2.equals(sourceFormat); | ||
| qemu.convert(srcFile, destFile, null, null, new QemuImageOptions(srcFile.getFormat(), srcFile.getFileName(), null), | ||
| qemu.convert(srcFile, destFile, null, null, null, new QemuImageOptions(srcFile.getFormat(), srcFile.getFileName(), null), |
Copilot
AI
Nov 26, 2025
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.
[nitpick] Extra whitespace between 'null,' parameters. Should have consistent single-space separation between parameters.
| qemu.convert(srcFile, destFile, null, null, null, new QemuImageOptions(srcFile.getFormat(), srcFile.getFileName(), null), | |
| qemu.convert(srcFile, destFile, null, null, null, new QemuImageOptions(srcFile.getFormat(), srcFile.getFileName(), null), |
|
|
||
| if (storageCapacityBelowThreshold(storageCapacities, destImgStoreId)) { | ||
| storageCapacities = migrateAway(chosenFileForMigration, storageCapacities, snapshotChains, childTemplates, srcDatastore, destImgStoreId, executor, futures); | ||
| storageCapacities = migrateAway(chosenFileForMigration, storageCapacities, snapshotChains, childTemplates, snapshotIdsToMigrate, srcDatastore, destImgStoreId, executor, futures); |
Copilot
AI
Nov 26, 2025
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.
[nitpick] Extra whitespace before 'snapshotIdsToMigrate' parameter. Should have consistent single-space separation between parameters.
| storageCapacities = migrateAway(chosenFileForMigration, storageCapacities, snapshotChains, childTemplates, snapshotIdsToMigrate, srcDatastore, destImgStoreId, executor, futures); | |
| storageCapacities = migrateAway(chosenFileForMigration, storageCapacities, snapshotChains, childTemplates, snapshotIdsToMigrate, srcDatastore, destImgStoreId, executor, futures); |
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?