6.0

Table Of Contents
Getting Started with vSphere Command-Line Interfaces
52 VMware, Inc.
To manage a NAS file system
1ListallknownNASfilesystems.
esxcli <conn_options> storage nfs list
ForeachNASfilesystem,thecommandliststhemountname,sharename,andhostnameandwhether
thefilesystemismounted.
IfnoNASfilesystemsareavailable,thesystemdoesnotreturnaNASfilesystemandreturnstothe
commandprompt.
2AddanewNASfilesystemto
theESXihost.SpecifytheNASserverwith--host,thevolumetousefor
themountwith--volume-name,andthesharenameontheremotesystemtouseforthisNASmount
pointwith--share.
esxcli <conn_options> storage nfs add --host=dir42.eng.vmware.com --share=/<mount_dir>
--volume-name=nfsstore-dir42
ThiscommandaddsanentrytotheknownNASfilesystemlistandsuppliesthesharenameofthenew
NASfilesystem.Youmustsupplythehostname,sharename,andvolumenameforthenewNASfile
system.
3AddasecondNASfilesystemwithreadonlyaccess.
esxcli <conn_options> storage nfs add --host=dir42.eng.vmware.com --share=/home
--volume-name=FileServerHome2 --readonly
4 DeleteoneoftheNASfilesystems.
esxcli <conn_options> storage nfs remove --volume-name=FileServerHome2
ThiscommandunmountstheNASfilesystemandremovesitfromthelistofknownfilesystems.
Managing NAS File Systems with vicfg-nas
Youcanusevicfg-nasasavCLIcommandwithconnectionoptions.See“ConnectionOptionsforvCLIHost
ManagementCommandsonpage 18.
To manage a NAS file system
1ListallknownNASfilesystems.
vicfg-nas <conn_options> -l
ForeachNASfilesystem,thecommandliststhemountname,sharename,andhostnameandwhether
thefilesystemismounted.IfnoNASfilesystemsareavailable,thesystemreturnsthefollowingmessage:
No NAS datastore found
2AddanewNASfilesystemtotheESXihost.
vicfg-nas <conn_options --add --nasserver dir42.eng.vmware.com -s /<mount_dir>
nfsstore-dir42
ThiscommandaddsanentrytotheknownNASfilesystemlistandsuppliesthesharenameofthenew
NASfilesystem.YoumustsupplythehostnameandthesharenameforthenewNASfilesystem.
3AddasecondNASfilesystemwithreadonlyaccess.
vicfg-nas <conn_options> -a -y --n esx42nas2 -s /home FileServerHome2
4 DeleteoneoftheNASfilesystems.
vicfg-nas <conn_options> -d FileServerHome1
ThiscommandunmountstheNASfilesystemandremovesitfromthelistofknownfilesystems.