open-iscsi package on Ubuntu
1.9K
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)
$ docker run -it --privileged --network=host aragunathan/open-iscsi bash
$ docker run -it --privileged --network=host -v /lib/modules:/lib/modules aragunathan/open-iscsi bash
edit /etc/iscsi/initiatorname
$ /etc/init.d/iscsid start
$ modprobe iscsi_tcp
$ iscsiadm -m discovery -t sendtargets -p 172.31.5.205
$ 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
$ iscsiadm --mode node --targetname "iqn.2014-12.world.srv:storage.target00" -p 172.31.5.205:3260 --login
$ 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)
Content type
Image
Digest
Size
82 MB
Last updated
almost 8 years ago
docker pull aragunathan/open-iscsi