Tag Archive : VMWare

/ VMWare

You may have seen the "Smoked by Windows Phone" ad campaign, where a Windows Phone does something faster than another phone.   Well how about "Smoked by Hyper-V Server" challenge?  

 

As part of my initiative to "Do IT the Microsoft way", I set about switching over from VMware ESXi to Hyper-V.  After installing Hyper-V Server 8 Beta, I noticed it seemed to boot a lot faster.  This gave me the idea to have my own little "Smoked by Hyper-V Server" challenge.
 

For this challenge, I used the exact same server, and timed how long it took to boot, starting with the server completely powered off, and ending when a logon screen became available.   The server used was an old Intel Core 2 Duo 6400 2.13GHz with only 4GB of RAM, and three 80 GB SATA hard drive. 

 

VMWare ESXi 4.1 Boot time: 6 minutes and 23 seconds.

 

Hyper-V Server 8 Beta Boot time: 59 seconds.

 

Both of these are FREE bare metal hypervisors.  As you can see, even on those very old hardware, Hyper-V Server boots almost 6x faster than ESXi!

Alex Fontana over on the VMware blogs posted a great article on choosing between virtual disks (VMDK files) and Raw-device Mappings (RDM) when virtualizing an Exchange server.   Check it out here: http://blogs.vmware.com/apps/2011/11/virtualized-exchange-storage-vmdk-or-rdm-or.html

I have deployed virtualized Exchange servers on VMDK files in ESXi 4.1 environments without any issues.   I've also used the "In-guest iSCSI" method he talks about in the article, which is one of my personal favorites.  The In-guest iSCSI method is what I use for Exchange servers that reside in my budget lab along with the FreeNAS based Virtual SAN I demonstrated in that series.

For production environments, I've stuck with either RDM, or the In-guest ISCSI, depending on the SAN architecture.  I'll definitely consider VMDK from here on out.

Installing an Operating System (O/S) can take hours.  Good thing when it comes to deploying Virtual Machines (VMs), you really only need to do this once. So for the final installment of the "Budget Laboratory" series, I'm going to show you how to create a VM for use as an O/S template, using the vSphere client and the ESXi server we setup earlier in the series.  Using this method, you'll only have to install each O/S you'd want to use on a VM once.

 

You will need:

  • An ESXi server.
  • A system running the vSphere client.
  • An Operating System.*

*In the screenshots I am creating a Windows Server 2003 SP2 template for use in later articles.  You can use any O/S you want, and should do this once for every O/S you intend to use in your lab.  Don't forget to run sysprep if you're building a template for any Windows O/S.

Step 1: Create a New VM.
If you haven't already, login to your ESXi server with the vSphere client.

Right click on your ESXi server and click "New Virtual Machine…" or hit "CTRL+N" to bring up the "Create New Virtual Machine" wizzard.

Select "Custom" then click "Next".

Give your template VM a name. I like to use the O/S name, and for Windows Servers, the Service Pack level. Click "Next".

Select the Datastore you want to store the VM on.  If you've followed this series up to this point, it should look similar to the screenshot above. Click "Next".

Select the VM Version and click "Next".

Select the O/S type for the O/S you'll be installing.  I'm creating a Windows Server 2003 SP2 Enterprise server here for use in another article.  You should choose the closest match to the O/S you're using.   Click "Next".

Select the number of processors.  Since this is a template, use the bare minimum, you can change this before powering on VMs created using this template later on.   Click "Next".

Set the amount of RAM available to the VM.  Again, we want to use the bare minimum here.  256MB is the minimum requirement for the O/S I'm installing. Choose whatever the minimum is for the O/S you're installing, and click next.

Select the number of NICs, again minimum, so 1 is fine, then click "Next".

Choose the SCSI controller type, it should default to the recommend type for the O/S you're installing, then click "Next".

Select "Create a new virtual disk", and click "Next".

Set the disk size, again use the recommended minimum for the O/S you're installing.  Specify the datastore to store the disk on, and click "Next".

You can accept the defaults here and click "Next".

Click "Finish".

 

Step 2: Install the O/S.
You hopefully already know how to install an O/S.  Install it just like you would on any other VM or Physical system.  I will not bore you with screen shots and step by step on the Windows Server 2003 Install that I did while creating this article.  This step can take some time depending on what O/S you're using.

Step 3: Install updates/patches.
If you installed Windows, use Windows Update.  If you're using Linux, use your distributions package manager.  Do whatever you need to to bring yoru O/S up to date.   For a Windows Server 2003 system, you have to install Service Pack 2 before you can even use Windows Update, and then there are well over 100 updates that need to be installed after that.  So this step can end up taking even longer than Step 2.

Step 4: Establish a baseline configuration.
If you're doing this on a work lab, or applying this technique to a production environment, apply any baseline configuration settings your company has established for the O/S.   If you don't have a baseline, now is a good time to come up with one.  Configure everything that a basic server needs.

Step 5: Make use of the Template.
Now that the O/S has been installed, updated, and configured, power it off.   It doesn't need to be powered on using up resources, however you should power it on about once a month and repeat Step 3, just to keep it up to date.

With the template VM powered off, you can now copy it to quickly stand up new VMs.
Highlight your ESXi server and click the "Configuration" Tab.

Select and right click the datastore you created your template VM on, then click "Browse Datastore…"

Create a new folder on the datastore by clicking the icon shown in the screenshot above.

Give the folder a name.  I'm creating a Domain Controller, so I called mine "DC1".

Browse to the folder for the VM template you created, and select all the files in it.  Right click them then click "Copy".

Browse back to the folder you created for the new VM, right click in it, and click "Paste".

Wait for the files to copy.

Right click on the ".vmx" file and click "Add to Inventory".

Give the new VM a name, then click "Next".

Select the resource pool you want to add the new VM to (we haven't created any for this series), then click "Next".

Click "Finish".

The new VM should now appear in your inventory.  When you power it on you will see this:

Select "I copied it" and click "OK".

 

That's it!   You can repeat this procedure for ever O/S you want to use, then simply repeat Step 5 every time you want to create a new VM.  Your new VMs should be fully patched and ready for final configuration (naming, IP assignment, application installation, etc.) within minutes! 

Note: With vCenter Server, you can take this a step further  and makes it even easier using the "Convert to template" feature.  Once a VM is converted to a template in vCenter, you can deploy new VMs based on the template with just a few clicks. vCenter Server also has a 60 day trial, however it requires a 64-Bit Windows Server (which can be a VM).  If you want to take advantage of the advanced features, like clustering and vMotion, you'll need a vCenter Server.   The method outlined in this tutorial is the way you'll have to do it if you intend on sticking with the free version of ESXi.

If you followed this entire series, the foundation for your lab is now in place. You're ready to use to learn or test whatever you desire.
 

 

Before VMware released version 8 of their popular Workstation software, it was not possible to run 64-bit guest operating systems (O/S) from an ESXi 4.1 or vSphere 5 guest.   This nested Virtual Machine (VM) setup is great for learning and test lab environments, but up until now you were limited to 32-bit guest O/S's. 

Workstation 8 now allows you to "Virtualize Intel VT-x/EPT or AMD-V/RVI", which in turn passes hardware features on to a guest VM, like ESXi 4.1 or vSphere 5, that enable them to run 64bit guest O/S's.

If you've just upgraded from Workstation 7, you'll need to change the hardware compatibility level on your ESXi or vSphere VM, before you can enable this new feature.

Here's how:

You will need:

 

Step 1: Change Hardware Compatibility
Note: If you created your ESXi or vSphere VM AFTER installing or upgrading to Workstation 8, and chose "Workstation 8" as the compatibility level, you can skip this step.

First, the VM must be powered off in order to make this change, so power it off if it isn't already.

In Workstation, right click on the VM you want to change the compatability level on, go to "Manage", then click "Change Hardware Compatibility…". 

Click "Next".

Choose "Workstation 8" on the drop down labeled "Hardware compatibility:", then click "Next".

Here you can either clone the VM, leaving a copy of it with the old compatibility level, or just alter the existing VM.  I chose to alter the existing VM.  Choose one and click "Next".

Click "Finish".

 

Click "Close".

 

Step 2: Enable Virtualized Intel VT-x/EPT or AMD-V/RVI

Select the VM you want to enable Virtualized Intel VT-x/EPT or AMD-V/RVI on, and either right click it and choose "Settings…" or hit "CTRL+D".

Select "Processors".

Check the box next to "Virtualize Intel VT-x/EPT or AMD-V/RVI.

 

That's it!  Power your ESXi or vSphere VM on, and start using 64bit guests inside it.

Today I'm going to show you how to install the Windows 8 Developer Preview on VMware Workstation 8.  The Windows 8 Developer Preview was just released last night (09/13/2011), and VMware Workstation 8 was just released today (09/14/2011).  
 

UPDATE: If you came here because the Windows 8 Consumer Preview was released today (02/29/2012), this guide is good for this new release too!  There are a few cosmetic changes to the install, but everything is essentially the same.
 
You will need:

*This will NOT work on Workstation 7, if you haven't already, you need to upgrade before continuing.  If you don't want to upgrade, the Windows 8 Developer Preview will install on VirtualBox 4.1.2, which is free.
 
**I used the top download, Windows Developer Preview with developer tools English, 64-bit (x64).
 
 
Step 1: Create the Virtual Machine

From the VMWare Workstation 8 home screen, click "Create a new Virtual Machine" or hit "CTRL+N".

Select "Custom (advanced)" then click "Next".

Select "Workstation 8.0" then click "Next"

Browse to the location you saved the Windows 8 Developer Preview .iso file, select it, and click "Next".

Select "Microsoft Windows" then select "Windows 7 x64" in the "Version" drop down box, and click "Next".
Note: If you're trying to install the 32bit version, just select "Windows 7".  The Windows 8 Developer Preview isn't even a Beta version yet, so don't expect to see it in this list anytime soon.

There's no key, and we won't be using the "Easy Install" feature, so just click "Next", we'll turn the "Easy Install" off later.

Give your VM a name, and click "Next".

1 CPU and 1 Core are fine, you can give it more if desired.  Click "Next".

2 GB of RAM is recommended for 64bit, if you're installing 32bit, use 1GB.  Click "Next".

Choose a network type, I like to use "Bridged", and click "Next".
 
Select "LSI Logic SAS" and click "Next".

Select "Create a new virtual disk" and click "Next"

Select "SCSI" and click "Next"

The recommended minimum is 20GB, specify a size, select "Store virtual disk as a single file" and click "Next".

Accept the default and click "Next".

Uncheck "Power on this virtual machine after creation", and click "Finish".

 

Step 2: Remove the Floppy from the VM.

Edit the VM Settings for the VM you just created.

Select "Floppy" then click "Remove".

Note: If you do not do this, the installation will fail.

Step 3: Power on the VM and install Windows 8 Developer Preview.

Install boot screen:

Select your language and click "Next".

Click "Install now".

Check the "I accept the license terms" box and click "Next".

Click "Custom (advanced)".

Select the disk and click "Next"

This screen takes approximately 10 minutes to complete.

Give your PC a name and click "Next"

I used the express settings.

You can logon with your "Windows Live ID" if desired.   If you don't want to, or don't have one, click "Don't want to log on with a Windows Live ID?".

If you're not going to use a "Windows Live ID" Click "Local account".

Create a user name and password, then click "Next"

 

That's it!  Now you can play around with Windows 8 without worrying about breaking anything.   You'll probably want to install the VMware Tools, click the "Desktop" square before telling Workstation 8 to install the tools.   If you get an error message about the "Easy Install", power the VM off, edit the settings, and remove the Floppy drive.  Sometimes it adds itself back in there after the install, even though we removed it beforehand.

VMWare Workstation 8 Released

September 14, 2011 | Uncategorized | No Comments

VMWare released version 8 of Workstation today.  The upgrade costs $99, and a new license will set you back $199.
 
The new version boasts over 50 new features, including:

  • Remotely connect to virtual machines running on VMware Workstation, VMware vSphere, and VMware vCenter anywhere on your network
  • Simply drag and drop when you are ready to move your virtual machines to VMware vSphere
  • Run as a server and your virtual machines will continue to run long after you log off. Start sharing virtual machines with your team, department, or anyone in your organization.
  • First to support HD audio with 7.1 surround sound, USB 3, and Bluetooth devices in in a virtual machine.
  • Significant improvements to virtual SMP and 3D graphics performance and support for 64GB RAM allows you to run the most demanding applications in a virtual machine.
  • Completely revamped and streamlined user interface with simplified menus, updated toolbar, folder views, live thumbnail bar and a new virtual machine library.
  • New virtual machine library makes it easy to search for the virtual machines that you need, whether they are local or remote

For a full list of what's new, check out the release notes.

For Part 4 of the "Budget Laboratory" series, we're going to connect the ESXi 4.1 server we installed in Part 3, to the Virtual SAN we created using FreeNAS 8 in Part 2, using the vSphere client.

*If you haven't already, open the IP you've configured for your ESXi server in a web browser to download and install the vSphere client.

Step 1: Open vSphere and login to your ESXi server.



Enter the username and password for your ESXi server, then click "Login".

 



We aren't worried about SSL certificates for a lab environment, so we can just click "Ignore".
Note: For a production environment, you should obtain a valid SSL cert from a trusted Root Certificate Authority.

 



Click "OK".
Note: ESXi 4.1 is fully featured for 60 days. After that you need to enter a license key to continue using the free version. You should have received a license key via e-mail from VMWare when you registered to download ESXi 4.1. If you want to learn how to use the features that are only available in the paid version, you should use the evaluation mode for the duration of the trail, before switching over to the free version.

Step 2: Configure the Storage Adapter




Click the "Configuration" tab.
Click "Storage Adapters".
Select the iSCSI Software Adapter.
Click "Properties".

 



Click "Configure…".

 



Check the "Enabled" box, then click "OK".

 



Click the "Dynamic Discovery" tab, then click "Add…"

 



Type in the IP address of your iSCSI SAN, thenc lick "CHAP…"
Note: If you followed Part 2 of this series, the default port number should be the same as shown in the screen shot above. Otherwise enter the correct port number for your iSCSI SAN here as well.

 



Uncheck the "Inherit from parent" box.
Select "Use CHAP" from the "Select option:" drop down box.
Enter the name and secret, then click "OK".
Note: If you followed Part 2 of this series, this should match what you set in the "Add iSCSI User" box. If your iSCSI SAN is configured to use a different authentication method, or does not use authentication, you should configure this accordingly.

 



Click "Yes" to rescan the HBA.

 



You should now see any available disks from your SAN, as shown in the screenshot above.
Note: If you followed Part 2 of this series and do not see anything after rescanning the drives, make sure the iSCSI service is running on FreeNAS, and that you did not miss any steps. If it is running, you can try turning the service off and then back on again. Then go back to vSphere and click "Rescan All…". If you still do not see anything here, verify the network settings are correct on both your FreeNAS VM and your ESXi VM. Make sure they can communicate with each other over the network.

Step 3: Add Storage
Now that the connection has been established to our SAN, we can add the storage.



Click "Storage" then "Add Storage…"

 



Select "Disk/LUN" then click "Next".

 



Select the disk you want to use, then click "Next".

 



We're going to use this whole drive, that's why we created it, and it is the only option available to us, so just click "Next".

 



Here we can name our datastore. We'll be using this one just to store the virtual drives that will contain the OS for our VMs, so I called mine "OS". Give yours a name, and click "Next".

 



Here you can change the block size used when formatting the drive. Since we aren't using a very big drive for this lab, I just left the default. Click "Next".

 



Click "Finish".

 



That's it! Our ESXi server is now using storage on our SAN.

In Part 5 of this series, I'll show you how to create OS templates that will allow you to quickly deploy VMs on your ESXi server.

For this installment of my “Budget Laboratory” series, I’ll show you how to install VMWare ESXi 4.1 on VMWare Workstation 7. Yes, we’ll be running Virtual Machines (VMs) inside of a VM! Why would anyone want to do such a thing? To learn ESXi and vSphere of course! If you don’t have spare hardware for a dedicated ESXi lab environment, running it inside of Workstation 7 is a great alternative. You could also run it inside of VMWare Player if you feel so inclined. However, as with the first 2 articles in this series, I’ll be using Workstation 7. ESXi and Player are both completely free, Workstation has a 30 day free trial available.

While there are other options when it comes to virtualization, VMWare has dominated the market for quite some time. When you say “Virtualization”, VMWare is what most people think of first. It is a great product to start with if you’re just getting into virtualization.

There are some limitations when running ESXi inside of Workstation. ESXi will only be able to run 32-bit guest Operating Systems (O/S’s). Workstation must be 64-bit and running on a 64-bit host O/S in order for ESXi 4.1 to install. (UPDATE: Workstation 8 has a new feature that allows ESXi to run 64-bit guest O/S’s, click here to read about it.)

I recommend a quad core CPU and at least 8GB of RAM for this, however you may be able to get away with less.

    You will need:

  • A computer running a 64-bit Operating System.
  • VMWare Workstation 7 (UPDATE: Workstation 8 is out, these instructions will work with Workstation 8 too.)
  • VMWare ESXi 4.1

Why ESXi 4.1? Well 5.0 is still pretty new, so you’ll find 4.1 still being used in a lot of places. VMWare made some changes to the licensing with 5.0 that really restrict the free version. I feel that 4.1 is a better option when running the free version right now. That being said, I will probably do another version of this article for 5.0 later on.

Step 1: Create a Virtual Machine for ESXi

 


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”.

 

 

Select “Installer disc image file (iso):” and browse to the location of your VMWare ESXi 4.1 .iso file.
You’ll notice that VMWare Workstation automatically detects that we’re going to install “ESX Server 4”.

 

 

You can change the name and location here, I just left the defaults, click “Next”.

 

 

Here you can change the number of processors and cores, I left mine as the default, click “Next”.

 

 

Next we tell it how much memory to use. I set mine to half of my physical RAM, which just happens to be twice the recommended minimum. This can always be changed later if needed. Click “Next”.

 

 

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”.

 

 

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

 

 

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

I missed a screen shot for the “Specify Disk File” screen, you can just accept the default on this screen and click “Next”.

 

 

Here we’ll check the box for “Power on this virtual machine after creation” and then click the “Customize Hardware…” button.

 

 

If you followed Part 1 of this series, you’ll need to select “Network Adapter” then “Custom: Specific virtual network”, and choose the VMNet that is bridged with your LAN NIC. For me it is VMNet3. Otherwise you can just choose “Bridged: Connected directrly to the physical network”.

Click “OK” to exit the Hardware configuration, then click “Finish”, your ESXi VM should now boot.

Step 2: Install ESXi 4.1

 

Hit “Enter” to start the install.

 

 

 

 

Hit “F11” to accept the EULA.

 

 

Hit “Enter” to continue.

 

 

Hit “F11” to confirm the install.

 

 

The installation is complete, hit “Enter” to reboot.

Step 3: Configure ESXi 4.1

 

You should see a screen similar to this when ESXi boots, hit “F2”.

 

 

There is no password, just hit “Enter” twice to login.

 

 

You didn’t think we were going to leave a blank password did you? Hit “Enter” to change the password.

 

 

Set and confirm a password, then hit “Enter”.

Now we need to set a static IP.

 

Hit the down arrow until you have “Configure Management Network” selected, then hit “Enter”.

 

 

Select “Set a static IP address and network configuration” using the space bar, then assign a static IP in a private address range that is accessible to your host O/S.

Next we’ll change the hostname.

 

Select “DNS Configuration” then hit “Enter”.

 

 

Set your hostname to whatever you want it to be. As you can see, I changed mine to esxi.fixtheexchange.com. Then hit “Enter”.

 

 

Hit “Y” to confirm the changes.

Step 4: Verify connectivity and download vSphere Client.
If you configured the network properly in Step 3, you should be able to open a web browser, and browse to the IP you assigned your ESXi server. A page that looks like this should come up:

 

Click the “Download vSphere Client” link to download and install the vSphere Client.

ESXi is now ready for use!

In Part 4 of the “Budget Laboratory” series, I’ll show you how to use the vSphere client to connect ESXi to the Virtual SAN we created in Part 2 of the series.

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.

*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”.

 

 

 

 

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

 

 

 

 

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

 

 

 

 

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

 

 

 

 

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.

 

 

 

 

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”.

 

 

 

 

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

 

 

 

 

Select “SCSI”, then click “Next”.

 

 

 

 

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

 

 

 

 

Accept the default and click “Next”.

 

 

 

 

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

 

 

 

 

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”.

 

 

 

 

If you followed Part 1 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”.

 

 

 

 

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

 

 

 

 

Select “SCSI” and click “Next”.

 

 

 

 

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.

 

 

 

 

Hit 1 to start the install.

 

 

 

 

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

 

 

 

 

Hit “Y” to continue.

 

 

 

 

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.

 

 

 

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”.

 

 

 

 

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.

 

 

 


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. Jeff Bonwick is the inventor of RAID-Z. For more information on RAID-Z2, check out Adam Leventhal’s blog post over at Oracle.

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

 

 

 

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.

Next we need to turn the iSCSI service on.

 

 

 

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.

 

 

 


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

 

 

 

 

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.

 

 

 

Select “Portals”, then click “Add Portal”

 

 

 

 

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.

 

 

 

Click “Device Extents” then “Add Extent”

 

 

 

 


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.

 

 

 

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.

 

 

 

Click “Targets” then “Add Target”.

 

 

 

 

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.

 

 

 

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.

Wait a minute, I thought this was an “Exchange blog”, why is your first article about networking with pfSense?!

Well, in order to create high quality Exchange related content for this site, I’ve been building a lab. There has been some interest in how I’ve setup my lab, so I thought I’d show you. What better way to help people learn Exchange than by showing them how to create a powerful lab environment to run it in? Besides, having a good understanding of boundary systems is very useful when troubleshooting mail flow issues.

Part 1 of my “Budget Laboratory” series is actually optional, and the only part of the lab that will cost anything (assuming you already own the hardware). It will only cost anything if you plan on using your Lab for more than 30 days.

We’ll be building most of this lab using only a single computer. I recommend a quad core CPU with at least 8 GB of RAM, however you may be able to do it with less.

The information in this guide will be useful for much more than a home lab, you could also use this in a production environment for a small business, or even a large enterprise, if scaled and configured properly.

    You will need:

  • A computer with 3 RJ45 (network) ports and a 64bit Operating System (OS).*
  • At least two high speed internet connections.**
  • VMWare Workstation 7. (30 day FREE trial, $100 after that.)
  • pfSense 1.2.3 virtual appliance. (FREE!)***
  • A Wireless Access Point, switch, or combined device.****

*If you don’t have 3 RJ45 ports available, I highly recommend adding Intel Pro 1000 NICs. You can use your on-board NIC for one of the connections. For my setup, I purchased 2 Intel Pro 1000 NICs for $30 each, and used the on-board RealTEK NIC off my motherboard for the 3rd. Why a 64bit OS? Because later on in this series I will show you how to run VMWare ESXi 4.1 inside of VMWare Workstation, and connect it to a virtual SAN. The host OS has to be 64bit for this to work. I’ll be using 64-bit Windows 7 for my examples. You can achieve the same results with your favorite 64bit Linux distribution as a host operating system.

**If you don’t have 2 high speed internet connections, you obviously won’t be able to setup Multi-WAN load balancing. However you can still setup a pfSense firewall inside of VMWare Workstation 7, and route all of your network traffic.

***I’ll be doing another guide for pfSense 2.0 when the final stable build is released for it.

****I’m using a LinkSys WRT330N, which is a combination Wireless Access Point, Router, and 4 port gigabit switch.

Step 1: Connect the modems and switch to your computer.



Multi-WAN Diagram
It should resemble the diagram above. For my setup, I have an old Motorola SB5101 cable modem that I’ve owned for years, and an SMCD3G leased modem from my cable company. This is purely for speed. If you were going to setup Multi-WAN load balancing in a production environment, you’d want to have two unique ISPs. Cable and DSL for example. That way you can have true fault tolerance and high availability. If the connection to one ISP is lost, traffic will still be routed through the other. There’s only one ISP that services the area I live in, so that’s why I have 2 connections to the same ISP. You could add additional connections to ISP(s) for even more speed or fault tolerance, just add more network ports to the computer hosting pfSense.

Each connection to your ISP should go to 1 port on the computer you’ll be setting pfSense up on. One connection goes to the switch for your LAN.

Note: If you are using something similar to the Linksys WRT330N that I have, you want to use one of the LAN switch ports on it for the connection to the pfSense firewall. DO NOT use the “INTERNET” (WAN/uplink) port, it won’t work. You also need to turn off the firewall, NAT, and DHCP server on this device, if it has those features. We’ll be using pfSense to do all of that now. You will need to change the default IP on this device as well. Usually it’s something like 192.168.1.1. We’ll be using x.x.x.1 as the gateway IP for our LAN. These devices usually aren’t smart enough to do VLANs, so if the address space doesn’t match what we configure in pfSense, things aren’t going to work. I changed mine to x.x.x.5. You can use any private address space you like for your LAN. Since mine is a small home lab, I’m using a single 24 bit subnet, so this guide will reflect that.

Step 2: Configure the host.

As I mentioned, I’m using 64bit Windows 7 as my host, so this example is from that. If you’re using a different host OS, you will need to do accomplish the same end result.

First, I recommend labeling your NICs. I gave mine names that matched what they are connected to. If I had 2 different ISPs, I would have given the WAN links the name of the ISP they are connected to, but since I don’t, I named them after the modem model number they are connected to instead.



Next we need to disable TCP/IP on the WAN links. Bring up the properties for each NIC that is connected to your ISP(s).



Make sure both “Internet Protocol Version 6 (TCP/IPv6)” and “Internet Protocol Version 4 (TCP/IPv4)”

The last thing we need to do in this step, is change the binding order of the NICs. In Windows 7 you hit “Alt+N” to bring up the hidden menu in your Network Connections, then select “Advanced Settings”. Move your LAN NIC to the top of the list.



TIP: You can disable TCP/IP on the WAN NICs from the “Advanced Settings”, just select the NIC and uncheck all check boxes for it.

This is done to make sure traffic from the host OS gets routed through the pfSense firewall. If you do not do this, both the host OS, and the pfSense VM will try to pick up an IP address from your ISP(s). Your host will end up connecting to the internet through one of these NICs and not be able to take advantage of the load balancing.

You need to leave TCP/IP enabled on your LAN NIC.

Step 3: Configure VMWare Workstation 7

If you haven’t already installed VMWare Workstation 7, do it now before continuing.

Here we need to configure the NICs for use by our virtual machines. Click “Edit” then “Virtual Network Editor”.



As you can see, I have VMnet0 bridged to one of my Intel Pro 1000 NICs, VMnet2 bridged to the other, and VMnet3 bridged to my motherboards on-board Realtek NIC. VMWare Workstation 7 doesn’t use the labels that we assigned in the host, but you can easily tell which is which. If you look in at the screen shot where I labeled my NICs in Step 2, you can see that VMnet 0 is my connection to the SB5101 modem, VMnet2 is the connection to the SMC modem, and VMnet3 is the connection to the LAN.

Step 4: Configure the pfSense virtual machine settings

Open up the pfSense virtual appliance in VMWare Worksation 7, but do NOT power it on. Bring up the Virtual Machine Settings by clicking “Edit virtual machine settings” or hitting “CTRL+D”.



Make sure you have 3 devices of the type “Network Adapter”, 1 for each NIC we configured in Step 3. Select each “Network Adapter”, make sure “Connected” and “Connect at power on” are both checked. Set the “Network connection” to “Custom: Specific virtual network”, and select one of the VMnet# that you configured in Step 3 for each “Network Adapter”.

Step 5: Configure pfSense from the console.

Now it’s time to boot your pfSense VM. When it boots, you should see a screen like this:



Your interfaces may not be assigned, mine weren’t, and pfSense was unable to automatically detect them. If this happens, it may take a little trial and error to get them assigned correctly. Press 1 then hit enter to assign them. Your WAN links should pick up an IP address from either your ISP, or your cable modem, if they use DHCP. If you get it wrong the first time, you can usually tell which one is the correct LAN interface by looking for the interface that does not pick up an IP address at the top of the screen. If you see “0.0.0.0”, that is most likely your LAN interface, write down the interface number, and run the assignment again. If you own a static IP address, you will need to configure it later. The LAN interface assignment is what is important here, once you have the correct interface assigned for the LAN, the rest of the configuration will be done through the web management console.

You can change the LAN IP by hitting 2, or use the default, it’s up to you.

Step 6: Configure pfSense from the web interface.

Open a web browser and go to http://192.168.1.1 (or whatever you changed the LAN IP to.). The default username is “admin” and the default password is “pfsense” (don’t forget to change these!). You’ll be greeted with a configuration wizard, click “Next”.



Enter your information, I used my ISPs DNS. Click “Next”
The time zone settings will come up, select your time zone and click “Next”.
Now you will asked to configure the WAN interface. If you have a static IP from your ISP, here is where you’ll configure it, UNLESS that is handled by your modem. If your modem gets the static IP assignment from your ISP, you will want to leave this as DHCP so it will pick up a private address from your modem.
The next page lets you change the LAN IP, if you did that in Step 5, or just want to use the default, you can just click “Next” and move on.
Finally we’ll set the WebGUI password. After you change it, you’ll have to log back on.

Next we need to configure the second WAN interface. Click “Interfaces” then “OPT1”.



Make sure “Enable Optional 1 interface” is checked. You can change the name here, I labeled mine “WAN2”. If you have a static IP for your other ISP connection, you’ll want to configure it here. If you only own 1 static IP, you should probably leave this set as DHCP. Again, if your modem handles your public IP, you should probably leave this as DHCP.

Next we will create a Load Balancer Pool. Click on “Services” then “Load Balancer”. When the page loads, click the icon to create a new pool.



Give the pool a name, I called mine “LoadBalancer”. Make sure the type is set to “Gateway”, and Behavior is set to “Load Balancing”.
Add both WAN IP’s to the pool. I use the gateway for each WAN interface as the monitor IP.
Click “Save” when you are done.
Create a second pool for Failover, just set the type to “failover” for this one.



You should have 2 pools as shown above when you’re done.

We’re almost done, the last thing we need to do, is setup some firewall rules. Click “Firewall” then “Rules”. When the page loads, select the “LAN” tab.



We don’t want all traffic to be load balanced. You can’t load balance SSL and other encrypted traffic, those types of connections need to use the same IP every time. pfSense processes rules from the top down. You’ll notice the load balancer rule is at the bottom. Anything we don’t want load balanced needs to be in a rule ABOVE it. I’ll show you how to create a rule to NOT load balance a protocol, using HTTPS as an example. First click the icon to create a new rule.



Your settings should match the screen shot above. Using the failover gateway we configured will ensure these protocols still work with minimal interruption if one of our WAN links goes down.

Now lets tell it to load balance everything else, you probably already had a “Default LAN -> Any” rule, just click the icon to edit it.



Your rule should look like the screen shot above. Save it, then apply the changes.

That’s it! All of your network traffic should now be flowing through the pfSense virtual machine. To verify that the load balancing is working, go to a site like www.whatismyip.com, and refresh the page a couple times. The IP shown should change back and forth between the external IPs of your WAN links every time the page loads.

If you want to test the speed out, you can use a site like www.speedtest.net, however these results can be a little inaccurate due to the “Speed Boost” that a lot of ISPs use these days. I have a 12Mbps down and 2Mbps up package from my ISP, and these are the results I get after setting up the load balancing:



If you want to test the fail over, simply unplug one of your WAN links and try surfing the web. You should still be able to even with one link down. Plug it back in, and it should automatically start load balancing again.

If I pull the plug on one of my WAN links and run a speed test, this is the result:



As you can see there’s quite a difference in bandwidth with the load balancing.

Just for fun I took a look at what World of Warcraft thought my “effective bandwidth” was…


176Mbps, don’t I wish!

I hope you’ve enjoyed this guide, stay tuned for Part 2 of my “Budget Laboratory” series, where I’ll show you how to setup a virtual SAN using freeNAS and VMWare Workstation 7.