|Assignee:||Tino Vázquez||% Done:|
|Category:||Core & System|
|Target version:||Release 1.4|
Currently OpenNebula offers basic support to context the VMs. It'll be useful to provide the users with a simple way to push context data in the VM.
OpenNebula will use a context block device (CBD) for this (say a iso image) that is build on the fly with for exampl: the hostname, IP address, the IP of other VMs, license for software installed in the VM or SSH keys. The CBD will be built on-the-fly by the transfer manager scripts, so you can easily adapt the process.
In this way, you only have to put a context script in your VMs that mounts the CBD, access the data in it, and perform the configuration actions.
CONTEXT = [
VARIABLE = <variable>
FILE = <path to file to be included in the iso>
DIRECTORY = <path to directory to be included in the iso>
TARGET = <device to map the context block device>
VARIABLE: This will be a list of variables from this VM or others. A first approach for the format for selecting attributes and setting others could be:
- MY_IP = nic.ip[NETWORK="BLUE"] --> MY_IP will hold the value of the IP given to this VM in its network interface bind to the "BLUE" network.
- MASTER_IP = master.nic.ip[NETWORK="PUBLIC"] --> MASTER_IP will hold the value of the IP given to the VM with name "master" in its network interface bind to the "PUBLIC" network.
FILE: A file to be included in the iso image
DIRECTORY: a directory to be included in the iso image
ISO image layout:
/ | |- variables |- file1 |- ... |- fileN |- dir1/ |- ... |- dirM/
#1 Updated by Ruben S. Montero over 12 years ago
From the point of view of the TM there is no difference between files or directories. So there is no need to split in FILE an DIRECTORY. So It is propose just to have a FILES attribute. An example of context:
CONTEXT = [ HOSTNAME = "cluster$VM_ID", IP_PUBLIC = '$NIC[IP, NETWORK="Public Net"]' FILES = "/images/license.txt /software/ /ssh_keys/$VM_ID" ]
Note that FILES is a space separated list of directories or files. Also you
could use variables to form the paths like /ssh_keys/$VM_ID that will be parsed
to /ssh_keys/4 for the VM 4. So per VM paths could be easily defined.