I am build a new environment on my testing-kit. Instead of downloading OpenFiler, I decided to build my own ISCSI device on OEL 5. The main reason for this exercise is that I want this box to be DNS server and some more.
Anyway, configuring ISCSI is not an average DBA’s job. I don’t like to type in commands on a prompt when I don’t know what they mean. Every how-to I find keeps on calling difficult commands to create a ISCSI LUN, which made me spent lots of time in man-pages last night. In the end this was a waste of time, since all you need to do is:
- add a disk to your VM (let’s say /dev/sdb)
- install perl-Config-General and scsi-target-utils rpm’s from the ClusterStorage directory on the DVD with your installation media
- edit /etc/tgt/targets.conf and make it look like this:
ASM1>
where area51.local is my domain, ASM1 is my LUN and /dev/sdb is the disk just added to the VM
backing-store /dev/sdb
</target>
- make the tgtd daemon start
chkconfig 345 tgtd on; service tgtd start
Now whenever you restart your server, you will still have the same ISCSI LUN presented to the world. No big man-page needed, just a simple configuration file. How about that….
Obviously, when you want to check the LUN, you do need the tgtadm command. This should do the trick:
tgtadm --lld iscsi --op show --mode target
Image may be NSFW.
Clik here to view.

Clik here to view.
