VMware Cloud Community
jvm2016
Hot Shot
Hot Shot

adding datastore_cluster_powercli

Hi Luc ,

i have 6 datastores that i need to add to a cluster of 6 esxi hosts.

are following two commands sufficient to add  VMFS_Datastore_1’ to enitrecluster .

New-Datastore -VMHost "esxi1" -Name ‘VMFS_Datastore_1’ -Path naa.60000xxxxxxxxxxxxxxxxx36 -vmfs

and then rescan all esxi in cluster to get vmfs_datastore_1 mounted to all 6 esxi in cluster

Get-Cluster -name “YourClusterName” | Get-VMhost | Get-VMHostStorage –RescanAllHBA

0 Kudos
4 Replies
LucD
Leadership
Leadership

Instead of RescanHba I think you need a RescanVmf

New-Datastore -VMHost "esxi1" -Name ‘VMFS_Datastore_1’ -Path naa.60000xxxxxxxxxxxxxxxxx36 -Vmfs

Get-Cluster -name “YourClusterName” | Get-VMhost | Get-VMHostStorage -RescanVmfs


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot

but this will add datastore to all 6 esxihosts .is that correct ?

0 Kudos
LucD
Leadership
Leadership

From my experience, when the LUN is shared, creating it on one ESXi node, it will become visible on all other ESXi nodes in the cluster shortly after that.
I don't even think you need to force the scan


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot

i did it the other day using vsphere client and i had to do rescan on other esxi hosts.

however i wil check it again .

0 Kudos