Koozali.org: home of the SME Server

Persistent iSCSI initiator settings: how?

Offline stabilys

  • *
  • 76
  • +0/-0
  • Ah din't do it!!
    • Stabilys Ltd
Persistent iSCSI initiator settings: how?
« on: June 14, 2016, 01:04:10 AM »
Hi

I have the following set-up:

1. Proxmox KVM virtual host
2. SME-Server 9.1 hosted
3. Synology 4TiB rack mount RAID-10 NAS

I don't want terabyte-plus ibays on the virtual host. So, the SME-Server mounts its /home/e-smith/files from an iSCSI target exported by the Synology (NFS was preferred but recent Microsoft Office file locking does not play well with Samba and NFS mounts and causes very slow Office doc access).

The iSCSI mount works quite well considering the issues with the Synology implementation, and I want to make it persistent across boots. This means I have to specify the target somewhere but I don't know where and there's nothing relevant I can find in the SME-Server documentation nor on searches on the forums, hence this post and request for advice.


Details

1. The mount is specified in /etc/fstab as follows using the iSCSI UUID for reliability and the _netdev specification:

UUID=95499d5e-c5dd-4178-88ff-ead6870f5f16  /home/e-smith/files  ext4 defaults,_netdev   0 0

2. I found a post concerning iSCSI persistence and an earlier version of SME-Server here:

https://forums.contribs.org/index.php/topic,42949.msg203603.html#msg203603

This instructs specifying the target in /etc/iscsi.conf using  DiscoveryAddress=  but that is no longer part of the conf file which is now at /etc/isci/iscsid.conf

The present file says:

 “Note: To set any of these values for a specific node/session run
 the iscsiadm --mode node --op command for the value.”

However I see nothing to specify a target IP.

3. Some Howto for CentOS docs say:

“With the mount option _netdev the script netfs is responsible of the mount to this device. Without this option, Linux will try to mount this device before loading the network support. We have to check that netfs is enabled to run in the default runlevels:

# chkconfig --list netfs
netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off


...but checkconfig does not exist by default on SME-Server (does it? Not on my installs anyway).

Netfs is in /etc/rc5.d at least...

Is there a db setting for this? “config show iscsi”  does nothing and I can see no entry for iscsi in the db. Am I overlooking something obvious?

In /etc/rc.d/init.d there is an iscsi script to mount the target which includes the stanza:

config="/etc/iscsi/initiatorname.iscsi"


But this is the initiator not the target spec.

So to my question: how do I specify the target persistently, and canonically, for SME-Server?


Thanks for any help.

« Last Edit: June 14, 2016, 01:40:19 AM by stabilys »
This, too, will pass ;)

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Persistent iSCSI initiator settings: how?
« Reply #1 on: June 14, 2016, 08:49:53 AM »
My 2c: find a suitable centos6 howto and adapt it to SME
open a NFR in bugzilla with relevant info

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Persistent iSCSI initiator settings: how?
« Reply #2 on: June 14, 2016, 09:38:24 AM »
Hi

I have the following set-up:

1. Proxmox KVM virtual host
2. SME-Server 9.1 hosted
3. Synology 4TiB rack mount RAID-10 NAS

I don't want terabyte-plus ibays on the virtual host. So, the SME-Server mounts its /home/e-smith/files from an iSCSI target exported by the Synology (NFS was preferred but recent Microsoft Office file locking does not play well with Samba and NFS mounts and causes very slow Office doc access).
hence this post and request for advice.
this sounds more like a oplocks problem, that can be dealt at smb.conf level.


The iSCSI mount works quite well considering the issues with the Synology implementation, and I want to make it persistent across boots. This means I have to specify the target somewhere but I don't know where and there's nothing relevant I can find in the SME-Server documentation nor on searches on the forums,


Details

1. The mount is specified in /etc/fstab as follows using the iSCSI UUID for reliability and the _netdev specification:

UUID=95499d5e-c5dd-4178-88ff-ead6870f5f16  /home/e-smith/files  ext4 defaults,_netdev   0 0

I am absolutely not familiar with iSCSI, but if you describe exactly what you do manually after a reboot to make it available, maybe it will help to find a way to make it automatic.


2. I found a post concerning iSCSI persistence and an earlier version of SME-Server here:

https://forums.contribs.org/index.php/topic,42949.msg203603.html#msg203603

This instructs specifying the target in /etc/iscsi.conf using  DiscoveryAddress=  but that is no longer part of the conf file which is now at /etc/isci/iscsid.conf

The present file says:

 “Note: To set any of these values for a specific node/session run
 the iscsiadm --mode node --op command for the value.”

However I see nothing to specify a target IP.

does man iscsid  or man iscsiadm  say more ?

you might want to make sure iscsid is running  by adding a link to it in rc7.d

3. Some Howto for CentOS docs say:

where is this howto ?

“With the mount option _netdev the script netfs is responsible of the mount to this device. Without this option, Linux will try to mount this device before loading the network support. We have to check that netfs is enabled to run in the default runlevels:

# chkconfig --list netfs
netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off


...but checkconfig does not exist by default on SME-Server (does it? Not on my installs anyway).

it is a based package on SME 9
Code: [Select]
# yum info chkconfig
Installed Packages
Name        : chkconfig
Arch        : x86_64
Version     : 1.3.49.5
Release     : 1.el6
Size        : 655 k
Repo        : installed
From repo   : base
Summary     : A system tool for maintaining the /etc/rc*.d hierarchy
License     : GPLv2
Description : Chkconfig is a basic system utility.  It updates and queries
            : runlevel information for system services.  Chkconfig manipulates
            : the numerous symbolic links in /etc/rc.d, to relieve system
            : administrators of some of the drudgery of manually editing the
            : symbolic links.

Netfs is in /etc/rc5.d at least...

however not relevant as SME 9 running in run-level 4 according to the commands you can test (runlevel or who -r), but initialisation use the content of rc7.d.


Is there a db setting for this? “config show iscsi”  does nothing and I can see no entry for iscsi in the db. Am I overlooking something obvious?

In /etc/rc.d/init.d there is an iscsi script to mount the target which includes the stanza:

config="/etc/iscsi/initiatorname.iscsi"


But this is the initiator not the target spec.

So to my question: how do I specify the target persistently, and canonically, for SME-Server?


Thanks for any help.

my final answer would be the same as Stefano, find the centos way, show it there, and maybe we could help to deal with the specificity of SME.

Offline stabilys

  • *
  • 76
  • +0/-0
  • Ah din't do it!!
    • Stabilys Ltd
Re: Persistent iSCSI initiator settings: how?
« Reply #3 on: June 14, 2016, 11:09:54 AM »
Thanks for the replies. I will do some more research then and get back with more details. I may also raise a (documentation) bug as this should be somewhere in the documentation!

MeJ
This, too, will pass ;)

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: Persistent iSCSI initiator settings: how?
« Reply #4 on: June 14, 2016, 12:16:30 PM »
this could be more than a documentation bug IMHO.. this could/should be a feature, hence the request for a NFR ;-)

please be aware that SME doesn't use chkconfig

Offline ldkeen

  • *
  • 405
  • +0/-0
Re: Persistent iSCSI initiator settings: how?
« Reply #5 on: June 27, 2016, 12:40:34 PM »
I have a few notes from an ISCI setup not that long ago that may be helpful which I have included below. I used these notes to mount /home/e-smith/files on a Freenas box and it have no problems with reboots:

yum --enablerepo=epel install iscsi-initiator-utils
cd /etc/rc.d/rc7.d/
ln -s /etc/rc.d/init.d/e-smith-service S38iscsid
ln -s /etc/rc.d/init.d/e-smith-service S39iscsi
ln -s /etc/rc.d/init.d/e-smith-service S40netfs
edit /etc/iscsi/iscsi.conf
# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
node.session.auth.username = your_name
node.session.auth.password = your_pass

# To set a discovery session CHAP username and password for the initiator
# authentication by the target(s), uncomment the following lines:
discovery.sendtargets.auth.username = your_name
discovery.sendtargets.auth.password = your_pass

db configuration set iscsi service status enabled

discover the target:
iscsiadm -m discovery -p 192.168.10.43:3260 -t st

login to the target
iscsiadm -m node -p 192.168.10.43:3260 -T iqn.2015-10.com.domain.ctl:target1 -l
Should see the following:
Logging in to [iface: default, target: iqn.2015-10.com.domain.ctl:target1, portal: 192.168.10.43,3260] (multiple)
Login to [iface: default, target: iqn.2015-10.com.domain.ctl:target1, portal: 192.168.10.43,3260] successful.

ISCSI info only
clear discovered targets if required
iscsiadm -m discovery -p 192.168.9.2:3260 -o delete
logout
iscsiadm -m node -p 192.168.9.2:3260 -T iqn.2011-03.au.com.domain.istgt:target1 -u

Note block device name
#lsscsi
[0:0:0:0]    disk    ATA      WDC WD20EARX-00P 51.0  /dev/sda
[6:0:0:0]    disk    FreeBSD  iSCSI Disk       0123  /dev/sdb

Create Filesystem
mkfs.ext4 /dev/sdb

Grab BlockID to use in fstab
#blkid /dev/sdb
/dev/sdb: UUID="c792f753-0929-44b3-a3f5-35c0540f56e5" TYPE="ext4"

Create mount point
#mkdir /mnt/backup

Edit /etc/fstab and add the following:
UUID=c792f753-0929-44b3-a3f5-35c0540f56e5       /mnt/backup     ext4    _netdev 0 0

Mount the NAS Device
#mount /dev/sdb

Run some tests to check performance:
#cd /mnt/backup
#fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75

test: (g=0): rw=randrw, bs=4K-4K/4K-4K/4K-4K, ioengine=libaio, iodepth=64
fio-2.0.13
Starting 1 process
test: Laying out IO file(s) (1 file(s) / 4096MB)
Jobs: 1 (f=1): [m] [100.0% done] [62052K/19564K/0K /s] [15.6K/4891 /0  iops] [eta 00m:00s]
test: (groupid=0, jobs=1): err= 0: pid=975: Mon Mar  2 21:15:07 2015
  read : io=3072.9MB, bw=58778KB/s, iops=14694 , runt= 53533msec
  write: io=1023.2MB, bw=19572KB/s, iops=4892 , runt= 53533msec
  cpu          : usr=4.97%, sys=25.39%, ctx=389286, majf=0, minf=20
  IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
     issued    : total=r=786644/w=261932/d=0, short=r=0/w=0/d=0

Run status group 0 (all jobs):
   READ: io=3072.9MB, aggrb=58778KB/s, minb=58778KB/s, maxb=58778KB/s, mint=53533msec, maxt=53533msec
  WRITE: io=1023.2MB, aggrb=19571KB/s, minb=19571KB/s, maxb=19571KB/s, mint=53533msec, maxt=53533msec

Disk stats (read/write):
  sdb: ios=773336/259872, merge=10512/1177, ticks=2450177/843295, in_queue=3293027, util=99.90%

Hopefully you may be able to use some tips from the above.
Best Regards
Lloyd
« Last Edit: June 27, 2016, 12:49:59 PM by ldkeen »

Offline stabilys

  • *
  • 76
  • +0/-0
  • Ah din't do it!!
    • Stabilys Ltd
Re: Persistent iSCSI initiator settings: how?
« Reply #6 on: July 07, 2016, 11:38:18 AM »
I have a few notes from an ISCI setup not that long ago that may be helpful which I have included below. I used these notes to mount /home/e-smith/files on a Freenas box and it have no problems with reboots:
...
Hopefully you may be able to use some tips from the above.
Best Regards
Lloyd


Thanks for that - and to all above. I have been very busy with recalcitrant customers but have had to build a new KVM test network on new hardware to see what was happening, now done.

While I was at it I wrote most of an iSCSI howto, lacking only the final answer :)

I will try the above and report back on this and any other findings.

Thanks all.
This, too, will pass ;)

Offline stabilys

  • *
  • 76
  • +0/-0
  • Ah din't do it!!
    • Stabilys Ltd
Re: Persistent iSCSI initiator settings: how?
« Reply #7 on: July 27, 2016, 01:15:10 PM »
Right I give up, I can't get this to stick as persistent. The iSCSI on 9 works perfectly well but I have to reconnect it at each reboot. So I will post a bug, I also found another different bug in iscsi on 8 so will post that too.

Thanks for the input so far.
This, too, will pass ;)

Offline ldkeen

  • *
  • 405
  • +0/-0
Re: Persistent iSCSI initiator settings: how?
« Reply #8 on: July 27, 2016, 01:28:12 PM »
I found some more notes where I'd left off some other settings. Try these and let me know:

db configuration set iscsi service status enabled
db configuration set iscsid service status enabled
db configuration set netfs service status enabled

Regards, Lloyd

Offline stabilys

  • *
  • 76
  • +0/-0
  • Ah din't do it!!
    • Stabilys Ltd
Re: Persistent iSCSI initiator settings: how?
« Reply #9 on: July 27, 2016, 01:29:54 PM »
this sounds more like a oplocks problem, that can be dealt at smb.conf level.


Jean-Philippe (or anyone!),

can you tell me the recommended canonical changes to make to try fixing the oplocks issue (if that's what it is) with SME 9 so I can test if it works for the issue I am seeing with NFS mounted MS Office files opening very slowly?

I've searched the forum and there's lots of references but all the ones I have found are to older versions of SME. Most recent relevant seems to be:

https://forums.contribs.org/index.php/topic,49807.msg249491.html#msg249491

Is it all still the same?

Thanks.
This, too, will pass ;)

Offline stabilys

  • *
  • 76
  • +0/-0
  • Ah din't do it!!
    • Stabilys Ltd
Re: Persistent iSCSI initiator settings: how?
« Reply #10 on: July 27, 2016, 01:30:42 PM »
I found some more notes where I'd left off some other settings. Try these and let me know:

db configuration set iscsi service status enabled
db configuration set iscsid service status enabled
db configuration set netfs service status enabled

Regards, Lloyd

Thanks Lloyd, I will kick the tyres again. But i think I've got those on anyway.
This, too, will pass ;)

Offline ReetP

  • *
  • 3,949
  • +6/-0
Re: Persistent iSCSI initiator settings: how?
« Reply #11 on: July 27, 2016, 02:12:59 PM »
can you tell me the recommended canonical changes to make to try fixing the oplocks issue (if that's what it is) with SME 9 so I can test if it works for the issue I am seeing with NFS mounted MS Office files opening very slowly?

Search the wiki as well, and the bug tracker (look for closed bugs as well)

https://wiki.contribs.org/DB_Variables_Configuration

https://wiki.contribs.org/SharedFolders
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation