Feature #77

Context Support

Added by Tino Vázquez over 12 years ago. Updated almost 10 years ago.

Status:ClosedStart date:
Priority:HighDue date:
Assignee:Tino Vázquez% Done:

100%

Category:Core & System
Target version:Release 1.4
Resolution:fixed Pull request:

Description

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.

Proposed format:

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/

Associated revisions

Revision 2660884b
Added by Javi Fontan over 12 years ago

Added tm_context for ssh and posibility to specify http urls (#77)

git-svn-id: http://svn.opennebula.org/one/trunk@437 3034c82b-c49b-4eb3-8279-a7acafdc01c0

Revision 6aa658e1
Added by Javi Fontan over 12 years ago

Fixed a bug in contextualization (#77)

tm_context was called even if context was not specified for the VM

git-svn-id: http://svn.opennebula.org/one/trunk@450 3034c82b-c49b-4eb3-8279-a7acafdc01c0

History

#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.

#2 Updated by Javi Fontan over 12 years ago

  • % Done changed from 0 to 80

First tests for this feature were done but more testing is needed and documentation for this feature should be added.

#3 Updated by Javi Fontan over 12 years ago

  • Status changed from New to 3
  • % Done changed from 80 to 100
  • Resolution set to fixed

Contextualization feature was tested and final bugs seem to be eliminated.

#4 Updated by Ruben S. Montero almost 10 years ago

  • Status changed from 3 to Closed

Also available in: Atom PDF