VMware Cloud Community
bvi1006
Enthusiast
Enthusiast

Need a report on which vms I upgraded the hardware one

Hi,

We have had some issues with the hardware upgrades, I think, so I would like to run a report from VUM or otherwise to see which ones I upgraded. Any help would be appreciated!

Thanks

0 Kudos
9 Replies
RvdNieuwendijk
Leadership
Leadership

You can use:

Get-VM | Select-Object -Property Name,Version


to see the hardware versions of all your vm's.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
bvi1006
Enthusiast
Enthusiast

Thanks, but I need to know which ones I upgraded over the past weekend...

0 Kudos
bvi1006
Enthusiast
Enthusiast

I found this from LucD but there is a syntax error which I can't seem to fix:

$events = Get-VIEvent -Start (Get-Date).AddDays(-1) | `
     where {$_.EventTypeId -like "com.vmware.vcIntegrity*"} | `
     Sort-Object -Property CreatedTime
$events | %{
     New-Object PSObject -Property @{
          Date = $_.CreatedTime
          User = $_.UserName
          Host = $_.Host.Name
          Message = $_.FullFormattedMessage
     }
} | Export-Csv "C:\Update-Manager-report.csv" -NoTypeInformation -UseCulture
Error:



Does anyone know how to fix this? I am unclear as to what the &amp is doing...
Thanks
0 Kudos
LucD
Leadership
Leadership

Which error message are you getting ?

Try something like this

&{Get-VIEvent -Start (Get-Date).AddDays(-1) |
  where {$_.EventTypeId -like "com.vmware.vcIntegrity*"} |
  Sort-Object -Property CreatedTime | %{     New-Object PSObject -Property @{       Date = $_.CreatedTime
      User = $_.UserName
      Host = $_.Host.Name
      Message = $_.FullFormattedMessage
    }   }} | Export-Csv "C:\Update-Manager-report.csv" -NoTypeInformation -UseCulture


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

0 Kudos
RvdNieuwendijk
Leadership
Leadership

Probably something went wrong copying and pasting Luc's code. You need the replace all the " with double quotes. I modified Luc's code a little:

$events = Get-VIEvent -Start (Get-Date).AddDays(-1) | `
     where {$_.GetType().Name -eq "VmUpgradingEvent" -or $_.GetType().Name -eq "VmUpgradeCompleteEvent"} | `
     Sort-Object -Property CreatedTime
$events | %{
     New-Object PSObject -Property @{
          Date = $_.CreatedTime
          User = $_.UserName
          Host = $_.Host.Name
          Message = $_.FullFormattedMessage
     }
} | Export-Csv "C:\Update-Manager-report.csv" -NoTypeInformation -UseCulture


Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
bvi1006
Enthusiast
Enthusiast

Thanks. In either script I come up with no results, even going back 4 days. I can see that there was an event of this type on December 1st.

"Initiated VMware Tools install or upgrade". Initiated by com.vmware.vcIntegrity.

In this case there was a status of "error", but I'm looking for any status...

0 Kudos
RvdNieuwendijk
Leadership
Leadership

VMware Tools upgrade is something different than a VM hardware upgrade. Which of the two are you searching for?

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
bvi1006
Enthusiast
Enthusiast

hardware

0 Kudos
RvdNieuwendijk
Leadership
Leadership

Then it looks like none of your hardware upgrades were even started in the last four days.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos