ZFS over iSCSI disk creation error

burning daylight

Renowned Member
Dec 18, 2014
17
0
66
I'm trying to setup a ZFS over iSCSI storage in Proxmox 4.4. I have an ubuntu 16.04 ZFS storage machine and set it up according to the wiki page:
Code:
root@warehouse:~# cat /etc/ssh/sshd_config
UseDNS no
...
# GSSAPI options
GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
...
Code:
root@warehouse:~# cat /proc/net/iet/volume   
tid:1 name:iqn.2017-01.com.diffusehub:warehouse-iscsivol
root@warehouse:~# cat /etc/iet/ietd.conf     


Target iqn.2017-01.com.diffusehub:warehouse-iscsivol
I attach the storage in the Proxmox GUI and it seems to work:
Code:
root@central:~# cat /etc/pve/storage.cfg
...
zfs: iSCSI_warehouse
        blocksize 4k
        iscsiprovider iet
        portal 192.168.10.11
        pool warehouse
        target iqn.2017-01.com.example:warehouse-iscsivol
        content images
        sparse 1
        nodes central
        nowritecache 1
However, when I try to use the storage and create a disk and attach it to a VM, I get an error:
Code:
No such file or directory. at /usr/share/perl5/PVE/Storage/LunCmd/Iet.pm line 376. (500)
New Zvol is created, and appears in the "content" panel of the Proxmox GUI, but does not get attached to the VM.
Am I missing something?
 
creating the LUN failed, so you need to find out why..
 
the only thing I found in the logs is this:
Code:
root@warehouse:/var/log$ tail kern.log
Jan  3 11:08:47 warehouse kernel: [53789.185299] iscsi_trgt: blockio_open_path(161) Can't open device /dev/warehouse/vm-101-disk-2, error -2
Jan  3 11:08:47 warehouse kernel: [53789.185347] iscsi_trgt: blockio_attach(288) Error attaching Lun 0 to Target iqn.2017-01.com.diffusehub:warehouse-iscsivol
I guess the key are the commands Proxmox executes via ssh when the disk is created. How can I debug that?
 
what is the device path of the created zvol? I think there is a "zvol/" missing ;)
 
Code:
root@warehouse:/var/log$ ls -l /dev/zvol/warehouse/
total 0
lrwxrwxrwx 1 root root 10 Jan  3 11:06 vm-101-disk-1 -> ../../zd48
lrwxrwxrwx 1 root root 10 Jan  3 11:08 vm-101-disk-2 -> ../../zd64
lrwxrwxrwx 1 root root  9 Jan  2 21:09 vm-102-disk-1 -> ../../zd0
lrwxrwxrwx 1 root root 10 Jan  2 21:10 vm-102-disk-2 -> ../../zd16
lrwxrwxrwx 1 root root 10 Jan  2 23:06 vm-102-disk-3 -> ../../zd32
What do you mean missing? It is there...
 
here it tries to access the device without the "zvol/" part, which does not exist, so the LUN creation fails:

Jan 3 11:08:47 warehouse kernel: [53789.185299] iscsi_trgt: blockio_open_path(161) Can't open device /dev/warehouse/vm-101-disk-2, error -2
 
Oh, did not notice. I overcame this by symlinking the pool:
Code:
ln -s /dev/zvol/warehouse/ /dev/warehouse
And it works! Thank you!
However, if I try to remove a created disk - it removes the disk from the VM configuration, but zvol and the Lun are not removed. I have to clean them up manually.
Also if i remove a VM which has a disc on the zfs-iSCSI storage, i get an error:
Code:
TASK ERROR: Could not find lu_name for zvol vm-102-disk-1 at /usr/share/perl5/PVE/Storage/ZFSPlugin.pm line 105.
Also, if I try starting a VM, I get an error:
Code:
TASK ERROR: Could not find lu_name for zvol vm-102-disk-1 at /usr/share/perl5/PVE/Storage/ZFSPlugin.pm line 105.
Code:
root@warehouse:~# cat /proc/net/iet/volume
tid:1 name:iqn.2017-01.com.diffusehub:warehouse-iscsivol
        lun:1 state:0 iotype:blockio iomode:wt blocks:67108864 blocksize:512 path:/dev/warehouse/vm-102-disk-1

root@warehouse:~# ls /dev/warehouse/ -l
total 0
lrwxrwxrwx 1 root root 9 Jan  3 14:57 vm-102-disk-1 -> ../../zd0
 
Last edited: