Tuesday, October 11, 2011

Managing NFS/NAS datastore with vicfg-nas

Capabilities Supported by NFS/NAS
ESX/ESXi hosts support the following shared storage capabilities on NFS volumes:
n VMware VMotion
n VMware DRS and VMware HA
n ISO images, which are presented as CDROMs to virtual machines
n Virtual machine snapshots

Adding and Deleting NAS File Systems
The following scenario illustrates how to list, add, and delete a NAS file system with vicfg-nas.
To manage a NAS file system
1 List all known NAS file systems.
vicfg-nas <conn_options> -l
For each NAS file system, the command lists the mount name, share name, and host name and whether the file system is mounted. If no NAS file systems are available, the system returns the following:
No NAS datastore found
2 Add a new NAS file system to the ESX/ESXi host.
vicfg-nas <conn_options --add --nasserver dir42.eng.vmware.com -s /<mount_dir> nfsstore-dir42
This command adds an entry to the known NAS file system list and supplies the share name of the new NAS file system. You must supply the host name and the share name for the new NAS file system.
3 Add a second NAS file system with readonly access.
vicfg-nas <conn_options> -a -y --n esx42nas2 -s /home FileServerHome2
4 Delete one of the NAS file systems.
vicfg-nas <conn_options> -d FileServerHome1
This command unmounts the NAS file system and removes it from the list of known file systems.

C:\>vicfg-nas.pl --server esx1 --username root --password esxsvr40 --list
No NAS datastore found

C:\>vicfg-nas.pl --server esx1 --username root --password esxsvr40 --add --nasserver openfiler.virtuallab.com  -s /nfsvol  nfsstore-dir42
Unable to create datastore: An error occurred during host configuration.

C:\>vicfg-nas.pl --server esx1 --username root --password esxsvr40 --add --nasserver openfiler.virtuallab.com  -s /mnt/vg01/nfsvol/nfsshare   nfsstore
-dir42
Connecting to NAS volume: nfsstore-dir42
nfsstore-dir42 created and connected.
C:\>vicfg-nas.pl --server esx1 --username root --password esxsvr40 --list
nfsstore-dir42 is /mnt/vg01/nfsvol/nfsshare from openfiler.virtuallab.com mounted

C:\>
C:\>vicfg-nas.pl --server esx1 --username root --password esxsvr40 --delete  nfsstore-dir42
NAS volume nfsstore-dir42 deleted.

C:\>vicfg-nas.pl --server esx1 --username root --password esxsvr40 --list
No NAS datastore found

No comments: