VMware Cloud Community
srajsenthil
Contributor
Contributor

Get vm events for duplicate VM

There are few vms in vcenter that has got duplicate vm names. In order investigate on these duplicates, I am trying to get all events from the time they were provisioned.

From vSphere client, it shows quite many logs but I think they were not complete.

In VM there are few file systems shows date much older(relatively speaking around a month old) that.

When I ran simple command `Get-VIEvent -Entity <VM-NAME>`  getting error as below

Get-VIEvent : 2/14/2017 11:17:24 AM    Get-VIEvent        Could not find VIObject with name

At line:1 char:1

+ Get-VIEvent -Entity <vm-name>

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (vm-name:String) [Get-VIEvent], VimException

    + FullyQualifiedErrorId : Core_ObnSelector_SelectObjectByNameCore_ObjectNotFound,VMware.VimAutomation.ViCore.Cmdlets.

  Commands.GetEvent

Is there a way to get ALL events for the duplicate VMs?

Thank you,

Senthil

Reply
0 Kudos
2 Replies
srajsenthil
Contributor
Contributor

The command error is thrown only for duplicates and for other vm it works.

Is there anyway to address this?

I checked the ip addresses, for one vm, it is has alpha-numeric character and the other ip address looks ok with standard format.

Reply
0 Kudos
LucD
Leadership
Leadership

To find VMs with duplicate displaynames, you could do

Get-VM | Group-Object -Property Name |

where{$_.Count -gt 1} | Select Name


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

Reply
0 Kudos