Monday, November 25, 2013

Configuring FreeNAS 8 for iSCSI on VMware vSphere 5 part 3

iSCSI stands for Internet SCSI and allows client machines to send SCSI commands to remote storage servers such as FreeNAS. This allows you to consolidate your storage drives into a single machine for lower cost per GB and easier maintenance, with the illusion of local disk drives on your client machines. The functionality to use iSCSI drives is built into both Windows Vista and Server 2008 natively. At the higher end you can also use iSCSI for low cost clustering solutions and disaster recovery.

In Part 1 of the tutorial we Installed and Configured FreeNAS Server on a VM.. in Part 2, We configured FreeNAS as a iSCSI..

In this Part, we are going to add the newly created iSCSI to an ESXi Server.


Once you have your ESXi ready, first thing to do is log on to it using VMware vSphere Client 


 Go to Configuration Tab -> "Storage adapters" and click "Add" to add a software iSCSI adapter if it does not exist already.


Click OK when prompted as shown below 


You now will have to configure the iSCSI properties. to continue, click OK 


You should see the newly added iSCSI Software Adapter as shown below. Click on Properties 


You will first need to enable your iSCSI initiator. To do this, click “Configure” in the properties dialog. 

In my case, it was already enabled.


On the next Tab (Dynamic Discovery), click on “Add” and enter the IP address of one of your iSCSI ports of your SAN.. in our case, the FreeNAS server IP was 192.168.2.155 


the Static Discovery Tab should auto-populate if your FreeNAS Server (iSCSI) was configured properly. Click “Close” to quite the properties window.


Once this is done, vSphere will prompt you to rescan the iSCSI host for any new LUNS available, click “Yes” 


Once the adapter is rescanned (Takes a couple of seconds), your LUN will be shown in the list view below. 


Now, your SAN LUN is Added to ESXi. Only config left is to tell ESXi what to use the new storage for.
Click on “Storage” on the left menu in the “Hardware” section, where you will see it displays my current local datastore (datastore1) which is only the local hard drives. Click on “Add Storage


In the Add Storage wizard first page, select “Disk/LUN” and click Next 


Your Added LUN will be in the list, select it, and click “Next” 


Select the File System Version..
NOTE: VMFS-5 does not support older ESXi versions i.e. any version older than 5 will not be supported. 


Next will be a summary of your disk layout, click Next
(NOTE: If you get an error when this page loads, it will probably be because there is a SAN operation running on the LUN like Initialization, Syncing, capacity expansion, etc – all in all, if you get an error here, your LUN isn’t ready on the SAN)


Next enter a Name for the LUN (Just so you can identify it). I have named it as SHARED_DATASTORE 


On the next page you will see the file formatting config, I left the defaults, and clicked Next


You will get a final summary page to confirm everything, click “Finish” 


Once you have successfully finished the wizard, you will see your LUN storage ready in the storage list. 


That's it from me for now..
More such posts coming your way !!

Configuring FreeNAS 8 for iSCSI on VMware vSphere 5 part 2

iSCSI stands for Internet SCSI and allows client machines to send SCSI commands to remote storage servers such as FreeNAS. This allows you to consolidate your storage drives into a single machine for lower cost per GB and easier maintenance, with the illusion of local disk drives on your client machines. The functionality to use iSCSI drives is built into both Windows Vista and Server 2008 natively. At the higher end you can also use iSCSI for low cost clustering solutions and disaster recovery.

In the past this was usually done using special hardware and Fibre cabling, though with iSCSI you can leverage your existing network infrastructure. It should be noted that depending on the network load and performance requirements of your servers this can be drastically slower than the dedicated options. For a high performance production application you can still use iSCSI but I would look at setting it up on its own network at 1GB speeds.

How Does iSCSI Work? 

 

There are two parts to the iSCSI protocol, the first being clients and the second being storage devices.
Clients are called iSCSI initiators and can be configured either using hardware or software solutions. As I mentioned earlier this functionality is already built into Vista and Server 2008, so we will not have to add any software/hardware to these machines.
The storage devices are called iSCSI targets and must be running some type of software/hardware to receive the incoming requests from the iSCSI initiators. Luckily FreeNAS has the ability to create iSCSI drives as part of its core package so I am going to use the FreeNAS server I used in a past demo.

Setup iSCSI Target Drive on FreeNAS Server

I’m going to use FreeNAS as the iSCSI target, and if you are going to follow along with this demo, it is imperative that you have one setup as well.
If you don’t you can read how to setup FreeNAS server and then come back to this article for the next steps.

This demo is going to assume that while the hard drives are installed in the server they are NOT added to the FreeNAS interface.

You must add the second hard disk (or partition) to use as iSCSI storage disk.
 I have added one more virtual hard disk to my VMware Workstation virtual machine.

NOTE: You can follow these same steps for configuring a iSCSI in VMware vSphere Environments as well..

First, we will add a new HDD to the FreeNAS VM.

Open the Settings Wizard of the FreeNAS VM


 In the "Add Hardware Wizard", select the Hard Disk and click Next


Select "Create New Virtual Disk" and click Next


 Select "SCSI" and click Next


Provide the disk space for the new HDD. I have provide 20 GB.. You can use your imagination here !!

NOTE: The space that you provide here will be used as a iSCSI storage, so plan accordingly and provision.


Click FINISH when done


The best part of FreeNAS is that the newly added disk automatically shows up on the FreeNAS VM Console as shown below:


We now Create the volume as shown below:
Storage –> Volumes –> Create Volume 


Select the disk you want to add to Volume pool. Provide a Volume Name (testvolume).. select ZFS as the filesystem type and when done, click Add Volume


 You should see the new volume as shown below:



To configure iSCSI, go to Services –> iSCSI 

If you like you can change the ‘Target Global Base Name’ under iSCSI settings. Otherwise, leave with existing example name. I changed as below (iqn.2011-03.test)


Add portal in next step. You can leave the default or provide the IPv4 address of FreeNAS virtual machine. In my case it is 192.168.2.155, so I can add 192.168.2.155:3260 in portal filed, but I left if with default 0 values. 


 Add the Authorized Initiator now.
  

 You can go with default option ‘ALL’, if more security is required then insert the particular network in Authorized network, like 192.168.2.155/24


Now we need to create TargetsExtends and match them in Associated Targets.

NOTE: We have to repeat the same steps for each iSCSI disks we are going to create.

Create a target first:


Specify the target name (disk1), the TYPE (disk), the Target Flags (read-Write), Portal Group IDInitiator ID 

NOTE: If you have multiple HDDs, then do the same step again for second target


Add Extends now. 


Provide a Extent Name (extent1)

‘Path to the extend’ filed should contain mounted storage name (Created earlier.. testvolume) with extended name. I have allocated 17 GB as below.  

NOTE: Follow the same for the second extend if you are creating two iSCSI disks in FreeNAS


 Go to ‘Associated Targets’ and match the targets and extends we have created earlier.


We are almost done, but the important part is still pending, which is enabling iSCSI service in FreeNAS 0.8, it was disabled by default.

Go to ‘Services’ and Click on OFF to make it ON in iSCSI.



Now your iSCSI storage disks in FreeNAS is ready to connect from other hosts

Configuring FreeNAS 8 for iSCSI on VMware vSphere 5 part 1

FreeNAS is a NAS (Network Attached Storage) server OS based on FreeBSD 8.0 supporting wide range of technologies. FreeNAS™ 8 features a ground up redesign of the web user interface. 


No mess, no fuss – your server is easily controlled from any web-enabled device. Configuration is straightforward and simple, and you can make your changes on the fly. One of FreeNAS™ 8′s most important features is full support for the ZFS filesystem

ZFS includes data integrity protection, practically unlimited size caps, cloneable snapshots, automatic repair, RAID-Z, and more. ZFS is fully open-source, and is a great way to store and manage your important files.

10Gig Ethernet drivers are included in FreeNAS™ 8. If you’ve got onboard 10GigE, or better yet, a 10GigE card, FreeNAS™ 8 becomes screamingly fast when transferring files. This is especially noticeable for video streaming, and multiple simultaneous connections.

If your data is somehow lost, FreeNAS™ makes it easy to restore from a previously generated snapshot. With the periodic snapshots feature, you can worry less about data loss, and use your system stress free. It takes far less time than a full backup, but a continuous set of snapshots will provide the same level of protection.

So lets get started..

Firstly, download the latest edition of FreeNAS from HERE
NOTE: For this tutorial I have used FreeNAS v8.0.4

Create a simple new virtual machine on VMware Workstation.. 
NOTE: You can follow the same installation steps for VMware vSphere Environments also.

in the "New Virtual Machine Wizard" Specify your “FreeNAS” ISO path in “Installer Disc Image file” & click next.

Select Operating System as “Other” & Version as “FreeBSD 64-bit” & click next.

Specify the disk size. You can give it a minimalistic HDD size. I gave it 5 GB. This is just going to be used for the installation of the OS. 

I am going to add one hard disk for my FreeNAS Server in following steps for Additional storage & that will be used as a NFS storage.

Set minimum 256 MB, recommended is 512MB memory for VM. 

Once done, Power ON the VM

You can go with default option 1. If you don't provide any options, it will automatically boot FreeNAS

Select the Install option in next screen. 


 FreeNAS 8 should be installed on any of the disks. As we only have a single disk (5 GB), we will install the OS on this HDD


Proceed with the installation as shown. This will basically format the disk for installing the OS. 


 Once installed, it will prompt you to REBOOT the VM


Select option 3 and hit OK 


Once the reboot completes, you will be shown the URL to access the web console


Log in to FreeNAS. User name for GUI access is admin and password freenas

Make sure VMware network is connected to virtual machine and it’s in any type of networks where host and guest can communicate. In our case, we have used a Bridged Network for the VM

Once you have logged in, FreeNAS will prompt you to change the Admin password by showing a ALERT in the top right hand corner of your browser as shown:


 Click on My Account --> Change Admin Password
Provide the old password as "freenas" and a new one of your choice.



That’s the end of How to Install FreeNAS 8 on VMware.

FreeNAS is an ideal solution to make your old computer or virtual machine as storage for production and testing environment -