Sie sind auf Seite 1von 4

Using NAS4Free as network attached storage for vmware over

iSCSI
While building a vmware 5 lab, I had the need for network attached disks, which would be used
as shared hypervisor storage for virtual machines. In this arena, there are several open source
options to choose from. However, at the time of this writing, it appears that NAS4Free is taking
charge and has pulled out away from the rest of the pack. In this article, we will discuss taking a
physical server (with lots of disk space) and turning it into a dedicated NAS device.
Starting with a computer that has plenty of disk space for this role will obviously be the most
beneficial. In my lab, that was a Dell PowerEdgeM600 with a couple of 146G drives installed -
configured as Raid0. This blade server is installed inside a M1000 chassis. After downloading
the NAS4Free iso, I proceeded to launching the iDRAC GUI for the server. For anyone not
familiar, this is a remote console that allows you to do just about everything that you could do if
sitting in front of the machine.
After the console was open and connected, I launched the virtual media wizard and connected
the cdrom to the NAS4Free iso. This step is just like inserting a CD into the local drive. After
the virtual CD was connected, the server was restarted and booted from it.
NAS4Free will present a menu after loading the FreeBSD kernel and associated modules. I
selected option 1 for booting via normal mode . After booting, another menu is presented that is
titled Console setup. The first step we want to do is option 9 - Install/Upgrade NAS4Free from
LiveCD. Another menu called NAS4Free Install Ugrade Options is presented, in which we want
to select option 2 - Install 'Embedded' OS on HDD/Flash/USB + DATA + SWAP partition.
By selecting this option, the installer will perform the following:
Create MBR partition 1, using UFS, 120MB size for OS image
Create MBR partition 2, using UFS, for DATA
Create MBR partition 3, as SWAP
Creates/Uses a RAM disk to limit read/write access to the device
This option will erase ALL partitions and data on the destination disk.
Note, I used option 2 because there wasn't any other media installed in this server to put the
OS on. Therefore, the internal disks are being used for both the OS and the data storage,
separated on different partitions. In a optimal scenario, you could select the option to install
onto a USB key - so that you could boot from that and use the internal storage solely for data
storage.
Select CD/DVD drive for installation
Select media where NAS4Free OS should be installed (da0)
Do you want to add a swap partition - answer No
Do you want to add a swap partition - answer No
After the installation is completed, there are instructions on how to mount the disk/partition
that was created for the data store. Exit the Menu and select to reboot the system via the
console setup menu.
All configuration is performed via a web interface after an initial network adapter is configured.
When the machine has completed booting from disk, select option 1 from the Console setup
menu to Configure Network Interfaces. Select the adapter that will be used as the
initial/primary network interface. If there are additional network interfaces connected and
available, you may select them next (OPT1, etc.) - otherwise at the Configure OPT interface,
select none and OK and then OK once more.
Next, select Configure Network IP addresses from the Console setup menu. Answer the
questions according to the characteristics of your individual network. After answering all
questions, the interface will initialize and you will be presented with a notice containing the URL
for accessing the administration portal.
Access the URL from a web browser and login with the default credentials: admin/nas4free
System --> General
Set Hostname/Domain, and Time/Timezone
Disks --> Management
Click Plus sign to add disk
In the Disk field, select the disk da0 from the drop down menu. Leave everything else as the
defaults (including the Preformatted file system field as Unformated). Click on the Add button,
then apply changes.
Disks --> Mount Point
Click Plus sign to add Mount Point
In the Disk field, select da0 from the dropdown menu.
In the Partition type field, select the MBR partition option.
In the Partition number field, enter the number 2
In the Mount point name, you may enter whatever you wish here - which will be used as the
subdirectory under /mnt to access this partition. In this step, I entered: data (so the mount
point will ultimately be /mnt/data/). Click on the Add button, then apply changes.
Services --> iSCSI Target
Check the Enable box in the iSCSI Target header (do NOT check the Enable box in the iSCSI
Target Logical Unit Controller header toward the bottom of the page).
Base Name - I left this as the default: iqn.2007-09.jp.ne.peach.istgt
Click on the Save and Restart button at the bottom of the page.
Services --> iSCSI Target --> Targets
Extent, click on plus sign
Extent Name - change to whatever you wish, I left as the default (extent0)
Type: File
Path: /mnt/data/extent0 (this path may be different, according to what you named the mount
point in a previous step)
File Size: Enter a size for the file, which will be created on the filesystem to store all the data in.
The size you enter here will be what is available to the iSCSI initiators. Obviously, the size
needs to be a value equal to or less than the available space on your mount point. I had 280G
free on /mnt/data and decided to make the file size 200G, so that I could come back and make
another 50+ gig lun at another time. Click on Add and then Apply changes
Services --> iSCSI Target | Portal Group | Add
Configure as necessary or Leave Defaults if OK and click Add. Explanation: this is basically
asking you where the initiator will run, so by default it will be the interface IP:3260 . Click on
Add and apply changes
Services --> iSCSI Target --> Initiators
Click on the plus sign under Initiator Group
Leave defaults Explanation: This is where you would configure allowed source
addresses/networks that initiators are allowed to connect from.
Click Add
Services --> iSCSI Target --> Target
Click on the Plus sign under Target
Configure as necessary or Leave defaults and click on Add and Apply changes
You should now be able to successfully connect from an iSCSI initiator to this disk!
To do this in vmware, configure an iSCSI Software adapter on the host, configure the VMkernel
Port Bindings in the Network Configuration tab. Finally, on the Static Discovery tab - click on
Add. Enter the IP of the NAS4Free machine (otherwise known as the IP configured in the
Portal Group previously). For the iSCSI Target Name, you can find it in the web administration
of the NAS4Free server by navigating to:
of the NAS4Free server by navigating to:
Services --> iSCSI Target. Under the Target section in the Name column will list the value that
goes in the the iSCSI Target Name field. In my scenario it was: iqn.2007-
09.jp.ne.peach.istgt:disk0. Click on Add and then OK to rescan. Once scan is complete and you
see a connection, navigate over to the Storage Configuration in vCenter to Add the new
Datastore.

www.xpresslearn.com


http://www.xpresslearn.com/storage/using-nas4fr
ee-as-network-attached-storage-for-vmware-over-isc
si/
http://goo.gl/ffgS

Das könnte Ihnen auch gefallen