Budget Laboratory: Part 2 - iSCSI Virtual SAN with FreeNAS 8
Submitted by Josh on Tue, 09/06/2011 - 15:04 Storage Area Networks (SANs) are used in most Enterprise class networks, you'll also find them at a lot of small and medium businesses. A lot of systems rely on SANs to provide high availability features. A SAN is great to have for setting up shared storage for any type of cluster. Fiber used to be dominant for SAN connectivity. You'd need Fiber Host Bus Adapters (HBAs) in every server you wanted attached to your SAN, and a Fiber switch to connect everything. Then came iSCSI, which works with much cheaper Network Interface Cards (NICs), and can use regular network switches, as well us much cheaper copper cables. At first iSCSI wasn't as fast as Fiber, topping out at gigabit speeds, so if speed was important, you'd stick with Fiber. Now with 10Gigabit Ethernet being readily available, you can get iSCSI SANs that are both cost effective and high performance. A full blown hardware SAN is still very expensive, so you're probably not going to buy one for a Lab. Luckily there are a few ways you can create Virtual SANs for FREE! For Part 2 of my Budget Laboratory series, I'm going to show you how to create an iSCSI Virtual SAN with FreeNAS 8. FreeNAS is another great open source product based on FreeBSD. This portion of the lab build can be done at absolutely no cost, assuming you already have the required hardware. You will need: • VMWare Workstation OR VMWare Player* • FreeNAS 8** • 300 GB of free space *If you followed Part 1 of this series, you should already have VMWare Workstation, which has a free trial, and you will need to use it. VMWare Player is completely free, you should be able to setup your Virtual SAN using it if you so choose, however I'm using VMWare Workstation for the creation of this article. **I'm using the 64-bit version for this article. Step 1: Create a Virtual Machine for your Virtual SAN If you haven't already, open VMWare Workstation.
From the "Home" screen, click the "New Virtual Machine" button, or hit "CTRL+N".
Select "Custom (advanced)" and click "Next".
Accept the defaults and click "Next".
then select "FreeBSD 64-Bit" from the drop down list.iso at. then click "Next". browse to the location where you saved your FreeNAS .Select "Installer disc image file (iso):". then click "Next"
.Give your VM a name. then click "Next".
so you should probably change your RAM to 512MB here.
. I have been running it with 256MB without issues.Accept the defaults for the CPU and click "Next".
Accept the defaults for RAM and click "Next". You can always increase the RAM on your VM later. UPDATE: The recommended minimum RAM for FreeNAS 8 is 512MB. However.
We'll be changing the Network settings later. click "Next". so this page doesn't matter.
and click "Next". then click "Next".Accept the defaults for I/O Controller types.
Select "Create a new virtual disk".
. then click "Next".
then click Next.
Accept the default and click "Next".Accept the defaults of 8 GB and "Store virtual disk as a single file".
Make sure "Power on this virtual machine after creation" is NOT checked. and click "Finish". Click the "Edit virtual machine settings" link on your FreeNAS Virtual SAN Virtual Machine.
BEFORE powering on the Virtual Machine. we need to edit the hardware settings.
. or hit "CTRL+D".
and choose the VMNet that is bridged to the LAN side of your network. Otherwise you can just choose "Bridged: Connected directly to the physical network".If you followed Part 1 of this series.. For me this is VMNet3. click the "Add. then select "Custom: Specific virtual network". you'll need to select "Network Adapter".
." button. After that we need to add another "Hard Disk"..
Select "Hard Disk" and click "Next".
Select "Create a new virtual disk" and click "Next".
.Select "SCSI" and click "Next".
a single 300GB drive works fine. If you were going to setup a Virtual SAN for any sort of production use.
. Note: Originally I used ten 30GB drives to sort of mimic a physical disk array. Click "OK" on the Virtual Machine Settings page. and click "Next".
Accept the default and click "Next". Step 2: Install FreeNAS. So in the interest of keeping things simple. Your Virtual Machine is now ready to power on. select "Store virtual disk as a single file". you'd want to give the VM direct access to several physical drives. there's no real benefit to doing it that way. Power on the Virtual Machine.Set the "Maximum disk size (GB):" to 300. Since the virtual drives are all stored on the same physical drive.
. then hit "Enter".
Hit "Y" to continue.Hit 1 to start the install.
Select the 8 GB drive as the destination.
The installation completes.
Hit 3 to Reboot. hit "Enter" to continue.
n. Hit "n" for "Configure IPv6".
You'll see a flashing "Alert" in the upper right corner letting you know that you need to set a password. Step 3: Configure FreeNAS through the web interface. so lets take care of that first.When FreeNAS boots. Expand "My Account". hit 1 to configure the network. give the interface a name.
. then 1 to select the interface. Open a web browser and browse to the IP you assigned to your FreeNAS Virtual Machine in Step 2. then y. enter a static IP.
set and confirm a password.
. Next we need to create a volume. then click "Change Admin Password".Click the "Change Password" link. Click the "Storage" icon at the top of the page.
and select "ZFS" as the "Filesystem type" then click "Add Volume". different RAID types would become available. With ZFS you'd see RAID-Z and RAID-Z2.Give the volume a name. check out Adam Leventhal's blog post over at Oracle.
. Next we need to create a ZFS Volume. I named my "SAN1". For more information on RAID-Z2. Note: If you used multiple drives. check out Jeff Bonwick's blog post over at Oracle. click on the "Create ZFS Volume" button from the Storage page. Depending on the number of drives selected. Check the disk. For more information on RAID-Z. you'd have a few more options here. Jeff Bonwick is the inventor of RAID-Z.
For more information on ZFS. check out the ZFS page at opensolaris.org. Note: ZFS is a file system with a lot of cool features that started in Solaris. Solaris. The rest of of the space will be used in later lessons. like the FreeBSD that FreeNAS is based on. We'll make the size 150GB by putting "150G" as the size.
. Click "Add ZFS Volume" when you are done. is a flavor of Unix. Next we need to turn the iSCSI service on.I named this volume "ESXi" since we will be using it for an iSCSI LUN to be attached to ESXi in a later lesson.
so we can have a little security for our Virtual SAN. Now lets configure iSCSI.Click the "Services" button at the top of the page. then click the switch next to "iSCSI" to turn the service on.
. We'll start by setting up Authentication.
then click "Add iSCSI User"
.Expand "ISCSI" click "Target Global Configuration" then click "Authentication".
just remember what it is.I used "vsan" as my User. and click "OK". you can call it whatever you want. you can leave the bottom 3 fields blank. Set and confirm a "Secret".
. Next we need to create a Portal.
then click "Add Portal"
. Next we need to create a device extent.Here we can just accept the default and click OK. This means it will listen on port 3260 on all IPs for this portal.
Click "Device Extents" then "Add Extent"
because we'll be assigning this LUN to ESXi in a later lesson. Now we'll setup the Target Global Configuration. Select "SAN1/ESXI (150G)" (or whatever you named your ZFS volume earlier) from the drop down for "Disk device" then click "OK".Give the Extent a name. I named mine "ESXi".
select "CHAP" from the drop down for the "Discovery Auth Method". Everything else can be kept as-is.Click "Target Global Configuration".org to fixtheexchange.
. and "1" as the "Discovery Auth Group".com for mine). Click "Save". The last thing we need to do is add a target. change the base name if desired (I just changed example.
.Click "Targets" then "Add Target".
I used ESXi here because that is what this LUN will be used for later on.
. Select "1" from the drop down for "Portal Group ID". Select "1" from the drop down for "Authentication Group number". Click "OK".Give your target a name. and an alias. Select "Disk" from the drop down for "Type". The last thing we need to do is add the Extent to the Target. Select "1" from the drop down for "Initiator Group ID". Again.
1 inside of VMware Workstation 7.Click "Associated Targets." Click "Add Extent to Target". That's it! Your Virtual SAN has been configured. we'll be installing VMware ESXi 4. Select the Target you created earlier in the "Target" drop down.
. In Part 3 of the "Budget Laboratory" series. Select the Extent you created earlier in the "Extent" drop down. We now have an iSCSI LUN that we will use with ESXi in a later lesson. Click "OK".