Minimal Nested vCenter 6 Lab – Configuring the iSCSI Storage and Adding Datastores

In the previous posts, we were able to make our vSphere hosts cluster up and running by creating a virtual datacenter, creating a cluster, then adding the ESXi hosts to it. We then configured the vMotion networking for VM mobility, and also iSCSI VMkernel networking for iSCSI storage connectivity. Well, this was only one part of the prerequisites as we mentioned the fact that a even through the cluster is configured, it needs to connect usually to a shared storage to offer the most common features, such as vMotion or HA.

A VMware datastore is created on any new installed ESXi hosts by default, but if you’re using more than one host, it’s more convenient to put the VMFS on ESXi shared storage, such as your SAN, than on the local data store. There is also the fact that with a centralized storage area network (SAN), different servers can access virtual machine disk files (VMDKs), which keeps VMs available even if a host goes down.

Shared storage in vSphere can be implemented with different technologies. It can be either:

  • Bloc based like FC (using FC, FCoE, or SCSI protocols) or iSCSI (using IP/SCSI protocols).
  • File based like NAS (using IP/NFS protocols).

In this post, we will implement an iSCSI shared storage using the iSCSI Target Server service role, that is part of the  in Windows Server 2012 R2. Just for info, iSCSI can also be implemented using a Linux distro called OpenFiler, but we’ll use Windows Server as it is much faster to implement in my opinion.

Before proceeding to install the iSCSI Target Role, I have added a 20 GB disk and added a vNIC in VMnet3 network (This is the iSCSI network) to the DC server. The disk will be used to host iSCSI LUNs later when I’ll do my configuration, and the vNIC will be assigned an IP of 192.168.1.1/24.

So, let’s add a 20GB HDD for iSCSI shared storage and a vNIC in VMnet3 virtual switch for iSCSI network connectivity.

iSCSI-vm-config iSCSI-vm-config

You’ll need to go Disk Manager to make the disk online and initialize it

Finally, we’ll create a simple Volume and assign it to S: drive

You may be wondering if 20GB is enough to host our VMs. The answer is yes. It is. This is because we are using DSL Linux, a tiny light small linux distro that consumes minimum resources in terms of RAM and disk.

Installing iSCSI Target Server Role

There are many tutorials out there explaining how to install and configure the iSCSI Target Server graphically from Server Manager, so let’s do it the easy the easy way and do it with PowerShell.

To install the role, run the following CmdLet:

Add-WindowsFeature -Name FS-iSCSITarget-Server -IncludeManagementTools

install-iscsi-target

Next, create a LUN of 10GB of size, name it LUN1 and put it on S:\iSCSI folder using the following CmdLet

New-IscsiVirtualDisk -Path S:\iSCSI\LUN1.vhdx -Size 10GB

iscsi-create-lun

Check if the LUN is actually created by browsing the S:\iSCSI folder

iscsi-lun-created

Then, create a target and specify which initiators can connect to it with the -InitiatorIds parameter

New-IscsiServerTarget -TargetName TestTarget1 -InitiatorId IPAddress:192.168.1.11,IPAddress:192.168.1.12,IPAddress:192.168.1.13,IPAddress:192.168.1.14

Finally, we need to assign the LUNs (I have created two) to the iSCSI Target.

assign-lun-to-target

You may also check that your LUNs are ready to be consumed by having a look at the ServerManager console

check-luns-in-server-manager

Connecting the ESXi Hosts to the Shared Storage

Go to the host > Manage > Storage> Storage Adapters > click on the iSCSI Software Adapter > in the Adapter Details, go to Target > Dynamic Discovery > Click Add

iSCSI-Target

Put 192.168.1.1 as the IP address of the iSCSI Target to add iSCSI-Target

Rescan to refresh the displayiSCSI-Target

If everything works fine, you should be able something under Devices tab

iSCSI-Target

and also under Paths tab

iSCSI-Target
Connection to the iSCSI Target Server is now done from ESX1. Follow the same steps to connect ESX2 too, and once done, let’s go ahead and add some datastores!

Adding the datastores

Go to the host > Manage > Related > Storage Adapters > Datastores > Click on Create a new datastore

vcenter-add-datastoreMake sure VMFS is selected and click Next

vcenter-add-datastore

The LUNs created previously in the DC Target Server will show up in this window. Select one of them and type a name for the datastore, then click Next

vcenter-add-datastore

Use all free space in the LUN

vcenter-add-datastore

Confirm your selection and click Finish

vcenter-add-datastore

The datastore is now attached to the host and is now visible from the ESX1. Do a rescan and the datastore should also be visible from ESX2.

vcenter-add-datastore

In the next post, we will create a virtual distributed switch and attach some VMs to it, then we will test network connectivity and vMotion in the last article of these series. See you in the next post!

Find this post interesting. Share it!

Leave a Comment

Your email address will not be published. Required fields are marked *