[SOLVED] how to install iscsi client properly (mga6)?

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] how to install iscsi client properly (mga6)?

Postby magfan » Dec 6th, '17, 11:08

I have installed open-iscsi in mga6 but already the first attempt to discover iscsi targets fails:

Code: Select all
iscsiadm -m discovery -t st -p 192.168.10.10
sh: /etc/rc.d/init.d/iscsid: Datei oder Verzeichnis nicht gefunden
iscsiadm: can not connect to iSCSI daemon (111)!
sh: /etc/rc.d/init.d/iscsid: Datei oder Verzeichnis nicht gefunden
iscsiadm: can not connect to iSCSI daemon (111)!
iscsiadm: Cannot perform discovery. Initiatorname required.
iscsiadm: Could not perform SendTargets discovery: could not connect to iscsid


The program "iscsid" cannot be found. What do I have to change to make this running?
Last edited by magfan on Dec 12th, '17, 14:19, edited 1 time in total.
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: how to install iscsi client properly (mga6)?

Postby wintpe » Dec 6th, '17, 11:26

I always use the following and it appears to work ok

iscsiadm --mode discoverydb --type sendtargets --portal 192.168.1.60 --discover

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: how to install iscsi client properly (mga6)?

Postby magfan » Dec 6th, '17, 12:56

Thank you, it works. I can even login a target. But I have to do this manually after every reboot. How can I change this?
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: how to install iscsi client properly (mga6)?

Postby wintpe » Dec 6th, '17, 14:38

http://www.linuxpc.co.uk/index.php?opti ... &Itemid=54

thats for systems pre systemd, but it should not be too hard to make the conversion

hope that helps

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: how to install iscsi client properly (mga6)?

Postby jiml8 » Dec 6th, '17, 18:19

I would think that
Code: Select all
systemctl enable open-iscsi.service

would do it.

I have iscsi running here, with a part of my NAS being the target, and it works fine with systemctl.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: how to install iscsi client properly (mga6)?

Postby magfan » Dec 7th, '17, 08:39

The open-iscsi.service is running, but I have to discover the targets every time after reboot. Once iscsiadm discovered them I can manually login. Should there be some configuration files in "/etc/iscsi/nodes" ? And if so, how could I create them?

Code: Select all
# tree /etc/iscsi/
/etc/iscsi/
├── ifaces
│   └── iface.example
├── initiatorname.iscsi
├── iscsid.conf
├── nodes
└── send_targets

3 directories, 3 files
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: how to install iscsi client properly (mga6)?

Postby wintpe » Dec 7th, '17, 14:11

once you login it is supposed to become persistent

systemctl status open-iscsi.service

what errors are you getting from that re your login status.

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: how to install iscsi client properly (mga6)?

Postby magfan » Dec 7th, '17, 15:58

Code: Select all
# systemctl status open-iscsi.service
● open-iscsi.service - Open iSCSI Daemon
   Loaded: loaded (/usr/lib/systemd/system/open-iscsi.service; enabled; vendor preset: enabled)
   Active: active (running) since Do 2017-12-07 11:08:30 CET; 3h 38min ago
  Process: 2873 ExecStart=/sbin/iscsid (code=exited, status=0/SUCCESS)
  Process: 2829 ExecStartPre=/usr/sbin/modprobe -q iscsi_tcp (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/open-iscsi.service
           ├─2875 /sbin/iscsid
           └─2876 /sbin/iscsid

Dez 07 11:08:30 thalamus_nfs systemd[1]: Starting Open iSCSI Daemon...
Dez 07 11:08:30 thalamus_nfs iscsid[2873]: iSCSI logger with pid=2875 started!
Dez 07 11:08:30 thalamus_nfs systemd[1]: Started Open iSCSI Daemon.
Dez 07 11:08:31 thalamus_nfs iscsid[2875]: transport class version 2.0-870. iscsid version 2.0-872
Dez 07 11:08:31 thalamus_nfs iscsid[2875]: iSCSI daemon with pid=2876 started!


I just found an article on the redhat customer knowledgebase which describes exactly my problem (iscsi, lvm, mount at boot). But without a subscription I cannot read it and I do not find another solution.

https://access.redhat.com/solutions/3889
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: how to install iscsi client properly (mga6)?

Postby doktor5000 » Dec 7th, '17, 23:50

magfan wrote:But without a subscription I cannot read it and I do not find another solution.

It only mentions to mark those ISCSI target in fstab with the _netdev option:

Resolution
To mount iSCSI LUNs in /etc/fstab, add _netdev to the mount options near the end of the line. Properly formatted /etc/fstab lines for two different iSCSI mount points are shown below:
Raw
#device mount point FS Options Backup fsck
LABEL=data1 /mnt/data1 ext3 _netdev 0 0
LABEL=data2 /mnt/data2 ext3 _netdev 0 0
Note: If the file system being mounted exists directly on the device (i.e., does not use LVM), then the use of labels as in the example above is recommended. Device ordering may change each time the iSCSI devices are presented, and either LVM or labels can ensure that the correct device is mounted.
The netfs service also needs to be enabled at boot time, as it is responsible for mounting devices that use _netdev

Not sure about netfs service, if that is still required with systemd, but you can check the status of that, it doesn't hurt.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18054
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: how to install iscsi client properly (mga6)?

Postby jiml8 » Dec 8th, '17, 04:04

doktor5000 wrote:
magfan wrote:But without a subscription I cannot read it and I do not find another solution.

It only mentions to mark those ISCSI target in fstab with the _netdev option:


Yes. Here is my fstab entry:

Code: Select all
# Entry for NAS iscsi extent :
LABEL=NAS1 /mnt/NAS ext4 relatime,noauto,nofail,_netdev,acl 1 2
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: how to install iscsi client properly (mga6)?

Postby magfan » Dec 11th, '17, 10:23

Here is the entry in my /etc/fstab:

Code: Select all
/dev/vg_icebox/lv_imagepool    /imagepool      xfs     _netdev,rw,inode64,logbufs=8    1       2


The open-iscsi.service starts but that is all. It does not login into any portal and therefore it does not provide any device like /dev/sdb. This is why lvm cannot detect and activate any VG / LV and finally the desired lvm partition cannot be mounted. I guess there is a problem with my iscsi configuration.

Code: Select all
# iscsiadm -m discoverydb -t st -p 192.168.10.10:3260 -P 1 --discover
Target: iqn.2010-08.eu.n-tec:icebox-rix6r-000905600:dev0.ctr1
        Portal: 192.168.10.10:3260,0
                Iface Name: default
        Portal: 192.168.20.10:3260,0
                Iface Name: default
        Portal: 192.168.3.1:3260,1
                Iface Name: default
        Portal: 192.168.4.1:3260,1
                Iface Name: default


I want to use only Portal: 192.168.10.10:3260,0. How can I do this?
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: how to install iscsi client properly (mga6)?

Postby magfan » Dec 12th, '17, 14:18

It seems to me I could solve the problem with a new systemd service (iscsi-login.service) which performs the missing tasks while booting:

Code: Select all
[Unit]
Description=Login into ISCSI portal
Requires=network.target open-iscsi.service
After=network.target open-iscsi.service

[Service]
Type=oneshot
RemainAfterExit=yes

ExecStart=/usr/sbin/iscsiadm --mode node --targetname iqn.2010-08.eu.n-tec:icebox-rix6r-000905600:dev0.ctr1 --portal 192.168.10.10:3260 --login
ExecStartPost=/usr/sbin/vgchange -a y

ExecStop=/usr/sbin/iscsiadm --mode node --targetname iqn.2010-08.eu.n-tec:icebox-rix6r-000905600:dev0.ctr1 --portal 192.168.10.10:3260 --logout

[Install]
WantedBy=multi-user.target
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron