`
xitong
  • 浏览: 6195951 次
文章分类
社区版块
存档分类
最新评论

How to configure FreeNAS 8 for iSCSI and connect to ESX(i)

 
阅读更多

How to configure FreeNAS 8 for iSCSI and connect to ESX(i)

FreeNAS is working a bit differently than Openfiler when it comes to configuring iSCSI connection to ESXi host.

When I finished building my homelab recently, I at first tested several distributions but finally sticked with FreeNAS which I think has the coolest user interface, and which can be up and running in less than 10 minutes. There is an iSCSI configuration which works a bit differently than what I use to experiment with Openfiler. So if you’re new to FreeNAS or Learning ESX(i) and if you have experienced a bit in your homelab and installed a FreeNAS 8 with RaidZ spindle you might want to read on.

I’ll try to show you how I achieved this iSCSI configuration on my homemade NAS box running Intel Atom 1.6GHZ double core CPU. At first after creating RAID Z volume, which you could see in my previous article, I went the and created NFS share.

For iSCSI there are different configuration possibilities in FreeNAS 8. If you’re have some individual disks or(and) RaidZ spindle. If you’re having an individual disks like I do, (I have 2 individual SSD’s on 2 SATA ports) you can export the whole disk as an iSCSI disk, and so you will create a device extent. But you can’t do it for ZFS pool. You have to create a file and then export the file.

On the FreeNAS website, you can see that the file extent is slower than device extent.

A quick quote from FreeNAS documentation:

A device extent allows a raw partition (volume) to be exported via iSCSI. The advantage of device extent is that they are faster than file extents. The disadvantage is that the entire volume is exported. If you only want to share a portion of a volume using iSCSI, you will need to create a file extent instead.

A file extent allows you to export a portion of a volume. When creating a file extent, you specify a file name that iSCSI clients will have access to (similar in concept to a mount point) and the maximum size of that file (storage area). The advantage of file extents is that you can create multiple exports per volume. The disadvantage is that they are slower than device extents.

This makes me think, in my case, I better configure my individual SSD’s as an iSCSI targets and the raid Z volume as an NFS …. -:) to get the most out of my SSD’s and use the RaidZ spindle for more/less some storage, since those 4 SATA drives with 7200 RPM won’t deliver much IOPS anyway.

Ok Let’s go and configure one disk as an iSCSI Target. Not so difficult.

The steps:

01. Portal group creation.

Go to the Portals > Add Portal.

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

02. iSCSI initiator.

Go to the menu Initiators > Add Initiator.

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

The next step is to create an iSCSI target.

03. Create an iSCSI Target.

Menu Targets > Add Target.

Once the target created, you must create an extent. As I mentioned before, the device extent is apparently faster, so I go for it and create a device extent. The downside is that the whole disk is exported. Does not really matter in my case, since the disks size is only 128 Gigs.

04. Device Extent.

To add a device extent, go to Services > ISCSI > Device Extents > Add Device Extent

In the example below I’m creating a device extent for the whole SSD which has got a 128 Gigs of total storage capacity.

How to configure FREENAS 8 to export iSCSI disk

05. Target/Extent Association.

After the Extent created, the next step is the Target-Extent association. Once this done, one last step is to activate the iSCSI service.

How to configure FreeNAS for iSCSI

06.Activate the iSCSI service.

The iSCSI service can be activated in this menu.

How to configure FreeNAS for iSCSI

07. Connection from the VMware ESXi Server.

That’s it for the FreeNAS part, concerning that single SSD disk. The next step are on the VMware vSphere console. Connect to your individual ESX(i) server or through vCenter. This part is actually the same as described in the Openfiler’s configuration.

Go to the Configuration >Storage Adapters and enable the iSCSI storage Adapter first.

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

Then Enter the IP adress of your NAS device – it’s 10.10.8.10 in my case – as on the image below…

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

Once validated, you’ll get a prompt to rescan your iSCSI adapters. You can do so. You should be able to see the iSCSI Disk as on the image below.

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

08. The last step is to create a Datastore through the VMware vSphere Client.

Go to the Storage Menu > Add Storage > Choose Disk/Lun, create a new partition and format the newly created partition with VMSF file system.

How to configure FreeNAS 8 iSCSI connection to ESX(i) server

You’re done.

You should see the newly created Datastore in the VMware vSphere Client’s user interface.

This article is part of the Home made Do It Yourself NAS series.

Last note: I was able to connect both single disks with “device extent” configuration and being exported as different targets, but I did not manage to Add the RaidZ volume At the Same time. So I went and shared that volume as an NFS share….



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics