Create VMFS Datastore Using PowerCLI
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.
How do i get the CanonicalName for allocated disks?
Get-SCSILun -VMhost 192.168.1.103 -LunType Disk | Select CanonicalName,Capacity
How do I create a VMFS datastore for the CanonicalName I identified above?
New-Datastore -VMHost Host -Name Datastore -Path CanonicalName -VMFS
How do i rescan all the hosts in the cluster to see the new datastore?
Get-Cluster -name Cluster | Get-VMhost | Get-VMHostStorage -RescanAllHBA
Share this postcomments powered by Disqus
- Get NAA.ID for Virtual Machine RDM's in VMware
- vSphere 5.x Storage vMotion Does Not Rename Virtual Machine Files.
- HA Error: Datastore Heartbeat is less than 2