is there any way to detect vmware tools version from esx host COS?
I tried with vmware-cmd and viewing config file from guest virtual machine, but it doesn't work
I dont want interactue with guest O.S.
Is posible from cos ?
Yes, though vmware-cmd won't have that information for you.
What you can use is vimsh, on classic ESX it's vmware-vim-cmd and on ESXi it's vim-cmd
First you need to retrieve the list of VMs you have, you can do so by running the following command and extracting out the "VmID" property:
vmware-vim-cmd vmsvc/getallvms
From this output, you will have the VmId as the first column and you will use that ID to get information about your VM, to check VMware Tools version and status IF it's running, you'll run the following command:
vmware-vim-cmd vmsvc/get.guest [VMID]
Here is an example execution looking for a VM called "vma40" and checking the VMware Tools version:
[root@himalaya ~]# vmware-vim-cmd vmsvc/getallvms | grep vma40
1872 vma40 [dlgCore-iSCSI-zebi96-VDI] vma40/vma40.vmx rhel5_64Guest vmx-04 This OVF file contains the vSphere Management Assistant (vMA) virtual machine.[root@himalaya ~]# vmware-vim-cmd vmsvc/get.guest 1872| grep -i tools
toolsStatus = "toolsOld",
toolsVersionStatus = "guestToolsNeedUpgrade",
toolsRunningStatus = "guestToolsRunning",
toolsVersion = "8193",
with powershell you can use this:
get-vm | % { get-view $_.ID } | select Name, @{ Name="ToolsVersion"; Expression={$_.config.tools.toolsVersion}}
powershell is for windows, isnt it?
i dont use windows. I want to get that info from COS.
Yes, though vmware-cmd won't have that information for you.
What you can use is vimsh, on classic ESX it's vmware-vim-cmd and on ESXi it's vim-cmd
First you need to retrieve the list of VMs you have, you can do so by running the following command and extracting out the "VmID" property:
vmware-vim-cmd vmsvc/getallvms
From this output, you will have the VmId as the first column and you will use that ID to get information about your VM, to check VMware Tools version and status IF it's running, you'll run the following command:
vmware-vim-cmd vmsvc/get.guest [VMID]
Here is an example execution looking for a VM called "vma40" and checking the VMware Tools version:
[root@himalaya ~]# vmware-vim-cmd vmsvc/getallvms | grep vma40
1872 vma40 [dlgCore-iSCSI-zebi96-VDI] vma40/vma40.vmx rhel5_64Guest vmx-04 This OVF file contains the vSphere Management Assistant (vMA) virtual machine.[root@himalaya ~]# vmware-vim-cmd vmsvc/get.guest 1872| grep -i tools
toolsStatus = "toolsOld",
toolsVersionStatus = "guestToolsNeedUpgrade",
toolsRunningStatus = "guestToolsRunning",
toolsVersion = "8193",
Perfect! it runs like I was searching.
Thansk