I have a strange problem and i’ll appreciate guidance. I have an XCP-ng 8.2 host and a Debian 10 iscsi target. On the target I tried all combinations of tgt, LIO, LVM and zfs, and could make each work perfectly fine until a reboot of the target, at which point the host lost the SR, and the only solution was to start from scratch.
What I did:
- On the target, created a VG named vg01, and an LV named lv01.
- Setup the tgt configuration file with backing-store /dev/mapper/vg01-lv01
- Restarted the tgt daemon
- On the host, added an iscsi SR. It found the target immediately, attached it, and formatted it.
- On the SR, created 3 disks
At this point, everything worked fine. On the target, I could see for each disk I created on the SR the following logical volumes under /dev/mapper
I could attach the disks to a VM, format them and use them inside the VM, no problems.
Then I rebooted the target. The SR disconnected from the target, as expected, and when I tried to reattach it, I got a backend error. From this point it was impossible to reattach the SR and recover the disks on it. The only solution was to forget the SR, delete all the VG_XenStorage logical volumes, restart tgt, and recreate the SR, which worked at this point. It seems that the logical volumes created by the host are screwing things up. I got the exact same problem with LIO, and zfs.