Nov 29, 2014

Using iSCSI Initiator on Centos 6

Install iSCSI initiator packages
yum install iscsi-initiator-utils
/etc/init.d/iscsid start
/etc/init.d/iscsi start
chkconfig iscsid on
chkconfig iscsi on

Edit iSCSI initiator config
cat << EOF >> /etc/iscsi/iscsid.conf
node.session.auth.username = USERNAME
node.session.auth.password = PASSWORD
discovery.sendtargets.auth.username = USERNAME
discovery.sendtargets.auth.password = PASSWORD
EOF

Discover iSCSI targets on network
iscsiadm --mode discovery --type sendtargets --portal 192.168.4.200:3260
iscsiadm -m discovery -t sendtargets -p 192.168.4.200:3260

Login to the iSCSI target
iscsiadm --mode node  --targetname iqn.2014-11.lan.puppet:san.target1 --login
iscsiadm -m node  -t iqn.2014-11.lan.puppet:san.target1 -l

Utilize the new disk
fdisk -l
fdisk /dev/sdc

Logout of the iSCSI target
iscsiadm --mode node  --targetname iqn.2014-11.lan.puppet:san.target1 --logout
iscsiadm -m node  -t iqn.2014-11.lan.puppet:san.target1 -u

No comments: