How To Integrate AWS Storage Gateway and a Linux file server

OK the Kindle book is brilliant for the installation and configuration of the Storage Gateway see http://www.amazon.co.uk/Storage-Gateway-User-Guide-ebook/dp/B007S1XUQ0, it is free to download.

This also walks  you through how set up the iscsi connector service. Look for the chapter Connecting from a Red Hat Client to Your Storage Volume.

Just to recap and walk you through the process on a CentOS server see below :-

I am also using a free very cool bit of software from Centrify to allow the Linux server to talk and authenticate with Microsoft domain. The free version is good enough for what I want to do :). Unfortunately I set it up and did not make notes, but based on that theory I believe that the notes must have been amazing.

Anyway back to the configuration

yum install iscsi-initiator-utils
chkconfig iscsi on

To ensure that the service has started

service iscsi start

Right to start using the software, we need to see what the targets are being presented

iscsiadm -m discovery -t st -p Server_FQDN-or_IP_ADDRESS

e.g.

iscsiadm -m discovery -t st -p awsgateway.acme.local

This will list something like this

192.168.1.1:3260,1 iqn.1997-05.com.amazon:testsnap

To mount the disk you then issue the following command

iscsiadm --mode node --targetname iqn.1997-05.com.amazon:testsnap --portal 192.168.1.1:3260,1 --login

To list the disks on your server

fdsik -l 

You should see something like this

Disk /dev/sdc: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc1e3cde0

Device Boot Start End Blocks Id System
/dev/sdc1 1 65270 524281243+ 83 Linux

OK you are interested in /dev/sdc1 reference.

We now need to create a directory and mount the drive, I name the directory the same as the AWS volume name, you can call it what you like but I though it makes sense and keeps it all together.

mkdir /mnt/testsnap
vi /etc/fstab

insert this line

/dev/sdc1               /mnt/testsnap                   ext4    _netdev         0 0

mount -a

You should now have access to the drive.

To make the iscsi mount permanent use the following command

iscsiadm --mode node --targetname iqn.1997-05.com.amazon:testsnap -p 192.168.1.1:3260,1 --login node.startup -v automatic

You mount and do everything the same.

OK now for some cool tools in the  iscsciadm tool bag

List the iscsi sessions

iscsiadm -m session

Disconnecting

iscsiadm -m node --targetname iqn.1997-05.com.amazon:testsnap  --portal 192.168.1.1:3260,1  --logout

To delete the mount

iscsiadm -m node --op delete --targetname iqn.1997-05.com.amazon:testsnap

You must do this before you can destroy a volume in the Gateway console

,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

ifssoftware.wordpress.com/

Helping you achieve more

The Survival Guides's Blog

How to Survive IT and Holidays

WordPress.com

WordPress.com is the best place for your personal blog or business site.

%d bloggers like this: