VMware Tools 11 - Tagging with AppInfo
This post follows on from my blog about the new AppInfo component in VMware Tools 11.0
VMware Tools 11 - New AppInfo component
Now that we can see process info from inside a guest OS the question becomes - what can do with it?
I’ll lay out here a technique to read the appInfo and if a process matches a known process then add a tag. For example if there is a mssqlserver.exe process then we know the VM is running MS SQL Server. Once we surface this information as a tag then it is a lot easiest to take action.
Set-ApplicationTag
I wrote a small function to automate the reading of appInfo and assigning tags.
The tags need to already exist in vCenter.
How to use Set-ApplicationTag
For ease of explanation I’m going to show how you can assign a tag PowerShell when you find powershell.exe running in a VM.
Based on a simple set of mappings from Process to Tag which can be easily kept in a CSV file -
TagMappings.csv
Process,Tag
mssqlserver.exe,MS SQL Server
oracle.exe, Oracle DB
tomcat6.exe, Tomcat
powershell.exe,PowerShell
iexplore.exe,Internet Explorer
The tags need to already exist in vCenter.
The VM starts with no tags assigned.
Then we load the tag mapping and run the script.
And check the VM again and see that the PowerShell tag has been assigned to the VM.