blog header
Subscribe via: (Email / RSS)

VCDX Enterprise Admin Notes: Configure NAS and iSCSI Datastores Using Command-Line Tools

by Harley Stagner on December 9, 2009

This exam note covers Objective 1.1.S.5 and 1.1.S.6. You need to know how to configure NFS datastores and iSCSI initiators using command-line tools. So, if you have your vmkernel and service console ports already set up for IP Storage, you can configure each (NFS and iSCSI) from the command-line.

Notes for Objective 1.1.S.5

Dealing with NFS from the command-line is actually quite easy.

  • esxcfg-nas -l (Lists all of the NFS Datastores that the vmkernel has mounted.)
  • esxcfg-nas -a  -o HostName or IPAddress -s ShareName Label (Where HostName is your NFS server’s host name, IPAddress is your NFS server’s IP Address, ShareName is the name of your exported directory (share), and Label is the label name you would like to give the NFS mount.
    • esxcfg-nas -a -o 192.168.1.100 -s /MyNFS NFS01
  • esxcfg-nas -d Label (Where Label is the label name of your NFS mount. Deletes an NFS mount from the ESX host.)
    • esxcfg-nas -d NFS01

Notes for Objective 1.1.S.6

  • vmkiscsi-tool -L -l HBA (Where HBA is the iSCSI HBA. The software initiator is vmhba32. Lists the iSCSI LUNs available to the ESX server.)
  • esxcfg-firewall -e swISCSIClient (Opens the Service Console firewall for the iSCSI initiator.)
  • esxcfg-swiscsi -e (Enable the software iSCSI initiator.)
  • vmkiscsi-tool -D -a IPAddress vmhba32 (Where IPAddress is the IP address of your iSCSI target device. Adds a discovery target to your iSCSI software initiator.)
    • vmkiscsi-tool -D -a 192.168.1.100 vmhba32
  • vmkiscsi-tool -T -l vmhba32 (Lists the targets that were discovered.)
  • esxcfg-rescan vmhba32 (Rescan the vmhba32 adapter.)
  • service mgmt-vmware restart (Restarts the ESX host agent so that vCenter reflects the changes.)

Leave a Comment