Skip to content

Instantly share code, notes, and snippets.

@lrivallain
Last active August 29, 2015 14:04
Show Gist options
  • Save lrivallain/ddbca9b4ce214ed073b4 to your computer and use it in GitHub Desktop.
Save lrivallain/ddbca9b4ce214ed073b4 to your computer and use it in GitHub Desktop.
Add a new datastore to a set of ESXi based on cluster membership
Add-PSSnapin VMware.VimAutomation.Core
$vcenter='127.0.0.1'
$cluster='A_cluster_name'
$datastorename='A_datastore_name'
$nfshost='10.0.0.1'
$nfspath='/vol/a_vol_name/a_qtree'
Connect-VIServer $vcenter
Get-Cluster -Name $cluster | Get-VMHost | New-Datastore -Nfs -Name $datastorename -Path $nfspath -NfsHost $nfshost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment