As a small follow-up to yesterday’s post about NFS shares with Openfiler in the following article I will show how to add a new datastore to an ESX server using vSphere CLI from the vMA appliance and PowerCLI.
From the vMA shell we are going to use the command
vicfg-nas. To clarify things a bit for the newcomers,
esxcfg-nas are the same command, in fact
esxcfg-nas is no more than a link to the first.
The option to create a new datastore is -a and additionally the address/hostname of the NFS servers, the share and a label for the new datastore must be provided.
When the operation is done you can check the new datastore with
In the second part of the post we are going to use vSphere PowerCLI, which as you already know is a PowerShell module to manage vSphere/VI3 infrastructure. I will write more about PowerCLI in the since I’m very fond with it.
The cmdlet to create the new NFS datastore is
New-Datastore and you must provide the ESX host, the NFS server, the path of the share and a name for the datastore. Then you can check that the new datastore has been properly added with