Abiquo Documentation Cookies Policy

Our Documentation website uses cookies to improve your experience. Please visit our Cookie Policy page for more information about cookies and how we use them.


Documentation

Skip to end of metadata
Go to start of metadata

Manage Variables in the UI

In Abiquo 3.4 you can set guest variables to pass user data to your virtual machines before deployment. This feature depends on the support of the hypervisor, cloud provider or Docker. Full support is available in all cloud providers, hypervisors and Docker, with the exception of KVM, which uses metadata, and Hyper-V.

Add variables UI

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.

Delete variables UI

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.

Read Guest Variables

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:
curl http://169.254.169.254/latest/user-data
Details on how AWS manages the instance metadata can be found here, in the “Retrieving UserData” section:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html

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

For more info see: http://azure.microsoft.com/blog/2014/04/21/custom-data-and-cloud-init-on-windows-azure/

Manage Guest Variables using the API

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:

... 
"variables": {var1: "one", var2: "two"}, 
...
  • No labels