Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Excerpt

You can set guest variables to pass user data to your VMs before deployment. This functionality uses cloud-init and requires appropriate templates. In private cloud, the VM templates must have the guest setup flag set to cloud init.

Tip

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 add, modify or delete guest variables, BEFORE you deploy the VM.

Add variables

To add variables:

  1. Edit the VM and open the Variables tab
    1. The dialog will display the default variables for your template

  2. For each variable:
    1. Enter the Key and Value, . 
      • The maximum length for VM variables is a key of 255 characters and value of 255 characters.
    2. Click Add
  3. To apply changes to variables, and other changes to the VM, click Save

Edit the VM to set variables that will be added to the VM at deploy timeImage Removed

Include Page
Add VM variables
Add VM variables

Edit variable values

To edit a variable:

  1. Click the pencil edit button next to the value
  2. Click ok
  3. To apply changes to variables, and other changes to the VM, click Save
Delete variables

To delete a variable:

  1. Click the X in the left column beside the variable name.
  2. 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.

Private cloud:

When using cloud-init, the variables are stored on the cloud-init ISO, which has the label "config-2". The variables file is "openstack/latest/vm-variables.rc"

When using hypervisor tools, you should use the appropirate method for your hypervisor, for example:

ESXi:

Run the following command in the guest to get the value of a variable:

Code Block
vmtoolsd --cmd "info-get guestinfo.abiquo.<variable-name>"
XenServer:
  • On Windows guests, use the WMI interface as explained here: http://support.citrix.com/article/CTX136422?_ga=1.183130470.1771169273.1424347211
  • On Unix guests, run the following command:

    Code Block
    xenstore-ls vm-data

    Public cloud:

    The variables are stored in the /opt/abiquo-env.rc file

    Include Page
    Read guest variables from a VM
    Read guest variables from a VM


    Related pages