scornet256 opened a new issue, #14011:
URL: https://github.com/apache/cloudstack/issues/14011
### problem
`createSnapshot` on any volume backed by a Linstor primary storage pool
fails 100% of the time with: `Failed to create Snapshot due to an internal
error creating Snapshot for volume <volume-uuid>`.
The failure is deterministic and reproducible on every attempt, regardless
of volume, VM, or snapshot name.
First the snapshot is created succesfully on the Linstor backend, but then
the copy to NFS (secundairy storage) fails as CloudStack's KVM agent invokes
`qemu-img convert` against a `/dev/mapper/...` device path that does not match
the path the kernel actually created.
Actual device location:
`/dev/mapper/linstor_pool-lv--thin-cs--12fc4055--3985--4025--8eb5--d6fd53effe37_00000`
Path CloudStack looks for:
`/dev/mapper/linstor_pool-lvm-thin-cs--12fc4055--3985--4025--8eb5--d6fd53effe37_00000_cs--d7aea646--5f40--46a2--b9dc--77e41ea29336`
Notice the missing dashes in the `linstor_pool-lv--thin-cs`-name.
The error logged in `management-server.log`:
```
ERROR [o.a.c.a.c.u.s.CreateSnapshotCmd] Failed to create Snapshot due to an
internal error creating Snapshot for volume
12fc4055-3985-4025-8eb5-d6fd53effe37 java.lang.RuntimeException: Unexpected
exception
at
com.cloud.storage.VolumeApiServiceImpl.takeSnapshotInternal(VolumeApiServiceImpl.java:3999)
at
com.cloud.storage.VolumeApiServiceImpl.takeSnapshot(VolumeApiServiceImpl.java:3910)
...
Caused by: com.cloud.utils.exception.CloudRuntimeException: Exception:
org.apache.cloudstack.utils.qemu.QemuImgException
Message: qemu-img: Could not open
'/dev/mapper/linstor_pool-lvm-thin-cs--12fc4055--3985--4025--8eb5--d6fd53effe37_00000_cs--d7aea646--5f40--46a2--b9dc--77e41ea29336':
Could not open
'/dev/mapper/linstor_pool-lvm-thin-cs--12fc4055--3985--4025--8eb5--d6fd53effe37_00000_cs--d7aea646--5f40--46a2--b9dc--77e41ea29336':
No such file or directory
Stack: org.apache.cloudstack.utils.qemu.QemuImgException: ...
at org.apache.cloudstack.utils.qemu.QemuImg.convert(QemuImg.java:495)
...
at
com.cloud.hypervisor.kvm.resource.wrapper.LinstorBackupSnapshotCommandWrapper.convertImageToQCow2(LinstorBackupSnapshotCommandWrapper.java:99)
at
com.cloud.hypervisor.kvm.resource.wrapper.LinstorBackupSnapshotCommandWrapper.execute(LinstorBackupSnapshotCommandWrapper.java:156)
...
at
org.apache.cloudstack.storage.snapshot.SnapshotServiceImpl.backupSnapshot(SnapshotServiceImpl.java:475)
at
org.apache.cloudstack.storage.snapshot.DefaultSnapshotStrategy.backupSnapshot(DefaultSnapshotStrategy.java:204)
at
com.cloud.storage.snapshot.SnapshotManagerImpl.backupSnapshotToSecondary(SnapshotManagerImpl.java:1787)
at
com.cloud.storage.snapshot.SnapshotManagerImpl.takeSnapshot(SnapshotManagerImpl.java:1660)
...
```
### versions
Apache CloudStack 4.22.1.0
Hypervisor: KVM (AlmaLinux 9.8, kernel 5.14.0-687.20.1.el9_8.x86_64)
Primary storage: Linstor (LVM-thin backend), resource group
`cloudstack-primary`
Underlying LVM volume group name: `linstor_pool-lvm-thin`
### The steps to reproduce the bug
Create disk snapshot on a Linstor volume with NFS as secundairy storage and
observe the error message.
### What to do about it?
Apply LVM's standard dash-doubling escape to the **volume-group name** the
same way it's already correctly applied to the `cs--<uuid>`
logical-volume/snapshot name portion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]