«

»

Jul 29 2012

Creating/Configuring iSCSI in VMware vSphere/ESXi 5

Sooner or later we all need to increase the space on our ESX/ESXi host(s). Let’s say you work for a small company that can’t afford a SAN, and right now your ESXi hosts are running on DAS (Direct Attached Storage) which is getting low on space. The best and cheaper option is to use iSCSI storage. By using iSCSI you can attach storage to your ESX/ESXi host(s) trough the network; yes, all data form the iSCSI device (called the iSCSI target) to your hosts and vice versa it’s passed trough a network cable. This is OK since now you can buy a 10 GB network adapter at a reasonable price.

For this demonstration I will use a separate network just for the iSCSI traffic, by adding another network card on my ESXi server. I recommend you do the same in a production environment, because you don’t want that traffic on your LAN network. To get started let’s create the iSCSI network and Port Group in vCenter. Click on the ESXi host that you want to attach the iSCSI storage, go to the Configuration tab and click on Networking. Now click Add Networking.

Choose VMkernel and click Next.

Like I told you before, a separate network card is recommended for the iSCSI traffic. Here I’m going to choose my second adapter (vmnic1) installed on the ESXi host.

On the Network Label box type a name for the Port Group. If you are using VLANs type the VLAN number in the VLAN ID box, but in this example is not necessary.

Here type the VMkernel IP address. This should be an IP address from the subnet you are using for the iSCSI network. My iSCSI target is located at 1.1.1.1 so I gave the VMkernel an IP of 1.1.1.2.

On the Summary screen click Finish to create the network.

The iSCSI network should be visible in the Networking section in vCenter.

Now go to the Storage Adapter section and click the Add link at the top.

Since I don’t have a fiber storage adapter connected to my ESXi host, on the Add Storage Adapter window I have the option to only add iSCSI adapters. Click OK twice to add the storage.

     

Now that we have the iSCSI Storage Adapter installed we need to configure it. Click Properties to open the iSCSI Initiator window.

On this window make sure the Initiator is enabled. If not click the Configure button and check the Enable box then hit OK.

     

Go to the Network Configuration tab and click Add.

From the list select the iSCSI network we created earlier and click OK. If you don’t see it here, is not configured correctly.



Remember, you can’t have more than one network adapter bind to a Port Group used for iSCSI. You may want to add more than one adapter for Fault Tolerance and Load Balance, but is not going to work. On how to configure Fault Tolerance and Load Balancing on iSCSI networks also called Multipathing (MPIO) please read this guide.

In the Dynamic Discovery tab click the Add button, and in the iSCSI Server box type the IP or name of your iSCSI target and click OK then close. On the message that appears choose Yes to rescan the adapter.

     

After the rescan is done, all the targets should appear on the View section at the bottom.

Now we can create Datastores. Go to the Storage section and click Add Storage.

Leave the default option here and continue.

Select one of the available disks (iSCSI target in this case) if you have more than one and click Next.

Format the disk using VMFS 5 file system. This is only if your ESX host is at least 5.0, if not you will need to format the disk with VMFS 3 file system.

Click Next at the Current Disk Layout page.

Give the Datastore a name and click Next to continue.

Here I want to use all the maximum available space for this Datastore.

On the Ready to Complete page click Finish to create the Datastore.

Repeat this operation for the rest of the disks you have. At the end they should all appear on the Datastores section on the ESXi host.

Want content like this delivered right to your

email inbox?


8 comments

Skip to comment form

  1. Osama

    Thank you .. after i finished everything .. esxi can see the storage .. but when i creat a new vm its not power on .. error can’t swab 0 kb to xxxx … sound like it can’t write on the storage!
    Can you help me

    1. Adrian Costea

      Hi,
      Try to upload something on the LUN see if it works and if not you will have to configure your storage to allow writes. Can you put the error message here?

  2. G Blank

    This was exactly the information I was looking for. I now have a working ESX server attached to my iSCSI array utilizing the 2nd NIC on my Host Server.

    Thank you for the excellent directions

    1. Adrian Costea

      I’m glad I could help. Now you can use Server 2012 R2 as an iSCSI Target and it works great.

  3. Cristiano Santos

    Very helpful! Thanks!

  4. Arghya Chatterjee

    Excellent and very helpful work

  5. Arghya Chatterjee

    Excellent .This should include how to enable iscsi adapter.

    1. Adrian Costea

      I wish I had an iSCSI adapter at home so I can show you, but the cost is to high. Thanks for passing by.

Leave a Reply

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

*

css.php