Create VMFS Datastore Using PowerCLI

Share on:

For upcoming testing there was a need to create 140 datastores on a cluster for testing. Who wants to do that much clicking and typing? Not me! You can use the below PowerCLI commands to get the SCSI ID’s,  Create the Datastore and then Rescan all hosts in the cluster.

Get-SCSILun -VMhost 192.168.1.103 -LunType Disk | Select CanonicalName,Capacity
New-Datastore -VMHost Host -Name Datastore -Path CanonicalName -VMFS
Get-Cluster -name Cluster | Get-VMhost | Get-VMHostStorage -RescanAllHBA
comments powered by Disqus

See Also