Linstor: Fix migrate primary storage#9528
Conversation
|
If it helps, I can make the:
commits into its own PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #9528 +/- ##
===========================================
Coverage 15.08% 15.08%
- Complexity 11180 11185 +5
===========================================
Files 5406 5406
Lines 472915 472942 +27
Branches 61731 58606 -3125
===========================================
+ Hits 71326 71350 +24
- Misses 393647 393648 +1
- Partials 7942 7944 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
1 similar comment
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Always use RAW as copy sourceFormat for Linstor devices, as all images are stored as RAW on Linstor, but we have to pretend to use qcow2 to be able to use qcow2 as snapshot format. Also use .getPath() for resource names, as they are altered after a primary storage migration.
b60e159 to
064a8d7
Compare
DaanHoogland
left a comment
There was a problem hiding this comment.
clgtm, mostly Linstore code but might have some effect on other implementations!
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMPhysicalDisk.java
Outdated
Show resolved
Hide resolved
064a8d7 to
ebcf66a
Compare
| private KVMStoragePool pool; | ||
| private final String name; | ||
| private final KVMStoragePool pool; | ||
| private String dispName; |
There was a problem hiding this comment.
| private String dispName; | |
| private String displayName; |
| /* Linstor images are always stored as RAW, but Linstor uses qcow2 in DB, | ||
| to support snapshots(backuped) as qcow2 files. */ | ||
| PhysicalDiskFormat sourceFormat = srcPool.getType() != StoragePoolType.Linstor ? | ||
| disk.getFormat() : PhysicalDiskFormat.RAW; |
There was a problem hiding this comment.
can set format RAW in KVMPhysicalDisk for Linstor disks?
There was a problem hiding this comment.
You mean, setting it in KVMPhysicalDisk.setFormat() or KVMPhysicalDisk.getFormat()?
There was a problem hiding this comment.
@rp- sorry, missed this. if the format is set while creating the linstor disk (KVMPhysicalDisk), you get it with disk.getFormat()
There was a problem hiding this comment.
check in LinstorStorageAdaptor.java - getPhysicalDisk() & createPhysicalDisk() - where KVMPhysicalDisk obj is created and RAW format is set (so, I think, no need to set the format RAW with StoragePoolType.Linstor pool type check again).
There was a problem hiding this comment.
Sadly it is, because the LinstorStorageAdaptor isn't used for migrating from another PrimaryStorage.
And so it will use the format sent from the management server and this doesn't match what is expected from the qemu-img convert command.
There was a problem hiding this comment.
If you want I can create the migration error and show you the exception/error log.
There was a problem hiding this comment.
ok, got it. maybe, you can revisit that later.
|
@blueorangutan package |
|
@rohityadavcloud 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 10928 |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10993 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
@slavkap @rg9975 @harikrishna-patnala can you review? |
|
[SF] Trillian test result (tid-11375)
|
slavkap
left a comment
There was a problem hiding this comment.
The code LGTM, but I haven't tested it
Are you alright with merging as is @slavkap ? |
|
@DaanHoogland, yes all looks good |
Description
This PR fixes migrate primary storage for Linstor primary storage.
Always use RAW as copy sourceFormat for Linstor devices, as all images are stored as RAW on Linstor, but we have to pretend to use qcow2 to be able to use qcow2 as snapshot format. Also use .getPath() for resource names, as they are altered after a primary storage migration.
Fixes: #9176 and #9522
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Linstor Cluster with migrating VM volumes between Linstor and NFS primary storage
How did you try to break this feature and the system with this change?
Migrated from Linstor to NFS and back to NFS, than tried various volume actions like snaphots and revert.