I want to use linstor to create some resources manually (such as the system disk of a virtual machine, which will be generated through zfs clone), and then mount it to other devices via iscsi.
The first step is now available. Linstor supports this method to create cloning disks, but how to create the corresponding iscsi through linstor-gateway
That was never really a design goal of LINSTOR Gateway. LINSTOR Gateway was developed primarily for use as the backend for our GUI appliance product LINSTOR VSAN. Now, that doesn’t mean that LINSTOR Gateway doesn’t have uses outside of VSAN. We have written some blogs demonstrating how to use it outside of the appliance.
LINSTOR Gateway was designed to create and delete resources for use with iSCSI or NFS. There is no real good way to use it with an already created resource. The best I can really think of would be to use LINSTOR Gateway to create a new resource and iSCSI target as per design. This will create a new reactor promoter plugin configuration in /etc/drbd-reactor.d/
You could probably then copy that config and edit/modify it to use an already existing resource.