Showing posts with label iscsi. Show all posts
Showing posts with label iscsi. Show all posts

Friday, June 18, 2010

Connecting Windows 7 to an iSCSI SAN

— SkyHi @ Friday, June 18, 2010

Like my prior articles that demonstrate how to connect Widows 2008 Server and Windows Vista to an iSCSI SAN, this article will cover similar aspects, with a step by step guide on how to set it up and how it can help you.     


First off, if you are looking for information on how to create your own FREE iSCSI SAN or to connect other operating systems to an iSCSI SAN, checkout the following articles:



Note:
This article assumes that you have already have an iSCSI SAN up and running. Besides that, I assume that you (or your SAN Admin) have already created an iSCSI share on that SAN and that the iSCSI volume has not yet been formatted with any OS /Operating system.



So, you have Windows 7 up and running but what do you do if you want to connect it to either the free SAN IiSCSI or OpenFiler from the instructions above. You could even just want to connect it to an existing iSCSI SAN and your storage admin has already created out a LUN for you.


Now that we have some background, let us configure Windows 7 to connect to an iSCSI SAN…


Configuring iSCSI in Windows 7


To get started, you need to run the iSCSI Initiator that is installed by default in Windows 7. You can access it in a couple of different ways.


One option is to access it through the Windows 7 Control Panel. Once inside control panel, on the address bar navigation, click on All Control Panel Items, then Administrative Tools, as seen in Figure 1.


From there, you need to run the iSCSI Initiator (also in Figure 1).



Figure 1: Running the iSCSI Initiator from Windows 7 Control Panel / Administrative Tools


The alternative to running the iSCSI Initiator through that path is to execute it by name. All you need to run is iscsicpl.exe. As you see in Figure 2, you can do this by going to Start and in the blank, enter iscsicpl.exe.



Figure 2: Running the iSCSI Control panel from the command line


Either way, you will arrive at the same destination. The iSCSI Warning that you see is in Figure 3 and then our real destination, the iSCSI Initiator Properties that you will see in Figure 4.


Assuming this is the first time you have attempted to run iSCSI-related application, you should see the warning message in Figure 3. This is just saying that that iSCSI service has not been started and it is asking you if you want to start it. Click Yes.



Figure 3: Starting the iSCSI Initiator Service


Finally, we reach the iSCSI Initiator Properties that we want to configure, shown in Figure 4.



Figure 4: Connecting to an iSCSI server using the iSCSI Initator


Now, what you want to do is to connect the iSCSI initiator to the iSCSI target. In our case, that target is the OpenFiler virtual machine, running in our vSphere virtual infrastructure.


Enter the domain name or IP address for your iSCSI target / the iSCSI target. In our case, it is the circled wb-iscsi-san.


Next, in Figure 5, you will be asked which of the discovered targets you want to connect to. In our case, we connected to the WB-iSCSI-WINDOWS  target (which we create just for the Windows Serves).



Figure 5: Connecting to the iSCSI Target


Once you select it and click Connect, your iSCSI SAN volume will be added to Windows so you can click DONE.


You should see the connections that you requested in the iSCSI Initiator (as you see in Figure 6).



Figure 6: Successfully Connected to Window iSCSI SAN


Now, for reliability of the iSCSI volume, you should go into the Volumes and Devices tab and click Auto  Configure. This will make the new iSCSI volume more “resilient”.



Figure 7: Connecting the iSCSI Device to the server


Then, OK, to close the iSCSI Initiator Properties.


Now, go into Computer Management and click on Disk Management.


Assuming this is the first time that any iSCSI Initiator (the Windows PC) you should see that a new disk has been found. You will be told that you must initialize the new disk before you can use it, as you see in Figure 8.



Figure 8


Click OK to initialize the newly found disk.


Now, notice the new disk in Storage Manager (shown as Disk 1 but it could be a different number on your system).


In Figure 9, below you can see that the disk is now Online but it is Unallocated.



Figure 9: New Unallocated Disk


Now what you need to do is to click on the unallocated disk and click New Simple Volume, as you can see in Figure 10, below.



Figure 10: Creating a new simple volume


This brings up the New Simple Volume Wizard, as you see in Figure 11.



Figure 11: Simple Volume Wizard


In the Simple Volume Wizard you define how much space will be allocated of that volume and the drive letter that the new volume will have.


In Figure 12, I maxed out the space of the volume with all that the volume offered, 204765 MB or about 200GB.



Figure 12: Specify Size of the new Simple Volume


Now, assign a drive letter, in Figure 13.



Figure 13: Assigning a Drive Letter


And format it with NTFS.



Figure 14: Formatting the new simple volume


At this point, you will see the finalization screen, asking you to confirm what you are about to do. If you have configured everything correctly, click Finish.


You will see that the disk is being formatted and then you should see a new Healthy (Primary Partition) that is formatted with the NTFS filesystem (as you see in Figure 15), below.



Figure 15: New Volume Created


Now that the new volume is created, let us go t o the new volume inside My Computer.



Figure 16: My Computer showing the new volume


With that, we are done!


We successfully connected Windows 7 to an iSCSI SAN. Specifically, we connected it to a free OpenFiler SAN! So, with all the benefits that a SAN provides, Windows 7 (and all the other Windows devices that can now connect to the SAN), you will be able to get a lot more done!

REFERENCES

http://www.windowsnetworking.com/articles_tutorials/Connecting-Windows-7-iSCSI-SAN.html

Tuning CentOS 5.x x64 for iSCSI Performance

— SkyHi @ Friday, June 18, 2010

In order to get the best performance from CentOS and the iSCSI deployment we recommend the following tweaks. These tweaks will give you the best performance for your iSCSI deployments. The network configuration can be used with NFS as is. Click to read more...


Add the following to your /etc/sysctl.conf:



net.ipv4.tcp_window_scaling = 1

net.ipv4.tcp_syncookies = 1

net.core.rmem_max = 16777216

net.core.wmem_max = 16777216

net.ipv4.tcp_rmem = 4096 87380 16777216

net.ipv4.tcp_wmem = 4096 65536 16777216

net.ipv4.tcp_no_metrics_save = 1

net.ipv4.tcp_moderate_rcvbuf = 1

net.core.netdev_max_backlog = 2500







Run the following to modify the TX queue of the ethernet adapters:




ifconfig eth1 txqueuelen 1000

(Only do this for 1GB links)





Modify the MTU on the ethernet adapters:


Add the following line to the IF configuration files: (located at /etc/sysconfig-network-scripts/ifcfg-eth*)



MTU=9000





Add the following to your ietd.conf (iSCSI configuation files):



InitialR2T No

ImmediateData Yes

xMaxRecvDataSegmentLength 262144






iSCSI ietd.conf Optimizations


If you have a hardware RAID controller for the data set you will be exporting via iSCSI you can use the configuration called 'blockio'. This setting will allow the RAID card to do all the caching and buffering that it needs. If you are using Software RAID or 'fake' RAID you should use the type 'fileio' this will allow the iSCSI service to use the processor and built in RAM to do caching and buffering.




The next important setting is the IOmode (this setting is ignored with Blockio and only effective in fileIO); if you set this to WB you will have data loss in the event of a power outage that does not allow the iSCSI service to gracefully terminate and flush the cache. USE WITH CAUTION.





Here is a sample ietd.conf LUN definition:



Lun 1 Type=blockio,Path=/dev/ESX_VG1/esx_iscsi_1,IOMode=wb,ScsiId=1,ScsiSN=1

You notice the use of Volume Groups here, this is to allow snapshots of
the LUN (but more on that in a later posting).


REFERENCES
http://www.halfbytetechnologies.com/content/tuning-centos-5x-x64-iscsi-performance

Wednesday, August 26, 2009

FreeBSD iSCSI Initiator Installation and Configuration

— SkyHi @ Wednesday, August 26, 2009
Q. How do I install and configure iSCSI initiator service under FreeBSD server?

A. FreeBSD 7.x has full support for iSCSI. Older version such as FreeBSD 6.3 requires backport for iSCSI. Following instruction are known to work under FreeBSD 7.0 only.
FreeBSD iscsi_initiator driver

The iscsi_initiator implements the kernel side of the Internet SCSI (iSCSI) network protocol standard, the user land companion is iscontrol and permits access to remote virtual SCSI devices via cam.
Compile driver

Please note that FreeBSD 7.x has this driver compiled by default. You can skip this step if driver exists at /boot/kernel/iscsi_initiator.ko. To compile this driver into the kernel,
# cd /usr/src/sys/i386/conf
# cp GENERIC ISCSIKERNEL
# vi ISCSIKERNEL
Place the following lines in your kernel configuration file:
device iscsi_initiator
Save and close the file. Building a Kernel, type the following commands:
# cd /usr/src
# make buildkernel KERNCONF=ISCSIKERNEL
Install the new kernel:
# make installkernel KERNCONF=ISCSIKERNEL
Now reboot the system:
# reboot
Install iSCSI Initiator driver under FreeBSD

You need FreeBSD kernel driver for the iSCSI protocol. You need to use driver called /boot/kernel/iscsi_initiator.ko. You can load this driver by typing following command as root user:
# kldload -v iscsi_initiator.ko
Output:

Loaded iscsi_initiator.ko, id=6

Alternatively, to load the driver as a module at boot time, place the following line in /boot/loader.conf:
# vi /boot/loader.conf
# Beginning of the iSCSI block added by Vivek
iscsi_initiator_load="YES"
# End of the block added by Vivek
Save and close the file.
FreeBSD iscontrol command to login / negotiator / control for an iSCSI initiator session

Now, you need to use iscontrol command. First, do a discovery session and exit:
# iscontrol -d targetaddress=iSCSI-SERVER-IP-ADDRESS initiatorname=nxl
# iscontrol -v -d targetaddress=192.168.1.100 initiatorname=nxl
Please note down the list of available targetnames/targetadresses. Once you know the target name, edit /etc/iscsi.conf file:
# vi /etc/iscsi.conf
Append config directives as follows:

officeiscsi {
authmethod = CHAP
chapIName = YOUR-ISCSI-USERNAME
chapSecret = YOUR-ISCSI-PASSWORD
initiatorname = nxl
TargetName = iqn.XYZZZZZZZZZZZZZ # whatever "iscontrol -v -d " gives you
TargetAddress = 192.168.1.100:3260,1 # your iscsi server IP
}

Save and close the file.
Where,

* officeiscsi { : Start config for iSCSI.
* authmethod : Set authentication method to chap
* chapIName : Your username
* chapSecret : Your password
* initiatorname : if not specified, defaults to iqn.2005-01.il.ac.huji.cs:
* TargetName : is the name by which the target is known, not to be confused with target address, either obtained via the target administrator, or from a discovery session.
* TargetAddress : is of the form domainname[:port][,portal-group-tag] to quote the RFC: The domainname can be specified as either a DNS host name, a dotted-decimal IPv4 address, or a bracketed IPv6 address as specified in [RFC2732].
* } : End of config

Start an iSCSI session

The following command will read options from /etc/iscsi.conf, use the targetaddress found in the block nicknamed myiscsi, login and negotiate whatever options are specified, and start an iscsi-session.
# iscontrol -c /etc/iscsi.conf -n officeiscsi
Once you run the iscontrol command it should create a new device in /dev directory. To see the device name run dmesg command:
# dmesg
Format iSCSI volume

Now run sysinstall command to format just discovered iSCSI device name at /dev location:
# sysinstall
Select Custom > 3 Partition > Select iSCSI device name such as da1. Once formatted just mount device, enter:
# mkdir /iscsi
# mount /dev/da1s1 /iscsi
You may also need to update /etc/fstab file:
/dev/ad1s1 /iscsi ufs rw 3 3

Reference: http://www.cyberciti.biz/faq/freebsd-iscsi-initiator-howto/