Add an NFS data store to every node in a VMware cluster

This will create the data store with the given name on each host in the given cluster attached to the given vCenter server:

Run the VMware vSphere PowerCLI
PowerCLI> connect-VIServer <vCenterServerName>
PowerCLI> Get-Cluster -Name <ClusterName> | Get-vmhost | foreach-object {
>> new-datastore -VMHost $_.Name -Name "<DataStoreName>" 
                -Path "<NfsExportPath>" -Nfs -NfsHost "<NfsServerFQDN>"
>> }

No comments: