Getting metadata from within VMWare Guest OS

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

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


You can obtain some information (most importan, the VM UUID) by running dmidecode from inside the Guest OS. For example:

[root@localhost ~]# dmidecode
...
Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: VMware, Inc.
        Product Name: VMware Virtual Platform
        Version: None
        Serial Number: VMware-42 [REDACTED]
        UUID: [REDACTED]
        Wake-up Type: Power Switch
        SKU Number: Not Specified
        Family: Not Specified