You are on page 1of 31

17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

Fix The Exchange! (https://www.fixtheexchange.com/)


My Tech Blog, Reborn!

Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8


(https://www.fixtheexchange.com/budget-laboratory-part2-iscsi-virtual-san-with-freenas-8/)
S e p t e m b e r 6 , 2 0 1 1 |
U n c a t e g o r i z e d ( h t t p s : // w w w . f i x t h e e x c h a n g e . c o m /c a t e g o r y /u n c a t e g o r i z e d / )
| N o C o m m e n t s

(https://www.fixtheexchange.com/budget-laboratory-part2-iscsi-virtual-san-with-freenas-8/)

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
(http://www.freenas.org/). 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 (https://www.vmware.com/products/workstation/index.html) OR VMWare Player*


(https://www.vmware.com/products/player/overview.html)
FreeNAS 8** (https://sourceforge.net/projects/freenas/files/)
300 GB of free space

*If you followed Part 1 (https://www.fixtheexchange.com/budget-laboratory-part1) 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.

 

 

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 1/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/sites/fixtheexchange.com/files/newvm.png)

From the “Home” screen, click the “New Virtual Machine” button, or hit “CTRL+N”.

Select “Custom (advanced)” and click “Next”.

 

 

 
https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 2/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

Accept the defaults and click “Next”.

Select “Installer disc image file (iso):”, browse to the location where you saved your FreeNAS .iso at, then click “Next”.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 3/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

Select “Other”, then select “FreeBSD 64-Bit” from the drop down list, then click “Next”

Give your VM a name, then click “Next”.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 4/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

Accept the defaults for the CPU and click “Next”.

Accept the defaults for RAM and click “Next”.

UPDATE: The recommended minimum RAM for FreeNAS 8 is 512MB, so you should probably change your RAM to 512MB here. However, I have
been running it with 256MB without issues. You can always increase the RAM on your VM later.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 5/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

We’ll be changing the Network settings later, so this page doesn’t matter, click “Next”.

Accept the defaults for I/O Controller types, and click “Next”.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 6/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

Select “Create a new virtual disk”, then click “Next”.

Select “SCSI”, then click “Next”.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 7/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

Accept the defaults of 8 GB and “Store virtual disk as a single file”, then click Next.

Accept the default and click “Next”.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 8/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

Make sure “Power on this virtual machine after creation” is NOT checked, and click “Finish”.

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/editvm.png)

BEFORE powering on the Virtual Machine, we need to edit the hardware settings. Click the “Edit virtual machine settings” link on your FreeNAS
Virtual SAN Virtual Machine, or hit “CTRL+D”.

  

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 9/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-

content/uploads/2011/09/vmsnetwork.png)

If you followed Part 1 (https://www.fixtheexchange.com/budget-laboratory-part1) of this series, you’ll need to select “Network Adapter”, then
select “Custom: Specific virtual network”, and choose the VMNet that is bridged to the LAN side of your network. For me this is VMNet3. Otherwise
you can just choose “Bridged: Connected directly to the physical network”.

After that we need to add another “Hard Disk”, click the “Add…” button.

Select “Hard Disk” and click “Next”.


 

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 10/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

Select “Create a new virtual disk” and click “Next”.

Select “SCSI” and click “Next”.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 11/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

Set the “Maximum disk size (GB):” to 300, select “Store virtual disk as a single file”, and click “Next”.

Note: Originally I used ten 30GB drives to sort of mimic a physical disk array. Since the virtual drives are all stored on the same physical drive,
there’s no real benefit to doing it that way. So in the interest of keeping things simple, a single 300GB drive works fine. If you were going to setup a
Virtual SAN for any sort of production use, you’d want to give the VM direct access to several physical drives.

Accept the default and click “Next”.

Click “OK” on the Virtual Machine Settings page.

Your Virtual Machine is now ready to power on.

Step 2: Install FreeNAS.

Power on the Virtual Machine.

 

 

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 12/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

Hit 1 to start the install.

Select the 8 GB drive as the destination, then hit “Enter”.

Hit “Y” to continue.

  

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 13/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

The installation completes, hit “Enter” to continue.

Hit 3 to Reboot.

When FreeNAS boots, hit 1 to configure the network, then 1 to select the interface, n, then y, give the interface a name, enter a static IP. Hit “n” for
“Configure IPv6”.

Step 3: Configure FreeNAS through the web interface.

Open a web browser and browse to the IP you assigned to your FreeNAS Virtual Machine in Step 2.


 

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 14/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/freenashome.png)

You’ll see a flashing “Alert” in the upper right corner letting you know that you need to set a password, so lets take care of that first. Expand “My
Account”.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 15/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/freenassetpw.png)

Click the “Change Password” link, set and confirm a password, then click “Change Admin Password”.

Next we need to create a volume. Click the “Storage” icon at the top of the page.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 16/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/sites/fixtheexchange.com/files/field/image/createvolume.png)

Give the volume a name, I named my “SAN1”. Check the disk, and select “ZFS” as the “Filesystem type” then click “Add Volume”.

Note: If you used multiple drives, you’d have a few more options here. Depending on the number of drives selected, different RAID types would
become available. With ZFS you’d see RAID-Z and RAID-Z2. For more information on RAID-Z, check out Jeff Bonwick’s blog post over at Oracle
(https://blogs.oracle.com/bonwick/entry/raid_z). Jeff Bonwick is the inventor of RAID-Z. For more information on RAID-Z2, check out Adam
Leventhal’s blog post over at Oracle (https://blogs.oracle.com/ahl/entry/double_parity_raid_z).

Next we need to create a ZFS Volume, click on the “Create ZFS Volume” button from the Storage page.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 17/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/createzfsvolume.png)

I named this volume “ESXi” since we will be using it for an iSCSI LUN to be attached to ESXi in a later lesson. We’ll make the size 150GB by putting
“150G” as the size. The rest of of the space will be used in later lessons. Click “Add ZFS Volume” when you are done.

Note: ZFS is a file system with a lot of cool features that started in Solaris. Solaris, like the FreeBSD that FreeNAS is based on, is a flavor of Unix. For
more information on ZFS, check out the ZFS page at opensolaris.org (http://hub.opensolaris.org/bin/view/Community+Group+zfs/).

Next we need to turn the iSCSI service on.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 18/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/scsiservice.png)

Click the “Services” button at the top of the page, then click the switch next to “iSCSI” to turn the service on.

Now lets configure iSCSI. We’ll start by setting up Authentication, so we can have a little security for our Virtual SAN.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 19/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/sites/fixtheexchange.com/files/field/image/iscsiauth.png)

Expand “ISCSI” click “Target Global Configuration” then click “Authentication”, then click “Add iSCSI User”

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 20/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/addiscsiuser.png)

I used “vsan” as my User, you can call it whatever you want, just remember what it is. Set and confirm a “Secret”, you can leave the bottom 3 fields
blank, and click “OK”.

Next we need to create a Portal.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 21/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/portals.png)

Select “Portals”, then click “Add Portal”

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 22/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/addportal.png)

Here we can just accept the default and click OK. This means it will listen on port 3260 on all IPs for this portal.

Next we need to create a device extent.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 23/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/deviceextents.png)

Click “Device Extents” then “Add Extent”

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 24/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/sites/fixtheexchange.com/files/field/image/addextent.png)

Give the Extent a name, I named mine “ESXi”, because we’ll be assigning this LUN to ESXi in a later lesson. Select “SAN1/ESXI (150G)” (or whatever
you named your ZFS volume earlier) from the drop down for “Disk device” then click “OK”.

Now we’ll setup the Target Global Configuration.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 25/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/globaltarget.png)

Click “Target Global Configuration”, change the base name if desired (I just changed example.org to fixtheexchange.com for mine), select “CHAP”
from the drop down for the “Discovery Auth Method”, and “1” as the “Discovery Auth Group”. Everything else can be kept as-is. Click “Save”.

The last thing we need to do is add a target.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 26/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/targets.png)

Click “Targets” then “Add Target”.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 27/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/addtarget.png)

Give your target a name, and an alias. Again, I used ESXi here because that is what this LUN will be used for later on.

Select “Disk” from the drop down for “Type”.

Select “1” from the drop down for “Portal Group ID”.

Select “1” from the drop down for “Initiator Group ID”.

Select “1” from the drop down for “Authentication Group number”.

Click “OK”.

The last thing we need to do is add the Extent to the Target.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 28/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

(https://www.fixtheexchange.com/wp-content/uploads/2011/09/associatetarget.png)

Click “Associated Targets.”

Click “Add Extent to Target”.

Select the Target you created earlier in the “Target” drop down.

Select the Extent you created earlier in the “Extent” drop down.

Click “OK”.

That’s it! Your Virtual SAN has been configured. We now have an iSCSI LUN that we will use with ESXi in a later lesson. In Part 3 of the “Budget 
Laboratory” series, we’ll be installing VMware ESXi 4.1 inside of VMware Workstation 7.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 29/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

FreeBSD (https://www.fixtheexchange.com/tag/freebsd/), FreeNAS (https://www.fixtheexchange.com/tag/freenas/), SAN


(https://www.fixtheexchange.com/tag/san/), VMWare (https://www.fixtheexchange.com/tag/vmware/)

By Josh Bryant (https://www.fixtheexchange.com/author/josh/)

About Author
Josh Bryant
Josh M. Bryant is currently a Senior Director of Technical Account Management at Tanium where he helps customers overcome
the challenges of managing very large scale computing environments. Prior to joining Tanium, he was a Premier Field Engineer
at Microsoft specializing in Microsoft Exchange Server, and then later a Cybersecurity Architect specializing in Compromise Recovery. Josh is
also a Master Sergeant in the Illinois Air National Guard where he manages a team of Cyber Threat Intelligence specialists.

« Prev Post (https://www.fixtheexchange.com/creating-188-volume-mount-points-in-under-2-minutes-with-powershell-and-diskpart/)

Next Post » (https://www.fixtheexchange.com/budget-laboratory-part3-vmware-esxi4-on-vmware-workstation-7/)

Leave a Reply

COMMENT

NAME

EMAIL

Post Comment

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 30/31
17/8/2021 Budget Laboratory: Part 2 – iSCSI Virtual SAN with FreeNAS 8 – Fix The Exchange!

Copyright ©2021 Josh M. Bryant. All rights reserved.

https://www.fixtheexchange.com/Budget-Laboratory-Part2-iSCSI-Virtual-SAN-with-FreeNAS-8/ 31/31

You might also like