Add VM variables
Before you deploy a VM, you can set guest variables to pass user data to your VM. This functionality uses cloud-init and requires appropriate templates. In private cloud, the templates must have the guest setup flag set to cloud init. The administrator can add default variables for the VM template.
This functionality is available through the API. The platform stores variables in the VirtualMachine "variables" attribute, which is a dictionary of keys and values. See Update a virtual machine in VirtualMachinesResource
You can modify VM variables before you deploy the VM
To add VM variables:
Go to Virtual datacenters → edit a VM that is not deployed
Go to Variables
Enter a Key and Value
The length of these can be up to 255 characters each
Click Add
Add more variables as required
To delete a variable click the trash can symbol beside the Key. To edit the Value of a variable, click the pencil edit button beside the Value
To apply changes to variables, and other changes to the VM, click Save
Read guest variables
The variable location will depend on the method of guest setup that you are using for your VM. Here are some general guidelines.
Cloud | Method | Variable location |
---|---|---|
Private | Cloud-init |
|
Private | Hypervisor tools | On ESXi, run the following command in the guest to get the value of a variable: vmtoolsd --cmd "info-get guestinfo.abiquo.<variable-name>" |
Private | Hypervisor tools | For vCloud Director, hypervisor tools does not support variables |
Public | Cloud-init | The variables are stored in the /opt/abiquo-env.rc file |
Amazon | Cloudbase-init | On Windows, the variables are stored in the C:\ProgramData\Abiquo\abiquo-env.rc file |
Azure | Cloud-init | On Windows, according to the Azure documentation on custom data
On Linux, you can use cloud-init to read the variables from custom data. |