Section 14: SAN Setup on CentOS 5.3
From The FluidVM Wiki
Contents |
[edit]
Procedures to create and expose a SAN target
1. Get tgtd installed in the machine you intend to use as SAN Server.
Debian: sudo apt-get install tgt RPM : sudo yum install tgtd
2. Create iSCSI Storage Target.
Description: They are just UNIQUE names by which you wish to export your Storage resource. An iSCSI target usually represents nothing but hard disk storage.
tgtadm --lld iscsi --op new --mode target --tid {1} -T {iqn.2001-04.com.example:sanstorage.disk1.com}
tgtadm --lld iscsi --op new --mode target --tid {2} -T {iqn.2001-04.com.example:sanstorage.disk2.com}
3. Associate a logical storae unit to already created target
tgtadm --lld iscsi --op new --mode logicalunit --tid {1} --lun {1} -b {/dev/sdb1}
tgtadm --lld iscsi --op new --mode logicalunit --tid {1} --lun {2} -b {/dev/sdb2}
tgtadm --lld iscsi --op new --mode logicalunit --tid {2} --lun {1} -b {/dev/sdc1}
tgtadm --lld iscsi --op new --mode logicalunit --tid {2} --lun {2} -b {/dev/sdc2}
4. To enable Target created in step 2 to accept initiator connections from systems which require SAN storage
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
tgtadm --lld iscsi --op bind --mode target --tid 2 -I ALL
5. View targets
tgtadm --lld iscsi --op show --mode target
[edit]
Note
* Please remove {} that's That's been used in the above scripts.
* needs root permission to execute these commands.
* tgtd services should be ON (/etc/init.d/tgtd start)
[edit]
Description
* Storage targets are normal block devices that you can see in a system. You can expose them across your network so that All other machines can access this exposed block devices as central storage.
* Install tgtd as per the distro and start services. Each targets should have a Unique integer ID and a Unique name. Refer step 2
* You can then attach blocks to the targets. Each block can be attached to a separate target or you can attach many blocks to a single target just by altering lun number Refer step 3
* Once the association is done, You can expose them across your network using the command in step 4
* To verify if things have gone well, use command in step 5 to view all exposed targets.
* FluidVM will pick up these targets provided all above steps passed smoothly.
[edit]
