OpenFiler Document

27
get. And by installing the proper iscsi initiator on the client you can mount the openfiler's iscsi target on your client. In background its just redhat rhel linux. Iscsi-initiator [client] <---------------------------------- Openfiler Iscsi-target In this example we are using openfiler as iscsi target and a Rhel5 machine as iscsi initiator. Openfiler Installation and configuration: Download the openfiler openfiler-2.3-x86-disc1.iso from Openfiler website. Installation steps are shown below.

Transcript of OpenFiler Document

Page 1: OpenFiler Document

get. And by installing the proper iscsi initiator on the client you can mount the openfiler's iscsi target on your client. In background its just redhat rhel linux.

Iscsi-initiator [client]        <----------------------------------         Openfiler Iscsi-target

In this example we are using openfiler as iscsi target and a Rhel5 machine as iscsi initiator.

Openfiler Installation and configuration:

Download the openfiler openfiler-2.3-x86-disc1.iso from Openfiler website. Installation steps are shown below.

Just hit enter for starting the installation.

Page 3: OpenFiler Document

nstallation process is starting. Just hit enter. 

Chose the keyboard. Default is U.S. English

Page 5: OpenFiler Document

Enter yes for continuing.

Here we'll create:A /boot partiton of 100M size with ext3 filesystem.A / partition with 4000M size with ext3 filesystem.A swapfilesystem with 1024M size.

Page 7: OpenFiler Document

Click "No" for continuing. It is recommented that you should have a 2Gb RAM on openfiler system.Unckeck the dhcp option. Ckeck activate on boot. And give ip and netmask for the openfiler system. Here it is

IP: 192.168.0.29Netmask: 255.255.255.0

Page 8: OpenFiler Document

Give the gateway and DNS settings for openfiler system. Rest is optional.

GW: 192.168.0.1DNS: 8.8.8.8

Installation is about to start. Hit enter.

Page 10: OpenFiler Document

Installation is completed.Click reboot for rebooting you machine.

After rebooting you will get a screen like this. You can login as a root user.

Page 11: OpenFiler Document

In this machine password set was redhat. In the screen its shown that you can access the openfiler web interface through

https://192.168.0.29:446

But before that a few things to be done.

Configuring the web interface:

For accessing openfiler through web interface you need a web server configured. Apache comes as configured with opefiler. But you have to start the service.

[root@openfiler ~]# /etc/init.d/httpd startStarting httpd: [ OK ][root@openfiler ~]# chkconfig httpd on

And you need to start the openfiler servicce also.

[root@openfiler ~]# /etc/init.d/openfiler startStarting openfiler:[root@openfiler ~]# chkconfig openfiler on

Now take the browser and give https://192.168.0.29:446

Page 12: OpenFiler Document

You may get an ssl error, but you can proceed.Username  : openfilerpassword   : redhat                     //default it'll be password. here i changed to redhat.

Web Interface:

First you need to set a Network access Point. This machine / network will be used as client.If you are setting a iscsi device for a host, u need to give 255.255.255.255 as netmask.If you are setting a iscsi device for a network, u can give 255.255.255.0 as netmask.

Take the web interface and click the system tab:

Page 13: OpenFiler Document

Creating Volumes:

Openfiler uses the LVM concept. First it will create a Physical volume. After that it will create Volume group and then the Logical Volume.

First we will create a Physical Volume:Click Volume tab:Click new physical volume link

Page 14: OpenFiler Document

You will get a page as above. Click /dev/sda in the edit disk column.

We 'll create an extended partition first. You may dont have to do this if it is already created. After that in that extended partition, we will create a new partition as physical volume. As shown below.

Now we will create the Volume Group using the create physical volume. You can

Page 15: OpenFiler Document

create more physical volumes and make a volume group using all those physical volumes.

Click Shares: 

 

 

Click create a new filesystem volume.

Page 16: OpenFiler Document

Now we gave the Volume group the name storage. Now click change to create new Logical Volume in that.

Give the name: disk1

Description : disk1

Size : drage to full size or specify as much you want

Type : iscsi

The Logical volume is created. You can create more if you want. Now we want to set up the LUN.

Configuring LUN:

Before configuring LUN you need to enable the iscsi target service. Goto services tab:

Page 17: OpenFiler Document

Before it was disabled now Iscsi target server became enabled. You just had to click.

Now we have to createa LUN device. Goto volumes tab. Click iscsi target on the right side window.

Clicking "add" you will get like this. You can edit the target name. After the ":" you can edit as you want. Here we gave *:storage.lap

Page 18: OpenFiler Document

 

Now Goto LUN mapping tab under the Iscsi target.Click on map.

Page 20: OpenFiler Document

Now the iscsi target from openfiler is mapped to the metwork access point. You can access it from that machine.

This is status of LUN after mapping. From systems tab iscsi-target.

Client [iscsi initiator] Configuration:Here we are using a redhat enterprise linux5 as client. In order to use openfiler target as disk, it has to be set as iscsi initiator. For that we need to install the following package.#rpm -ivh iscsi-initiator-utils-6.2.0.865-0.8.el5.i386.rpm

# service iscsid startTurning off network shutdown. Starting iSCSI daemon: [ OK ][ OK ]

# chkconfig iscsid on# chkconfig iscsi on

Searching the iscsi target:

# iscsiadm -m discovery -t sendtargets -p 192.168.0.29

Page 21: OpenFiler Document

You can also use port number if you want. As follows

# iscsiadm -m discovery -t sendtargets -p 192.168.0.29:3260192.168.0.27:3260,1 iqn.2006-01.com.openfiler:storage.lap

You will get the scanned result as the line above.

Loging in to the iscsi target:

# iscsiadm -m node -T 192.168.0.27:3260,1 iqn.2006-01.com.openfiler:storage.lap -p 192.168.0.29 -l

-l or --login

#fdisk -lwill list the iscsi targets now.Example:[root@server ~]# iscsiadm -m discovery -t sendtargets -p 192.168.0.29192.168.0.29:3260,1 iqn.2006-01.com.openfiler:storage.lap[root@server ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:storage.lap -p 192.168.0.29 -l[root@server ~]# fdisk -l

Disk /dev/sda: 18.2 GB, 18253611008 bytes255 heads, 63 sectors/track, 2219 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 269 2219 15671407+ 83 Linux/dev/sda3 14 268 2048287+ 82 Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/sdb: 5335 MB, 5335154688 bytes165 heads, 62 sectors/track, 1018 cylindersUnits = cylinders of 10230 * 512 = 5237760 bytesDisk /dev/sdb doesn't contain a valid partition table

Now we'll partition the iscsi device:

[root@server ~]# fdisk /dev/sdbDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent won't be recoverable.

Page 22: OpenFiler Document

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): nCommand actione extendedp primary partition (1-4)pPartition number (1-4): 1First cylinder (1-1018, default 1):Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-1018, default 1018):Using default value 1018

Command (m for help): p

Disk /dev/sdb: 5335 MB, 5335154688 bytes165 heads, 62 sectors/track, 1018 cylindersUnits = cylinders of 10230 * 512 = 5237760 bytes

Device Boot Start End Blocks Id System/dev/sdb1 1 1018 5207039 83 Linux

Command (m for help): wThe partition table has been altered!

Calling ioctl() to re-read partition table.Syncing disks.[root@server ~]# partprobe /dev/sdb

Checking the disks: [root@server ~]# fdisk -l

Disk /dev/sda: 18.2 GB, 18253611008 bytes255 heads, 63 sectors/track, 2219 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 269 2219 15671407+ 83 Linux/dev/sda3 14 268 2048287+ 82 Linux swap / SolarisPartition table entries are not in disk order

Disk /dev/sdb: 5335 MB, 5335154688 bytes165 heads, 62 sectors/track, 1018 cylindersUnits = cylinders of 10230 * 512 = 5237760 bytes

Page 23: OpenFiler Document

Device Boot Start End Blocks Id System/dev/sdb1 1 1018 5207039 83 Linux

Now we'll format the disk:

[root@server ~]# mkfs.ext3 /dev/sdb1mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)651520 inodes, 1301759 blocks65087 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=133378867240 block groups32768 blocks per group, 32768 fragments per group16288 inodes per groupSuperblock backups stored on blocks:32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.[root@server ~]#

Mounting the Iscsi diskt to /tmp:

[root@server ~]# mount /dev/sdb1 /mnt[root@server ~]# df -hTFilesystem Type Size Used Avail Use% Mounted on/dev/sda2 ext3 15G 5.2G 8.7G 38% //dev/sda1 ext3 99M 10M 84M 11% /boottmpfs tmpfs 220M 0 220M 0% /dev/shm/dev/sdb1 ext3 4.9G 139M 4.6G 3% /mnt

[root@server mnt]# touch a b c[root@server mnt]# lsa b c lost+found[root@server mnt]#