Building a Template for Contextualization

In order to pass information to the instantiated VM template, the Context section of the vOneCloudVM Template can be used. These templates can be updated in the Virtual Resources -> Templates tab of the vOneCloud GUI, and they can be updated regardless if they are directly imported from vCenter or created through the vOneCloud Templates tab.

Note

Installing the Contextualization packages in the Virtual Machine image is required to pass this information to the instantantiated VM template. Make sure you follow the Guest Contextualization guide to properly prepare your VM templates.

../_images/vm_template_context.png

Warning

Passing files and network information to VMs through contextualization is currently not supported

Different kinds of context information can be passed onto the VMs:

Network & SSH

Networking information can be passed onto the VM, namely the information needed to correctly configure each one of the VM network interfaces.

You can add here an public keys that will be available in the VM at launch time to configure user access through SSH.

User Inputs

These inputs are a special kind of contextualization that built into the templates. At instantiation time, the end user will be asked to fill in information for the defined inputs, and the answers will be packed and passed onto the VM.

For instance, vOneCloud adminsitrator can build a VM Template that will ask for the MySQL password (the MySQL software will be configured at VM boot time and this password will be set) and for instance whether or not to enable WordPress:

../_images/admin_user_input.png

The end user will then be presented with the following form when instantiating the previously defined VM Template

../_images/end_user_input.png

Custom vars

These are personalized information to pass directly to the VM, in the form of Key - Value.

There are two special custom variables which are very useful for VM software provisioning. They are called START_SCRIPTS and START_SCRIPTS_BASE64 (they are equivalent, only the latter gets base64 decoded before being executed at boot time). They can be use for any general purpose (pull a Chef recipe and running it for instance, configure a software component, perform a configuration task in the OS, etc). For instance, the following will add a DNS name nfs-share pointing to a particular IP in a Linux based VM:

START_SCRIPT = “echo ‘nfs-share 10.0.1.23’ > /etc/hosts”