Having a setup like a data centre including VMware vSpehre (ESXi), NAS (Network Access Storage), iSCSI disks and several server VMs on a single (or couple of) PC is a wonderful way to learn and test. It allows replicating the production environment for testing purposes on low-cost hardware.
In this article, I show you how to connect FreeNAS iSCSI disks to VMware vSphere/ESXi server. Though the server version is pretty old, most of the main steps remain the same for the latest versions.
In this test lab setup, I used VMware vSphere, FreeNAS and Windows 2008 R2 servers to install and test Exchange 2010 on the Microsoft cluster. The same setup should work with most of the current versions when you read this guide.
The Majors Steps:
- Installed VMware vSphere /ESXi4 on VMware workstation.
- Installed FreeNAS as a separate VM.
- Also, installed 3 Windows 2008 R2 Operating Systems on ESXi (one domain controller and two for the Exchange server cluster).
- Connected FreeNAS iSCSI disks to VMware ESXi and created Windows 2008 R2 clusters.
I have done these all steps on my single home computer.
Steps to Connect FreeNAS iSCSI Disks to VMware vSphere (or ESXi)
1) Install and configure VMware vSphere (ESXi) server. Read more here about the steps.
2) Install and configure FreeNAS iSCSI disks on VMware workstation or any other networked computer. Make sure VMware vSphere and FreeNAS VM can communicate via the network. Read more here about configuring iSCSI disks in FreeNAS.
In this example, I created a 20GB iSCSI disk in FreeNAS and my final iSCSI setup screen is shown below.
3) Let’s connect the ESXi server by the vSphere client. Then go to the configuration tab.
4) Click to storage Adapters option. Select Add storage and try to add Disk/LUN. Nothing will show up on the next screen till you enable the iSCSI adapter in Storage Adapters. So, Click on Storage Adapters and go to the next screen.
5) Click on the iSCSI Software Adapter and click properties as shown below.
6) By default iSCSI adapter is disabled in VMware vSphere (ESXi) server. Press the Configure button, select Enable and Press OK.
7) Now again select the iSCSI adapter and navigate to properties. After you enabled the iSCSI adapter in the earlier steps, you could see the name now.
Go to the ‘Dynamic Discovery’ tab of the Properties. Press Add button.
8) In ‘iSCSI Server’, type your FreeNAS server address where you set up iSCSI disks.
9) Once successfully added, go to the ‘Static Discovery’ tab and make sure it detected the iSCSI disk.
10) It may ask to rescan the adapter, click yes for that. Now you can see the FreeNAS iSCSI disk listed under devices.
11) So far, we set up the VMware vSphere (ESXi) server to detect FreeNAS iSCSI disk through its software adapter. Still, the iSCSI disk is not added as storage in the ESXi server.
To add this iSCSI disk as vSphere storage, visit the Storage option under configuration. Click on Add storage as shown below.
12) Select Disk/LUN and press Next. Now the iSCSI disk will appear. Select it and click Next. The following message will appear once the disk is successfully added.
13) Provide a name for the datastore and click Next.
14) Next screen is to format the disk, leave the default block size and enable maximum size.
15) Once all is done successfully, the final display will show the data store details. Now we successfully added FreeNAS iSCSI disks to VMware vSphere (ESXi) data centre. Click Finish to complete the setup.
16) The FreeNAS ISCSI disk will be listed under vSphere datastore where you can work as a normal datastore.
I’m sure these steps are helpful to add FreeNAS or any other iSCSI disks to VMware vSphere (ESXi) server. Don’t forget to take a snapshot of the ESXi virtual machine before and after these steps.
9 thoughts on “How to Connect FreeNAS iSCSI Disks to VMware vSphere (ESXi)”
Thanks for your articles on how to get a free NAS up and running within VMWare. Really appreciate it, I’m working on Exchange 2007 clustering FE/BE configuration and then moving on to Exchange 2010 in the same fashion. This is really helpful. I want to send a pingback to you from my site as well, this is really good information.
Thanks for your comment.
With the same method I managed to install Exchange 2010 on Cluster with FreeNAS. It’s cool, isn’t?
I love pingbacks.
Very very good article. Plus Picture, i like it., Thank you very much Dinesh.
I really liked the article. It helped me add an iscsi target disk to my ESXi 4 servers.
I also really liked the article. Now I have job to do this weekend.
I would say thanks Dinesh,
Renato from Brazil.
Thanks for the article, but got question. As you mentioned in your article “Installed three Windows 2008 R2 operating systems in ESXi4. ( one as domain controller and two for Exchange cluster)”. Nested VM doesn’t allow x64bit OS like 2008 R2. How did you install 2008 R2 inside ESXi4 and inside VMware workstation?
You could even run FreeNAS as VM on the ESXi vSphere Host itself. Give all disk space to the FreeNAS server and provide the disk space back to ESXi using iSCSI 🙂
This way you need only one machine and can take advantage of ZFS and file system snapshots on the datastore.
The material is really good but I have some issues to finish this works. Currently, we have an FreeNAS and vsphere 4.1. and I create a LUN 2TB on the FreeNAS but I have an error on the step “12) Select Disk/LUN and press Next.” .
The error is “Error adding a datastore in VMware ESXi 4.1 – Call “HostDatastoreSystem.QueryVmfsDatastoreCreateOptions” for object “ha-datastoresystem” on ESXi failed”.
How can solve this error?.
When creating volumes for the datastore in VMWare, you should ensure the volume is slightly smaller than 2Tb, or ESX/i 4 will throw an error.
See this VMWare KB:
Hope that helps..
Comments are closed.