VMware Cloud Community
quisstechsg
Contributor
Contributor

How to determine parent host for virtual machine in VCenter 6.7

Hi,

I'm looking for a reliable way to query our VCenter to report on currently assigned VM's to a host.  Ideally we'd do this via a shell script or other automated or scheduled query as we are looking to report the locations of VM's on a frequent basis (say every 60 mins).

I know you could do it an SQL query in previous versions (if you were running Windows) but there doesn't appear to be anything similar for the version which we are running (an appliance).

Can someone please advise?

Thanks in advance for any help.

Regards,

Simon

0 Kudos
1 Reply
berndweyand
Expert
Expert

get-vm | select name, vmhost

0 Kudos