Sunday, May 17, 2015

How to Configure Access to iSCSI Target from VmWare ESXi

To access to an iSCSI target from VmWare ESXi server you need an iSCSI storage first. if you do not have have one, do not worry. You can use Openfiler or any other OS like FreeNAS to do so. 
You can find an instruction here to configure iSCSI target using Openfiler. 

Open vSphere Web Client, Choose datacenter and find your ESXi host. 

0. You may need to configure network interface first if you want to use the isolated network for iSCSI not the management interface. Go Manage > Networking and click on Add host networking button:

Then a wizard will show up. Choose VMkernel Network Adapter and click on Next and then select New standard switch and add as much NIC as you want then select Next and another Next and now set the IP address:

Click on Next then Finish. Now you may see such a picture if choose the new virtual switch:

In order to check connectivity, log on to OpenFiler console (or iSCSI target) and ping the IP that you just set (in this case:

1. Go to Manage > Storage > Storage Adapters and click on the plus sign and choose software iSCSI adapter and click on OK

An HBA adapter will show up under iSCSI Software Adapter section:

2. Select the HBA adapter, go to Targets, select Dynamic Discovery and press Add

Enter IP or FQDN of the iSCSI server and click on OK and the rescan the storage adapter:

If you choose the HBA and go to Devices tab you can see iSCSI target that we just added:

3. Now is the time to format the empty target disk with VMFS file system. Go to Related Objetcs > Datastores and rename the existing datastore to something like "local-datastore" just for better understanding. Then press the Create a new store button to open New Datastore wizard.  

Choose VMFS and press Next then choose a target from the list and name it:

Then choose the size on the next step and finish the wizard. You would have 2 datastores right now: one remote and one local as you can see in the following screenshot:

The iSCSI datastore is now ready to use. 
4. If you use an isolated ethernet network to connect your host and iSCSI target, you do not need authentication but if you share the physical network with others, you'd better configure CHAP authentication. If you use Openfiler go to Volumes > iSCSI Targets > CHAP Authentication and Create a username and password. 

Now you should enter the credentials in ESXI adapter. Go to Manage > Storage > Storage Adapters and choose the HBA adapter then select Properties tab and select Edit next to Authentication section. 

Choose the following method and enter the CHAP user and password then click on OK

Labels: , , ,