VMware Cloud Community
tima83
Enthusiast
Enthusiast

How to capture the VM machine & ESX host details from Virtual Center

Hi,

Can somebody share with me the process document or way,

to take the VMmachine & ESX host details from Virtual Center. How we can capture and save it for our own inventory ?

Regards

Nikhil Rattan Bhardwaj

0 Kudos
2 Replies
AndrewJarvis
Enthusiast
Enthusiast

We pull this data directly from the the VC database via a SQL query - we have a custom view we created in the VC database (it get around some issues with DNS name versus VM name mismatches, missing DNS names, and chops the DNS suffix off but you don't have to do this). We then link this view to our CMDB so it has a live feed of which host a VM is on.

See below - should give you the basic idea......it effectively lists VMs against hosts......

SELECT TOP (100) PERCENT UPPER(SUBSTRING(dbo.VPXV_HOSTS.NAME, 1, CHARINDEX('.', dbo.VPXV_HOSTS.NAME) - 1)) AS HOST_NAME,

UPPER(SUBSTRING(dbo.VPX_VM.DNS_NAME, 1, (CASE WHEN CHARINDEX('.', dbo.VPX_VM.DNS_NAME) = 0 THEN 1 ELSE CHARINDEX('.',

dbo.VPX_VM.DNS_NAME) END) - 1)) AS VM_NAME, dbo.VPXV_VMS.NAME AS VM_Description, LOWER(dbo.VPX_VM.DNS_NAME) AS DNS_NAME

FROM dbo.VPXV_VMS INNER JOIN

dbo.VPXV_HOSTS ON dbo.VPXV_VMS.HOSTID = dbo.VPXV_HOSTS.HOSTID INNER JOIN

dbo.VPX_VM ON dbo.VPXV_VMS.VMID = dbo.VPX_VM.ID

WHERE (ISNULL(CHARINDEX('.', dbo.VPX_VM.DNS_NAME), 0) <> 0)

ORDER BY dbo.VPXV_HOSTS.NAME

aldikan
Hot Shot
Hot Shot

Hi,

Depends on what info you require you can use VC to export info of your virtual machines:

-Use VC client

-click on you cluster

-choose "Virtual Machines" tab

-highlight VMs you want documented

-click File-Export-Export list

-choose the format you need (xls...etc)

please note that you have option for viewing additional columns in "Virtual Machines" tab, just right click on existing tab and it will bring menu.

Same as above, you can export your ESX hosts info.

-


Please rate helpful posts----


Alex