Latest News:
2018-05-15: NAS4Free 11.1.0.4.5565 - released!
We really need "Your" help on NAS4Free https://translations.launchpad.net/nas4 ... s/nas4free translations. Please help today!

Producing and hosting NAS4Free cost money, please consider a donation to our project so we can continue to offer you the best.
We need your support! eg: PAYPAL

can't add/update iSCSI targets

iSCSI over TCP/IP.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
d0hboy
NewUser
NewUser
Posts: 7
Joined: 30 Nov 2012 20:32
Status: Offline

can't add/update iSCSI targets

Post by d0hboy » 13 Dec 2012 17:36

I've been following iscsi guides to present ZFS volumes as iSCSI drives for VMWare ESXi. Basically, I've been following this guide:
http://www.vladan.fr/how-to-configure-f ... t-to-esxi/

I was able to create a few zfs volumes (sparse, if it matters):
- basically used no CHAP authentication because I wanted to keep things simple (lab/home environment)
- created 1 extent and 1 target for each volume.
- when I ADDED any new iscsi extent/target (basically wanting to add a new VM disk), i started getting these errors below. I'll show you the config:

ZFS volumes:

Code: Select all

Pool	Name	Size	Sparse	Description	
pool 	rac1 	10G 	853M 	 	   
pool 	sol1 	20G 	- 	 	   
pool 	ubuntu1 	20G 	14.1G 	 
My Services -> iSCSI -> Targets shows 3 extents that I named after the volumes I created, then created 3 targets that basically were named the same as each extent and/or volume.

Code: Select all

EXTENTS
Extent	
Name	Path	Size	
rac1 	/dev/zvol/pool/rac1 	Auto 	  
sol1 	/dev/zvol/pool/sol1 	Auto 	  
ubuntu1 	/dev/zvol/pool/ubuntu1 	Auto 	  

TARGETS
Target	
Name	Flags	LUNs	PG	IG	AG	
box:rac1  	rw 	 LUN0=/dev/zvol/pool/rac1 1	 1	 none	    <------ MY NEW TARGET
box:sol1  	rw 	 LUN0=/dev/zvol/pool/sol1 1	 1	 none	  
box:ubuntu1  	rw 	 LUN0=/dev/zvol/pool/ubuntu1 1	 1	 none	  
-- when I try applying the new target, the log gives me errors ( diagnostics -> log).
Dec 12 23:40:11 box istgt[91056]: reload configuration #1
Dec 12 23:40:11 box root: iscsi_target service reload
Dec 12 23:40:35 box istgt[91056]: reload configuration #2
Dec 12 23:40:35 box istgt[91056]: istgt_lu.c:2375:istgt_lu_reload_update: ***ERROR*** update active LU1: Name=box:sol1, # of TSIH=1
Dec 12 23:40:35 box istgt[91056]: istgt_lu.c:2375:istgt_lu_reload_update: ***ERROR*** update active LU2: Name=box:ubuntu1, # of TSIH=1
Dec 12 23:40:35 box root: iscsi_target service reload
Dec 12 23:40:35 box istgt[91056]: add LU3: Name=box:ubuntu1
Dec 13 08:10:42 box istgt[91056]: Login(discovery) from iqn.1998-01.com.vmware:esxi-5cd80109 (192.168.1.5) on (192.168.1.11:3260,1), ISID=23d000000, TSIH=3, CID=0, HeaderDigest=off, DataDigest=off
Dec 13 08:10:42 box istgt[91056]: Logout(discovery) from iqn.1998-01.com.vmware:esxi-5cd80109 (192.168.1.5) on (192.168.1.11:3260,1), ISID=23d000000, TSIH=3, CID=0, HeaderDigest=off, DataDigest=off
-- My vmware ESXi client also does NOT show the new iscsi target no matter how many times i refresh.
Image

Note that I'm running an active instance of ubuntu off the ubuntu1 volume, so I wasn't sure if I could be making those changes online or not. I didn't touch it, I was only adding another iscsi target for another VM.
The lines in RED are whenever I tried to APPLY the new iscsi target settings. The lines in BLUE are my vmware esxi trying to rediscover/rescan for any new volumes (there weren't). Are there any command line troubleshooting lines I could use?

User avatar
daoyama
Developer
Developer
Posts: 470
Joined: 25 Aug 2012 09:28
Location: Japan
Status: Offline

Re: can't add/update iSCSI targets

Post by daoyama » 14 Dec 2012 20:05

If you didn't disconnect all iSCSI devices, try to use "Save and Restart" in first page.
NAS4Free WebGUI does not use inserted order of the target.

Daisuke Aoyama
NAS4Free 10.2.0.2.2115 (x64-embedded), 10.2.0.2.2258 (arm), 10.2.0.2.2258(dom0)
GIGABYTE 5YASV-RH, Celeron E3400 (Dual 2.6GHz), ECC 8GB, Intel ET/CT/82566DM (on-board), ZFS mirror (2TBx2)
ASRock E350M1/USB3, 16GB, Realtek 8111E (on-board), ZFS mirror (2TBx2)
MSI MS-9666, Core i7-860(Quad 2.8GHz/HT), 32GB, Mellanox ConnectX-2 EN/Intel 82578DM (on-board), ZFS mirror (3TBx2+L2ARC/ZIL:SSD128GB)
Develop/test environment:
VirtualBox 512MB VM, ESXi 512MB-8GB VM, Raspberry Pi, Pi2, ODROID-C1

d0hboy
NewUser
NewUser
Posts: 7
Joined: 30 Nov 2012 20:32
Status: Offline

Re: can't add/update iSCSI targets

Post by d0hboy » 15 Dec 2012 19:27

Sincere thanks for the response, Daisuke. In a nutshell, my issue was:
When I make an edit on any iSCSI target entry that is alphabetically earlier than a currently-used target (ie. a running VM), then I would see those errors in the log.

ie. iSCSI TARGETS LISTING IN NAS4FREE:

Code: Select all

SOL1 <-- active
UBUNTU1 <-- active
When I try to add another extent+target named LINUX1 and apply changes, it wouldn't work because NAS4free was trying to edit the [LogicalUnit##] entries inside /var/etc/iscsi/istgt.conf, but couldn't.

iSCSI TARGETS LISTING IN NAS4FREE:

Code: Select all

LINUX1
SOL1 <-- active
UBUNTU1 <-- active
.. but ESXi wouldn't see the new target.

I tried the workaround you suggested (iscsi -> settings -> Save and Restart) and it worked: ESXi was now able to rescan for new disks and found it.

My only constructive criticism was that this behaviour wasn't exactly user-intuitive. The steps required in this case were then:
1. create a new ZFS volume
2. apply changes
3. create a new iscsi extent using the ZFS volume
4. create a new iscsi target using the iscsi extent
5. Apply changes
6. iSCSI 'Save and Restart' <-- missing step! =]

May I suggest after targets get added to make the suggestion or prompt to 'save and restart' iSCSI? Or, I guess I'd like that put somewhere in the wiki. I'd be happy to help if you need -- best of luck, thanks again!

BTW for anybody else, I'm just passing along any debug-type information that I'm finding out along the way, since none of the forum/net searches came up with anything NAS4free-specific.

Configuration
/var/etc/iscsi/istgt.conf

The Program Binary:
/usr/local/bin/istgt

How to Start iSCSI Daemon:
istgt -c /var/etc/iscsi/istgt.conf start

How to Restart iSCSI Daemon (after any config changes):
istgt -c /var/etc/iscsi/istgt.conf restart

User avatar
daoyama
Developer
Developer
Posts: 470
Joined: 25 Aug 2012 09:28
Location: Japan
Status: Offline

Re: can't add/update iSCSI targets

Post by daoyama » 15 Dec 2012 20:18

d0hboy wrote: 6. iSCSI 'Save and Restart' <-- missing step! =]

May I suggest after targets get added to make the suggestion or prompt to 'save and restart' iSCSI? Or, I guess I'd like that put somewhere in the wiki. I'd be happy to help if you need -- best of luck, thanks again!
Currently, it assumes alphabet order (default disk0 -> disk1 -> disk2, ...)
In this case, you don't need "Restart".

Daisuke Aoyama
NAS4Free 10.2.0.2.2115 (x64-embedded), 10.2.0.2.2258 (arm), 10.2.0.2.2258(dom0)
GIGABYTE 5YASV-RH, Celeron E3400 (Dual 2.6GHz), ECC 8GB, Intel ET/CT/82566DM (on-board), ZFS mirror (2TBx2)
ASRock E350M1/USB3, 16GB, Realtek 8111E (on-board), ZFS mirror (2TBx2)
MSI MS-9666, Core i7-860(Quad 2.8GHz/HT), 32GB, Mellanox ConnectX-2 EN/Intel 82578DM (on-board), ZFS mirror (3TBx2+L2ARC/ZIL:SSD128GB)
Develop/test environment:
VirtualBox 512MB VM, ESXi 512MB-8GB VM, Raspberry Pi, Pi2, ODROID-C1

ajm83
NewUser
NewUser
Posts: 7
Joined: 10 Jan 2013 10:18
Status: Offline

Re: can't add/update iSCSI targets

Post by ajm83 » 15 Jun 2016 10:34

d0hboy wrote:Sincere thanks for the response, Daisuke. In a nutshell, my issue was:
When I make an edit on any iSCSI target entry that is alphabetically earlier than a currently-used target (ie. a running VM), then I would see those errors in the log.

ie. iSCSI TARGETS LISTING IN NAS4FREE:

Code: Select all

SOL1 <-- active
UBUNTU1 <-- active
When I try to add another extent+target named LINUX1 and apply changes, it wouldn't work because NAS4free was trying to edit the [LogicalUnit##] entries inside /var/etc/iscsi/istgt.conf, but couldn't.

iSCSI TARGETS LISTING IN NAS4FREE:

Code: Select all

LINUX1
SOL1 <-- active
UBUNTU1 <-- active
.. but ESXi wouldn't see the new target.

I tried the workaround you suggested (iscsi -> settings -> Save and Restart) and it worked: ESXi was now able to rescan for new disks and found it.

My only constructive criticism was that this behaviour wasn't exactly user-intuitive. The steps required in this case were then:
1. create a new ZFS volume
2. apply changes
3. create a new iscsi extent using the ZFS volume
4. create a new iscsi target using the iscsi extent
5. Apply changes
6. iSCSI 'Save and Restart' <-- missing step! =]

May I suggest after targets get added to make the suggestion or prompt to 'save and restart' iSCSI? Or, I guess I'd like that put somewhere in the wiki. I'd be happy to help if you need -- best of luck, thanks again!

BTW for anybody else, I'm just passing along any debug-type information that I'm finding out along the way, since none of the forum/net searches came up with anything NAS4free-specific.

Configuration
/var/etc/iscsi/istgt.conf

The Program Binary:
/usr/local/bin/istgt

How to Start iSCSI Daemon:
istgt -c /var/etc/iscsi/istgt.conf start

How to Restart iSCSI Daemon (after any config changes):
istgt -c /var/etc/iscsi/istgt.conf restart
Thanks d0hboy! I'm not in a position to reboot our filer at the moment so this has been a life saver. Simply renaming the new target from a123 to z123 (i.e. after the existing targets) meant the reload error disappeared and I was able to view the target in esxi/Windows.
i5 32GB RAM
6 x WD Red 3TB
1 x 128GB SSD L2ARC
http://www.webrecs.net

Post Reply

Return to “iSCSI (Internet Small Computer Systems Interface)”