Need to mount an NFS share to all your hosts? Want to do it fast?
PowerCLI is a great tool for automating, speeding up, and executing tasks on a bunch of servers at the same time. The instructions below will show you how to mount an NFS share to all the hosts in your vCenter.
Step 0 : If you dont already have it installed, install PowerCLI. (https://my.vmware.com/web/vmware/details?downloadGroup=PCLI650R1&productId=614)
Step 1 : Open Power CLI
Step 2 : Connect to your vCenter, “connect-viserver vCenterServerName.fully.qualified.plop” (Authenticate when prompted)
Step 3 : Type out the following command, replacing the variables with your specific data. Mapping of variables just below:
Get-VMHost | New-Datastore -Nfs -Name STUFF -Path /Folder/Folder/Folder -NfsHost NFSserverName.fully.qualified.plop
Server : NFSserverName.fully.qualified.plop – IP will also work here
Folder : /Folder/Folder/Folder – Folder on NFS share you want to mount. This folder will be your root.
Mount Name : STUFF – The display name for the NFS mount.