-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Linstor: support live migration from other primary storage #12532
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: 4.20
Are you sure you want to change the base?
Linstor: support live migration from other primary storage #12532
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12532 +/- ##
==========================================
Coverage 16.24% 16.24%
- Complexity 13396 13406 +10
==========================================
Files 5658 5659 +1
Lines 499273 499542 +269
Branches 60600 60627 +27
==========================================
+ Hits 81125 81169 +44
- Misses 409104 409328 +224
- Partials 9044 9045 +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:
|
Move reusable methods from LinstorPrimaryDataStoreDriverImpl to LinstorUtil to enable sharing with other components: - logLinstorAnswer, logLinstorAnswers, checkLinstorAnswersThrow - getRscGrp, getEncryptedLayerList, applyQoSSettings - createResourceBase, createResource, spawnResource - canShareTemplateForResourceGroup, foundShareableTemplate Add LIN_PROP_DRBDOPT_EXACT_SIZE constant and exactSize parameter support for DRBD exact-size property handling during resource creation.
93af47f to
984e3f7
Compare
DaanHoogland
left a comment
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 package |
|
@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. |
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 enables live migration of VMs from any primary storage to Linstor primary storage, addressing issues #8032 and #11826 where migrations from NFS to Linstor were creating qcow files instead of DRBD resources.
Changes:
- Added
LinstorDataMotionStrategyto handle live migrations to Linstor storage - Refactored common Linstor operations into
LinstorUtilfor better code reuse - Implemented support for DRBD exact-size property during migration to maintain volume size consistency
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
LinstorDataMotionStrategy.java |
New data motion strategy that handles live migration from any primary storage to Linstor by creating destination resources and using QEMU to copy data |
LinstorUtil.java |
Added utility methods for resource creation, QoS settings, and encrypted layer handling; moved common code from driver implementation for reuse |
LinstorPrimaryDataStoreDriverImpl.java |
Refactored to use utility methods from LinstorUtil, reducing code duplication |
LinstorPrimaryDataStoreDriverImplTest.java |
Updated test to call utility method instead of driver method |
spring-storage-volume-linstor-context.xml |
Registered LinstorDataMotionStrategy as a Spring bean |
CHANGELOG.md |
Documented the new live migration support feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| } catch (AgentUnavailableException | OperationTimedoutException | CloudRuntimeException ex) { | ||
| errMsg = String.format( | ||
| "Copy volume(s) of VM [%s] to storage(s) [%s] and VM to host [%s] failed in StorPoolDataMotionStrategy.copyAsync. Error message: [%s].", |
Copilot
AI
Jan 28, 2026
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.
The error message incorrectly references "StorPoolDataMotionStrategy" instead of "LinstorDataMotionStrategy". This will be confusing when debugging issues.
| "Copy volume(s) of VM [%s] to storage(s) [%s] and VM to host [%s] failed in StorPoolDataMotionStrategy.copyAsync. Error message: [%s].", | |
| "Copy volume(s) of VM [%s] to storage(s) [%s] and VM to host [%s] failed in LinstorDataMotionStrategy.copyAsync. Error message: [%s].", |
| if (!vlmDfns.isEmpty()) | ||
| { | ||
| Properties props = vlmDfns.get(0).getProps(); | ||
| long iops = Long.parseLong(props.getOrDefault("sys/fs/blkio_throttle_write_iops", "0")); |
Copilot
AI
Jan 28, 2026
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.
Potential uncaught 'java.lang.NumberFormatException'.
| long iops = Long.parseLong(props.getOrDefault("sys/fs/blkio_throttle_write_iops", "0")); | |
| Object iopsObj = props.getOrDefault("sys/fs/blkio_throttle_write_iops", "0"); | |
| long iops = 0L; | |
| try | |
| { | |
| iops = Long.parseLong(String.valueOf(iopsObj)); | |
| } | |
| catch (NumberFormatException ex) | |
| { | |
| LOGGER.warn("Linstor: Invalid QoS IOPS value '{}' for resource {}, treating as unset", | |
| iopsObj, rscName); | |
| } |
Implement DataMotionStrategy for live migration of VMs with volumes on Linstor or other primary storage. Key features: - Support live migration with storage from other primary storages - Preserve DRBD exact-size property during migration
984e3f7 to
95cf17d
Compare
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16585 |
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16593 |
|
@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-15322)
|
Description
This PR allows live migration from any primary storage to Linstor primary storage.
Fixes: #8032
Fixes: #11826
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Live migration from NFS primary storage and also from another Linstor primary storage.
How did you try to break this feature and the system with this change?
Running Linstor integration tests