From Mageia wiki
Jump to: navigation, search

This is a walk through iSCSI support in Mageia based on a use case.

Mageia brings both iSCSI sides : initiator (the client) and target (the server).

Create an iSCSI server

Install the iscsitarget package. Edit /etc/ietd.conf to add at the end of the file the shared devices, example below :

 IncomingUser login password
 Lun 0 Path=/dev/sdaX,Type=fileio,ScsiSN=SOMETHING-0001
 Alias SHARE-Volume01

Start the server:

service iscsi-target start

This example was tested against an Vmware ESXi iSCSI client.

Use the iSCSI client

Install the open-iscsi package.

Until [bug 12877] is fixed, you have to run this command

[root@localhost ~]#echo InitiatorName=$(iscsi-iname) >> /etc/iscsi/initiatorname.iscsi

Start the client service:

[root@localhost ~]#service open-iscsi start

Search for the server :

[root@localhost ~]#scsiadm  -m discoverydb  -t st -p server_ip -D -o new

List the found nodes :

[root@localhost ~]#iscsiadm  -m node

If you use CHAP with login and password like in the server example above :

[root@localhost ~]#iscsiadm -m node --targetname "" --op=update --name node.session.auth.authmethod --value=CHAP
[root@localhost ~]#iscsiadm -m node --targetname "" --op=update --name node.session.auth.username --value=login
[root@localhost ~]#iscsiadm -m node --targetname "" --op=update --name node.session.auth.password --value=password
[root@localhost ~]#iscsiadm -m node --targetname "" --login

The command dmesg should show a new device like /dev/sdb. This example was tested against the above server example.