Use Console to Connect ESX to a NAS

UPDATED 12/5/2009 to include vSphere commands.

This is a quick note, mostly to help remind me and hopefully help someone else out.

You can use standard Linux commands to connect an ESX host to a NAS (Network Attached Storage) device.  You can use a NAS to store things like ISO’s and backups.  I have many gig’s of ISO’s and I really don’t like them taking up valuable storage on my ESX host.  In production, they’d be taking up SAN space, so I offload them to a Buffalo Terastation, and use Linux commands to mount the Terastation so that ESX can utilize it.

First you can make a directory under vmimages.

mkdir /vmimages/ISO2

ISO2 is the directory that you are creating.  For me, ISO already points to a local directory on my server where I keep one or two ISO’s that I am continually using.  Then you can run the command:

(ESX 3.5)  mount –t smbfs //[nas]/[folder] /vmimages/ISO2
(vSphere) mount –t cifs //[nas]/[folder] /vmimages/ISO2

[ad#Google Adsense-1]

[nas] refers to the IP address or netbios name of your NAS server and [folder] refers to the folder that you want to mount.  Make sure you have permissions, i.e. anonymous, or know the admin/root password on the NAS, or have a specific username and password that you can use.  My final command looked like:

mount –t smbfs //nas01/Applications /vmimages/ISO2

I was then asked for my password.  I used the account password on the Terastation that matched my login account on the console and it let me right in.

If you need to use a custom username and password and the user name doesn’t match the name that you are logged into the console as, try the following format:

mount –t smbfs //[nas]/[folder] /vmimages/ISO2 –o username=[uname],password=[pwd]

Don’t forget to replace the items that are between the [brackets] with your implementation specific information.  Also, make sure that you remember that this is Linux, and everything is case sensitive!

After connecting to the NAS, you should be able to browse it with the vSphere Client and mount ISO’s while editing your VM settings.  Hope this saves someone some time besides me. 😉

For vSphere, make sure you use ‘cifs’ instead of ‘smbfs’ when mounting.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s