Cannot map LUN to iscsi target

iSCSI related applications
Post Reply
trinityanderson
Starting out
Posts: 12
Joined: Sat Apr 02, 2022 12:54 am

Cannot map LUN to iscsi target

Post by trinityanderson »

I was working on LAG my 10G ports on this TS-h1283XU-rp and after disabling my firewall, I noticed my LUNs were not visible in the windows initiator. I checked the target to ensure it was listening on the new lag ports and it was. I then unmapped the two LUNs currently attached to this target, one 8TB and other 55TB. I was able to remap the 8TB however the 55TB errored out.

The error message in the gui: iSCSI & Fibre Channel - An unknown error occured. Prior to this, the 8TB LUN was visible in windows but the lager 55TB wasn't.

I have tried creating a new iscsi target without any success. I AM able to add the LUN to a fibre channel although I'm not using this nor do I have any FC hardware.

From the /var/log/hero_iscsi_scst.log file:

2022-04-01 10:59:27 [10996 fc_target.cgi ] [fcGroup_cgi_get_initiator] Enter.
2022-04-01 10:59:32 [11784 iscsi_target_se] (TargetAddLun_class.c) enter func(addTargetLun_parseParams)
2022-04-01 10:59:32 [11784 iscsi_target_se] (TargetAddLun_class.c) exit func(addTargetLun_parseParams), ret(0)
2022-04-01 10:59:32 [11784 iscsi_target_se] (TargetAddLun_class.c) enter func(addTargetLun_checkParams)
2022-04-01 10:59:32 [11784 iscsi_target_se] (TargetAddLun_class.c) exit func(addTargetLun_checkParams), ret(0)
2022-04-01 10:59:32 [11784 iscsi_target_se] [iscsi_target_conf_get_free_target_lun_id] free bitmap id(2)
2022-04-01 10:59:32 [11784 iscsi_target_se] enter func(addTargetLunWithoutLog)
2022-04-01 10:59:32 [11784 iscsi_target_se] [scstcli_run_cmd_v1] perform cmd:/sbin/iscsiadmin get_target, ret (0), output: skip print output
2022-04-01 10:59:32 [11784 iscsi_target_se] [scstcli_run_cmd_v1] perform cmd:/sbin/scstadm get_lun -d iscsi -t iqn.2004-04.com.qnap:ts-h1283xu-rp:iscsi.qnapst.53be47, ret (0), output: lun = 1, Device = NG_EXPANSION, readonly = no
2022-04-01 10:59:32 [11784 iscsi_target_se] [scstcli_run_cmd_v1] perform cmd:/sbin/scstadm add_lun -t iqn.2004-04.com.qnap:ts-h1283xu-rp:iscsi.qnapst.53be47 -l 2 -D 'QNAPST' -e 0 -d iscsi , ret (7), output: Add lun 2 fail, res = 0x1050107, Device doesn't exist
2022-04-01 10:59:32 [11784 iscsi_target_se] [add_lun_to_target] ret (-5)
2022-04-01 10:59:32 [11784 iscsi_target_se] [target_add_lun] ret (-5)
2022-04-01 10:59:32 [11784 iscsi_target_se] exit func(addTargetLunWithoutLog), ret(-5)
2022-04-01 10:59:32 [11784 iscsi_target_se] [iscsi_target_conf_reset_target_lun_id] reset target-lun id(2)
2022-04-01 10:59:32 [11784 iscsi_target_se] [iscsi_target_conf_reset_target_lun_id] new (after revert) bitmap id(2)
2022-04-01 10:59:33 [12875 iscsi_portal_se] [scstcli_run_cmd_v1] perform cmd:/sbin/iscsiadmin get_session iscsi iqn.2004-04.com.qnap:ts-h1283xu-rp:iscsi.qnapst.53be47, ret (0), output: skip print output
2022-04-01 10:59:54 [22252 iscsi_portal_se] [scstcli_run_cmd_v1] perform cmd:/sbin/iscsiadmin get_session iscsi iqn.2004-04.com.qnap:ts-h1283xu-rp:iscsi.qnapst.53be47, ret (0), output: skip print output
2022-04-01 10:59:57 [22887 fc_target.cgi ] [fcGroup_cgi_get_initiator] Enter.
2022-04-01 11:00:27 [30312 fc_target.cgi ] [fcGroup_cgi_get_initiator] Enter.
2022-04-01 11:00:54 [ 609 iscsi_portal_se] [scstcli_run_cmd_v1] perform cmd:/sbin/iscsiadmin get_session iscsi iqn.2004-04.com.qnap:ts-h1283xu-rp:iscsi.qnapst.53be47, ret (0), output: skip print output
2022-04-01 11:00:57 [ 1288 fc_target.cgi ] [fcGroup_cgi_get_initiator] Enter.


I've generated a support request and am waiting for a response but as this is highly impacting our business, I'm reaching out to this community to help figure out what is going on.
trinityanderson
Starting out
Posts: 12
Joined: Sat Apr 02, 2022 12:54 am

Re: Cannot map LUN to iscsi target

Post by trinityanderson »

The 55TB lun is thick, the 8TB is thin. The pool is 67.75TB
trinityanderson
Starting out
Posts: 12
Joined: Sat Apr 02, 2022 12:54 am

Re: Cannot map LUN to iscsi target

Post by trinityanderson »

I just tried to resize the LUN and same "device doesn't exist" error.

2022-04-01 11:22:21 [29231 iscsi_lun_setti] enter func(lunEdit_edit_lun)
2022-04-01 11:22:22 [29231 iscsi_lun_setti] [check_valid_max_size] pool id:2, pool name:zpool2, total:74491912781824, used:66000217702464, free:6256937695906, alloc:66000217702464
2022-04-01 11:22:22 [29231 iscsi_lun_setti] [dev_edit_size] new_dev_size (60582661193728 bytes)
2022-04-01 11:22:24 [29231 iscsi_lun_setti] [dev_edit_size] done to edit dev size
2022-04-01 11:22:24 [29231 iscsi_lun_setti] [scstcli_run_cmd_v1] perform cmd:/sbin/scsidevadm set_dev_attr -n 'QNAPST' -h vdisk_blockio -r , ret (10), output: scsidev_do_set entered
ERROR:Set device infomation fail, res = 0x302010a, Device doesn't exist
2022-04-01 11:22:24 [29231 iscsi_lun_setti] [edit_lun_size] fail to rescan lun (alias: QNAPST, real: QNAPST)
2022-04-01 11:22:24 [29231 iscsi_lun_setti] [edit_lun_size] fail to edit lun size
2022-04-01 11:22:24 [29231 iscsi_lun_setti] exit func(lunEdit_edit_lun), ret(-5)
2022-04-01 11:22:24 [29231 iscsi_lun_setti] (LunOp.c) exit func (main_edit_lun), ret (-5)
2022-04-01 11:22:33 [ 1590 fc_target.cgi ] [fcGroup_cgi_get_initiator] Enter.
trinityanderson
Starting out
Posts: 12
Joined: Sat Apr 02, 2022 12:54 am

Re: Cannot map LUN to iscsi target

Post by trinityanderson »

[/var/log] # qcli_storage
Enclosure Port Sys_Name Size Type VDEV RAID_Type Group Pool SharedFolderName
NAS_HOST 1 /dev/sda 931.51 GB data vdev_1 RAID 1 1 1 Web,Public,Multimedia
NAS_HOST 2 /dev/sdb 931.51 GB data vdev_1 RAID 1 1 1 Web,Public,Multimedia
NAS_HOST 3 /dev/sdc 9.10 TB data vdev_8 RAID 5/50 8 2 QNAPST,NG_EXPANSION
NAS_HOST 4 /dev/sdd 9.10 TB data vdev_8 RAID 5/50 8 2 QNAPST,NG_EXPANSION
NAS_HOST 5 /dev/sdf 9.10 TB data vdev_8 RAID 5/50 8 2 QNAPST,NG_EXPANSION
NAS_HOST 6 /dev/sde 9.10 TB data vdev_8 RAID 5/50 8 2 QNAPST,NG_EXPANSION
NAS_HOST 7 /dev/sdj 10.91 TB data vdev_2 RAID 5/50 2 2 QNAPST,NG_EXPANSION
NAS_HOST 8 /dev/sdi 10.91 TB data vdev_2 RAID 5/50 2 2 QNAPST,NG_EXPANSION
NAS_HOST 9 /dev/sdh 10.91 TB data vdev_2 RAID 5/50 2 2 QNAPST,NG_EXPANSION
NAS_HOST 10 /dev/sdg 10.91 TB data vdev_2 RAID 5/50 2 2 QNAPST,NG_EXPANSION
NAS_HOST 11 /dev/sdl 16.37 TB data vdev_9 RAID 0 9 3 --
NAS_HOST 12 /dev/sdk 10.91 TB data vdev_2 RAID 5/50 2 2 QNAPST,NG_EXPANSION
NAS_HOST P4-1 /dev/nvme0n1 931.51 GB cache vdev_3 RAID 1 3 256 --
NAS_HOST P4-3 /dev/nvme1n1 931.51 GB cache vdev_3 RAID 1 3 256 --
trinityanderson
Starting out
Posts: 12
Joined: Sat Apr 02, 2022 12:54 am

Re: Cannot map LUN to iscsi target

Post by trinityanderson »

For posterity and in case this will help someone in the future, QNAP support got this resolved for me within 5 minutes of them engaging a remote session. The commands they issued from an ssh session were:

[~]scsidevadm list device
device name = NG_EXPANSION, handler = vdisk_blockio, filename = /dev/zvol/zpool2/zfs277, NAA = 6e843b66334326239...., blocksize = 512, read_on...
[~]scsidevadm add_device -n QNAPST -h vdisk_blockio /dev/zvol/zpool2/zfs274 -s 60473139527680 -p 0
zvol_guid -3611375017370447594
Add device success
[~] scsidevadm get_dev_attr -n QNAPST -h vdisk_blockio
Attribute Value
==========================
blocksize = 512
device_name = QNAPST
filename = /dev/zvol/zpool2/zfs274
handler = vdisk_blockio
nv_cache = 0
o_direct = 0
read_only = 0
removable = 0
resync_size = 0
rotational = 1
size_mb = 57778176

and a bunch of other stats. Once applied, the LUN could now be mapped to a SCSI target. I'd created a new one and kept it offline however after mapping then enabling the lun, it came up without issue.

Thanks Qnap support.
trinityanderson
Starting out
Posts: 12
Joined: Sat Apr 02, 2022 12:54 am

Re: Cannot map LUN to iscsi target

Post by trinityanderson »

Correction and clarification on the command below. The number after -s refers to the size of the device. To find this, you can generate a diagnostic file (typically sent to QNAP support) and in that compressed file is an HTML file that details all the recent activity on the QNAP. Mine showed the LUN increased size since the command below was last issued. Additionally, the command below misses the " -f " flag before the filename path. The command should be:

# scsidevadm add_device -n QNAPST -h vdisk_blockio -f /dev/zvol/zpool2/zfs274 -s 60584808677376 -p 0
zvol_guid -3611375017370447594
Add device success

Your LUN name will differ as well as the file path and size. I'm placing this here for posterity should I need to go back in the event of another disconnect.
trinityanderson
Starting out
Posts: 12
Joined: Sat Apr 02, 2022 12:54 am

Re: Cannot map LUN to iscsi target

Post by trinityanderson »

Also, ssh session must be performed with the default admin account
Post Reply

Return to “iSCSI – Target & Virtual Disk”