Sign inSign up

aragunathan/open-iscsi

By aragunathan

Updated almost 8 years ago

open-iscsi package on Ubuntu

Image
0

1.9K

aragunathan/open-iscsi repository overview

The main pre-requisite for running iscsi daemons in a container is to stop and uninstall any iscsi services on the host. Note that it is not sufficient to simply stop the host service. systemd socket activation still keeps the service running, so the package has to be uninstalled from the host, for the container to be run successfully. Use yum remove iscsi-initiator-tools (RHEL and friends) or apt-get remove open-iscsi (Debian and friends)

Container using the 'open-iscsi' image should be run privileged and use the host network.

$ docker run -it --privileged --network=host aragunathan/open-iscsi bash

If the iscsi kernel modules are not loaded, then bind mount /lib/modules on container startup. mobprobe later.

$ docker run -it --privileged --network=host -v /lib/modules:/lib/modules aragunathan/open-iscsi bash

Configure the initiator IQN by editing /etc/iscsi/initiatorname.This is the initiator IQN that is allowed in the target ACL.

edit /etc/iscsi/initiatorname

Start the iscsid service.

$ /etc/init.d/iscsid start

If there are module load errors, then modprobe the missing module. For ex, to load iscsi_tcp

$ modprobe iscsi_tcp

Discover the iscsi target.

$ iscsiadm -m discovery -t sendtargets -p 172.31.5.205

Now perform auth configuration. This can also be manually done by editing /etc/iscsi/iscsid.conf

$ iscsiadm --mode node --targetname "iqn.2014-12.world.srv:storage.target00" -p 172.31.5.205:3260 --op=update --name node.session.auth.authmethod --value=CHAP $ iscsiadm --mode node --targetname "iqn.2014-12.world.srv:storage.target00" -p 172.31.5.205:3260 --op=update --name node.session.auth.username --value=username $iscsiadm --mode node --targetname "iqn.2014-12.world.srv:storage.target00" -p 172.31.5.205:3260 --op=update --name node.session.auth.password --value=password

Login to the target

$ iscsiadm --mode node --targetname "iqn.2014-12.world.srv:storage.target00" -p 172.31.5.205:3260 --login

confirm the partitions

$ cat /proc/partitions major minor #blocks name

202 0 10485760 xvda 202 1 1024 xvda1 202 2 10483695 xvda2 8 0 1048576 sda ----> (new partition added)

Tag summary

Content type

Image

Digest

Size

82 MB

Last updated

almost 8 years ago

docker pull aragunathan/open-iscsi