Getting metadata from within VMWare Guest OS

Solution 1:

I imagine you could use the vSphere SDK for Perl inside your VM to query those items:

http://www.vmware.com/support/developer/viperltoolkit/

You could ask here:

http://communities.vmware.com/community/developer/forums/vsphere_sdk_perl

Solution 2:

You can set a VM's guestinfo property from the outside (e.g. with govc) and query it from the inside (requiring open-vm-tools):

Outside:

govc vm.change -e 'guestinfo.foo=bar' <yourVM>

Inside:

vmtoolsd --cmd "info-get guestinfo.foo"

Source: https://www.virtuallyghetto.com/2011/01/how-to-extract-host-information-from.html, RedHat's OpenShift on vSphere Installation Guide