Windows Server 2012 as a Storage Device for vSphere Home Lab

Windows Server 2012 as a Storage Device for vSphere Home Lab

September 24, 2013 5 By Eric Shanks

If you’ve got a some hardware lying around for your lab, Windows Server 2012 may be a great solution for a home storage device.  You can now do both block (iSCSI) and NAS (NFS) on the same server, as well as having an OS to install some management apps on it.  In my lab, I use this management server to run Veeam for my backups, PRTG network monitor for bandwidth tracking, as well as using this server for both iSCSI targets and NFS mounts.

Home Lab Setup

Installation

Installing the necessary components on the server is very simple.

Go to the Server Manager and choose the “Add roles and features” link.

Server2012-NAS-iscsi1

Choose a role-based or feature-based installation.

Server2012-NAS-iscsi2

Select your localhost if your installing from the same machine, or use the remote host option if installing from a group member.

Server2012-NAS-iscsi3

Scroll down the list of roles and add:

  • iSCSI Target Server
  • iSCSI Target Storage Provider (VDS and VSS hardware)
  • Server for NFS

Server2012-NAS-iscsi4

 

Confirm your selections and click install

Server2012-NAS-iscsi5

 

You’ve got the services installed now.  The next steps are to setup an iSCSI target and and an NFS Mount.  Obviously both of these are not necessary, but if you can setup both, why not do both.

NFS Setup

NFS is pretty easy to get setup for a VMware ESXi lab.  Create a folder in the Windows file system; this is where your NFS mount point will be set.  Right click on that folder and choose properties.  Here you’ll see a tab called “NFS Sharing”.  You can click on the “Manage NFS Sharing…” button to setup the properties.

Server2012-nfs-setup1

Click the box to “Share this folder”.  Please note that this does not share the folder for Server Message Block (SMB) like you may be used to doing for standard Windows File Shares.  This is only the NFS Sharing setup.  If you want, you can share this as a Windows share as well but I recommend keeping your NFS shares separate to avoid accidentally deleting files used by your ESXi lab.

Server2012-nfs-setup2

 

Click the “Permissions” button to allow readwrite access to the NFS Share.  Change the “Type of access” box to “Read-Write” and be sure to tick the check box to “Allow Root Access”

Server2012-nfs-setup3

 

DONE!  You can now setup your vSphere environment to access this NFS mount.

Server2012-nfs-setup4

 

 

iSCSI Setup

To setup the iSCSI Targets, go to the “File and Storage Services” section of the Server Manager.  Click on the Hyperlink to create an iSCSI virtual disk.

Server2012-iscsi-setup1

 

Choose the server and physical disk location that you’d like to create a virtual disk on.  This virtual disk will be the iSCSI target so be sure to place it on the right sized and speed disk you’d like to use.  In my lab i’ve got a pair of mounts, one on an SSD and one on a traditional spinning disk.

Server2012-iscsi-setup2

Name the virtual disk.  This will end up being the file name.

Server2012-iscsi-setup3

Give the virtual disk a size.  Obviously you’re restricted to the size of the physical disk that it’s on.

Server2012-iscsi-setup4

Now you need to create an iSCSI Target.  Click the “New Target” section if it’s your first time running through this setup.

Server2012-iscsi-setup5

 

Give the target a descriptive name.

Server2012-iscsi-setup6

Now we need to list the initiators that will have access to this target.  We don’t want to allow all machines to access this iSCSI disk, so we’ll limit it to our ESXi host initiators.  Click the “Add” button.

Server2012-iscsi-setup7

Add the iSCSI initiators at the bottom.  If you’ve run through this before, you can look at the initiators that are cached in the middle section.

Server2012-iscsi-setup8

When you’re done you’ll see all of the initiators that have access.  Click “Next” to continue on.

Server2012-iscsi-setup9

 

If you are interested in setting up additional security, you can enable CHAP andor Reverse CHAP.  My lab is super secure so I’ve left it disabled.  🙂

Server2012-iscsi-setup10

Confirm your selections and click “Create”.

Server2012-iscsi-setup11

The creation process will complete.

Server2012-iscsi-setup12

 

DONE!  Now you have an iSCSI Target on the Windows 2012 Server.  Add this target to your vSphere environment and you’ve now got block storage for your hosts.

Server2012-iscsi-setup0