Vous êtes sur la page 1sur 3

Packages required:

- iscis-initiator-utils

Discover the targets available on a host :

iscsiadm -m discovery -t st -p #IP#

Use/login to the discovered target and host:

iscsiadm -m node -T #iSCSIdiskName# -p #IP# --login

Logout/Remove the disk from your host:

iscsiadm -m node -T #iSCSIdiskName# -p #IP# --logout

Permanently remove the target from your host:

iscsiadm -m node -p #IP# -o delete

As a host providing the iSCSI disk (scsi-target) :


Packages required:

- scsi-target-utils

Create the file /vmfs/iscsi/iscsi-share.img with :

dd if=/dev/zero of=/vmfs/iscsi/iscsi-share.img bs=1M count=12000

(will create a 12GB disk)

Edit / Create a config file :

vi /etc/tgt/conf.d/iscsi-share.conf

< target iqn.2013-03.testlab.local:iscsi.lun99 >


backing-store /vmfs/iscsi/iscsi-share.img
lun 2
< /target >

Note: It's important to increase the LUN number when you use multiple iSCSI target hosts that also use "dd"
image files, else the LUN ID will be the same and multipath will take its toll. (e.g. it'll break). If you copy &
paste above, please remove the spaces ;)
Restart tgtd

service tgtd restart

However, if you changed settings for a existing target, from experience, I've had to restart the
entire server to ensure that any cached settings got lost and the new settings used. A force-
restart did also not help in that situation

iscsiadm cheat sheet


by Justin Edmands

Login to single target:


iscsiadm -m node -T [Full target name] -l -p [IP Address]:3260
Example:

iscsiadm -m node -T iqn.2006-08.com.acnc:jetstor-00090c600:dev0.ctr1 -l -p


10.10.0.108:3260

Logout of all targets:

iscsiadm -m node --logoutall=all

Login to all targets located with discovery mode


Example:

iscsiadm -m node -l

Discover targets associated with an IP


iscsiadm -m discovery -t st -p [IP Address]
Example:

iscsiadm -m discovery -t st -p 10.10.0.108


centos 6

centos 5

iscsiadm

iscsi

centos
Add new comment

Your name

Subject

Comment *

More information about text formats

Text format

No HTML tags allowed.

Web page addresses and e-mail addresses turn into links automatically.

Lines and paragraphs break automatically.

CAPTCHA
Are you human? Type the CAPTCHA code to submit

What is the last letter in the word Linux *

Fill in the blank.

Vous aimerez peut-être aussi