VMware Cloud Community
orian
Hot Shot
Hot Shot

Export Esxi information

Hello

there is a script that can export the next Data from my Esxi Servers?

  • Cluster
  • Host
  • CPU Model
  • ID CPU
  • Cores per CPU
  • Esxi Total Memory
  • Current CPU power man policy
  • Esx Version
  • Boot Time Or Uptime
  • DNS Servers
  • NTP Servers
  • Bios Version
  • Bios Date

thank you!!

8 Replies
GaelV
Enthusiast
Enthusiast

Hi,

Most of the informations you need can be provided by the software RVTools (you can export in a .csv /excel file any informations)

Here's the link

https://www.robware.net/rvtools/download/

orian
Hot Shot
Hot Shot

Hello

with rvtools the (,) is prevent me to import the data to sql servers and use it in reporting services.

i prefer script instead

thank you

Reply
0 Kudos
GaelV
Enthusiast
Enthusiast

Hi,

You can try this, the display is not very good but you got all the information :

You have to write your cluster or * in the $esx line

$esx = Get-Cluster "YourCluster or * " | Get-VMHost

foreach ($esx in $esxHosts) {

    $esx | Select Name,ProcessorType,NumCpu,MemoryTotalGB,Version,Build

    $esx | Get-View | Select @{N="Uptime"; E={(Get-Date) - $_.Summary.Runtime.BootTime}}| fl

    $esx | Select @{Name="NTPServers"; Expression = {($esx | Get-VMHostNTPServer)} } | fl

    $esx | Get-VMHostNetwork | Select DnsAddress | fl

    $esx | Get-VMHostHardware | Select BiosVersion | fl

}

It only misses   ID CPU and   Bios Date, i'm working on this..

Reply
0 Kudos
LucD
Leadership
Leadership

Try something like this.
Bios information depends on the HW vendor and the HW type, it is not avaialble for all HW.

Get-VMHost |

Select Name, @{ N = 'Cluster'; E = { (Get-CLuster -VMHost $_).Name } },

ProcessorType,

  @{N = 'CoresPerCPU'; E = { $_.ExtensionData.Hardware.CpuInfo.NumCpuCores } },

  MemoryTotalGB,

  @{N = 'PowerPolicy'; E = { $_.ExtensionData.Config.PowerSystemInfo.CurrentPolicy.ShortName } },

  Version,

  @{N = 'BootTime'; E = { $_.ExtensionData.Summary.Runtime.BootTime } },

  @{N = 'DNSServers'; E = { $_.ExtensionData.Config.Network.DnsConfig.Address -join '|' } },

  @{N = 'NTPServers'; E = { $_.ExtensionData.Config.DateTimeInfo.NtpConfig.Server -join '|' } },

  @{ N = 'BIOSVersion'; E = { $_.ExtensionData.Hardware.BiosInfo.BiosVersion } },

  @{ N = 'BIOSDate'; E = { $_.ExtensionData.Hardware.BiosInfo.ReleaseDate } }


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

orian
Hot Shot
Hot Shot

You have this info in uc4.

Moreover, these paramaters can be export easily with vmware orchestrator Smiley Happy

Good luck!

Reply
0 Kudos
LucD
Leadership
Leadership

Not sure what you mean by CPUId?
Is that the CPU Tag?
Perhaps show an example?


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

Reply
0 Kudos
orian
Hot Shot
Hot Shot

CPU count

Reply
0 Kudos
LucD
Leadership
Leadership

If you mean the physical CPU packages, you can add this line

@{ N = 'CpuPackages'; E = { $_.ExtensionData.Hardware.CpuInfo.NumCpuPackages } },

otherwise you can use the property NumCpu (which is packages X corespercpu)


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