VMware Cloud Community
bright_terry
Enthusiast
Enthusiast

using a list of esxihost

Hi

please i need a way for the below code to be able to get a list of esxi node the one i have gives a specific host node is there a way i can get that?

 

Get-VMHost -Name <MyEsx> -PipelineVariable esx |
Get-VMHostHba | Get-ScsiLun |
Where-Object { $_.VsanStatus -eq "Eligible" } |
   Select @{N='VMHost';E={$esx.Name}}, 
   CanonicalName, CapacityGB, MultipathPolicy,
   @{N='Type';E={if($_.IsSsd){'Flash'}else{'HDD'}}} |
ConvertTo-Json

 

0 Kudos
3 Replies
ganapa2000
Hot Shot
Hot Shot

Hi,

you can use the below to get the details from all ESXi hosts

Get-VMHost -PipelineVariable esx |
Get-VMHostHba | Get-ScsiLun |
Where-Object { $_.VsanStatus -eq "Eligible" } |
Select @{N='VMHost';E={$esx.Name}},
CanonicalName, CapacityGB, MultipathPolicy,
@{N='Type';E={if($_.IsSsd){'Flash'}else{'HDD'}}} | ft -auto

 

 

 

0 Kudos
bright_terry
Enthusiast
Enthusiast

thanks you for your feedback but its giving me this error 

 pipeline position 1
0 Kudos
ganapa2000
Hot Shot
Hot Shot

can you try now, I made a change

 

0 Kudos