LINBIT / linstor-gateway

Manages Highly-Available iSCSI targets, NVMe-oF targets, and NFS exports via LINSTOR
GNU General Public License v3.0
28 stars 6 forks source link

iscsi add-volume creates incorrect size. #10

Closed dmerillat closed 2 years ago

dmerillat commented 2 years ago

iscsi add-volume always(?) creates a volume of 57344k.

$ linstor-gateway --version
linstor-gateway version 0.12.1
$ linstor-gateway iscsi create iqn.2019-08.com.test:test 192.168.0.92/24 1G --username=test --password=test12345678 --resource-group=iscsi_group
Created iSCSI target 'iqn.2019-08.com.test:test'
$ linstor-gateway iscsi stop iqn.2019-08.com.test:test
Stopped target "iqn.2019-08.com.test:test"
$ linstor-gateway iscsi add-volume iqn.2019-08.com.test:test 2 2G
Added volume to "iqn.2019-08.com.test:test"
$ linstor-gateway iscsi add-volume iqn.2019-08.com.test:test 2 2G
Error: failed to add volume to resource: existing volume has differing size 57344 != 2097152

skipping a lun (create, stop, add-volume 3) returns an error but does create the correct size. creating 2 then 3 produces two 57meg luns. The initial volume is sized mostly-correctly, see below.

Minor related issue, even the "correct" partition sizes are not quite right:

$ linstor-gateway iscsi add-volume iqn.2019-08.com.test:test 3 2G
Error: failed to add volume to resource: existing volume has differing size 2093056 != 2097152
dmerillat commented 2 years ago

I verified that the volumes are in fact 57 meg by accessing them: sd 10:0:0:2: [sdd] 114696 512-byte logical blocks: (58.7 MB/56.0 MiB)

chrboe commented 2 years ago

Thanks for the report, this is actually a pretty obscure bug in golinstor. Will be fixed in the next release.

chrboe commented 2 years ago

Should be fixed in 47c3d1e7fda9b570df9d4e70526389f7779264ec, thanks again and feel free to reopen if anything is still unclear.