You can only add guest variables to machines that are undeployed.
To add Guest Variables through the UI, edit the virtual machine or container, and go to the Variables tab.
Enter the Key and Value, then click Add.
To delete a variable through the user interface, click the X in the left column beside the variable name.
To save the virtual machine or container with the variables added or deleted, click Save. The virtual machine will be reconfigured.
Reading VM variables in ESX guests:
The guest must have the VmWare Tools installed. Then you can run the following command in the guest to get the value of a variable:
vmtoolsd --cmd "info-get guestinfo.abiquo.<variable-name>"
Reading VM variables in XenServer:
The guest must have the XenServer Tools installed. The you can retrieve the variables as follows:
In Windows guests, you can use the WMI interface as explained here: http://support.citrix.com/article/CTX136422?_ga=1.183130470.1771169273.1424347211
In Unix guests, you can run the command: xenstore-ls vm-data
Reading VM variables in AMAZON:
Inside the guest, run the following command:
Details on how AWS manages the instance metadata can be found here, in the “Retrieving UserData” section:
Reading VM variables in Azure:
Azure will populate the variables to the templates that support Cloud Init. You can read them as follows:
In Windows VMs: You’ll find the variables in the file: %SYSTEMDRIVE%\AzureData\CustomData.bin
In Linux hosts, data is available in: /var/lib/waagent/ovf-env.xml
The data in those files is encoded in Base64 so you’ll have to decode it first. In some Linux images, though, data is already decoded and available in: /var/lib/waagent/CustomData
A new variables attribute has been added to the virtual machine entity. This variables attribute is a dictionary of virtual machine variables in key-value format.
You can create these values when you create a virtual machine (POST request) and update or delete them by updating the virtual machine (PUT request).
Example of variables in the virtual machine definition: