OpenNebula Daemon Configuration 2.0

The OpenNebula daemon oned manages the cluster nodes, virtual networks, virtual machines, users and image repository. The configuration file for the daemon is called oned.conf and it is placed inside the $ONE_LOCATION/etc directory. In this reference document we describe all the format and options that can be specified in oned.conf.

Note: If OpenNebula was installed in system wide mode this directory becomes /etc/one/. The rest of this guide refers to the $ONE_LOCATION paths (corresponding to self contained mode) and omits the equivalent system wide locations. More information on installation modes can be found here.

Daemon Configuration Attributes

  • MANAGER_TIMER : Time in seconds the core uses to evaluate periodical functions. HOST_MONITORING_INTERVAL and VM_POLLING_INTERVAL can not have smaller values than MANAGER_TIMER.
  • HOST_MONITORING_INTERVAL : Time in seconds between host monitorization.
  • VM_POLLING_INTERVAL : Time in seconds between virtual machine monitorization (set to 0 to disable VM monitoring).
  • VM_DIR : Remote path to store the VM images, it should be shared between all the cluster nodes to perform live migrations. This path will be used for all the cluster nodes.
  • SCRIPTS_REMOTE_DIR: Remote path to store the monitoring and VM management script.
  • PORT : Port where oned will listen for xml-rpc calls.
  • DB : Vector of configuration attributes for the database backend.
    • backend : Set to sqlite or mysql. Please visit the MySQL configuration guide for more information.
    • server (MySQL only): Host name or an IP address for the MySQL server.
    • user (MySQL only): MySQL user's login ID.
    • passwd (MySQL only): MySQL user's password.
    • db_name (MySQL only): MySQL database name.
  • VNC_BASE_PORT : VNC ports for VMs can be automatically set to VNC_BASE_PORT + VMID. Refer to the VM template reference for further information.
  • DEBUG_LEVEL : Sets the level of verbosity of $ONE_LOCATION/var/oned.log log file. Possible values are:

DEBUG_LEVELMeaning
0 ERROR
1 WARNING
2 INFO
3 DEBUG

Example of this section:

#*******************************************************************************
# Daemon configuration attributes
#*******************************************************************************

HOST_MONITORING_INTERVAL = 20

VM_POLLING_INTERVAL      = 10

VM_DIR=/local/images

SCRIPTS_REMOTE_DIR=/tmp/one

PORT=2633

# Use this line for sqlite
# DB = [ backend = "sqlite" ]

DB = [ backend = "mysql",
       server  = "localhost",
       user    = "oneadmin",
       passwd  = "one_1234",
       db_name = "opennebula" ]

VNC_BASE_PORT = 5000

DEBUG_LEVEL=3

Virtual Networks

  • NETWORK_SIZE: Default size for virtual networks
  • MAC_PREFIX: Default MAC prefix to generate virtual network MAC addresses

Sample configuration:

#*******************************************************************************
# Physical Networks configuration
#*******************************************************************************

NETWORK_SIZE = 254
MAC_PREFIX   = "02:00"

Image Repository

The Image Repository system allows users to set up images, which can be operative systems or data, to be used in Virtual Machines easily. These images can be used by several Virtual Machiness simultaneously, and also shared with other users.

The Image Repository is a set of images and metadata associated, that life on a particular folder in the front-end (the IMAGE_REPOSITORY_PATH, which by default is $ONE_LOCATION/var/images).

Here you can configure the default values for the image repository templates. You have more information about the templates syntax here.

  • IMAGE_REPOSITORY_PATH : Defines the path to the image repository. If it is not present, by default is set to $ONE_LOCATION/var/images.
  • DEFAULT_IMAGE_TYPE : Default value for TYPE field when it is omitted in a template. Values accepted are OS, CDROM, DATABLOCK.
  • DEFAULT_DEVICE_PREFIX : Default value for DEV_PREFIX field when it is omitted in a template. Can be set to:

PrefixDevice type
hd IDE
sd SCSI
xvd XEN Virtual Disk
vd KVM virtual disk

The IMAGE_REPOSITORY_PATH can be changed to another administrator defined folder. This folder will need to be created with special permissions to ensure its consistency. It will need full permissions for writting new files for any user, and:

  • the sticky bit, so other users are allowed to read other user files, but aren't allowed to erase them
  • the setgid, so all the files copied to the image repository end up with oneadmin group

This can be achieved with “chmod 3770 /path/to/image/repository/”.

:!: In order to use images with the CLONE attribute set to NO in NFS with VM_DIR configurations, please be aware that, in the image catalog, the IMAGE_REPOSITORY_PATH needs to be mounted in the same path in remotes physical nodes, and if the old, traditional SOURCE attribute of the DISK section of the TM is to be used, the same path set in the SOURCE attribute needs to exist in the remotes physical nodes.

More information on the image repository can be found in the Managing Virtual Machine Images guide.

Sample configuration:

#*******************************************************************************
# Image Repository Configuration
#*******************************************************************************

IMAGE_REPOSITORY_PATH = /local/repository
DEFAULT_IMAGE_TYPE    = "OS"
DEFAULT_DEVICE_PREFIX = "hd"

Information Drivers

The information drivers are used to gather information from the cluster nodes, and they depend on the virtualizer you are using. You can define more than one information manager but make sure it has different names. To define it, the following needs to be set:

  • name: name for this information driver.
  • executable: path of the information driver executable, can be an absolute path or relative to $ONE_LOCATION/lib/mads (or /usr/lib/one/mads/ in a system wide installation)
  • arguments: for the driver executable, usually a probe configuration file, can be an absolute path or relative to $ONE_LOCATION/etc (or /etc/one/ in a system wide installation).
  • default: default values and configuration parameters for the driver, can be an absolute path or relative to $ONE_LOCATION/etc (or /etc/one/ in a system wide installation).

For more information on configuring the information and monitoring system and hints to extend it please check the information driver configuration guide.

Sample configuration:

#-------------------------------------------------------------------------------
# Information Driver Configuration                                              
#-------------------------------------------------------------------------------

IM_MAD = [
    name       = "im_kvm",
    executable = "bin/one_im_ssh",
    arguments  = "im_kvm/im_kvm.conf",
    default    = "im_kvm/im_kvm.conf" ]

Transfer Drivers

The transfer drivers are used to transfer, clone, remove and create VM images. You will be using one transfer driver or another depending on the storage layout of your cluster. You can define more than one transfer manager (e.g. you have different configurations for several cluster nodes) but make sure it has different names. To define it, there needs to be set:

  • name: name for this transfer driver.
  • executable: path of the transfer driver executable, can be an absolute path or relative to $ONE_LOCATION/lib/mads (or /usr/lib/one/mads/ in a system wide installation)
  • arguments: for the driver executable, usually a commands configuration file, can be an absolute path or relative to $ONE_LOCATION/etc (or /etc/one/ in a system wide installation)

for the driver executable

  • default: default values and configuration parameters for the driver, can be an absolute path or relative to $ONE_LOCATION/etc (or /etc/one/ in a system wide installation)

For more information on configuring different storage alternatives please check the storage configuration guide.

Sample configuration:

#-------------------------------------------------------------------------------
# Transfer Driver Configuration                                              
#-------------------------------------------------------------------------------

TM_MAD = [
    name       = "tm_ssh",
    executable = "one_tm",
    arguments  = "tm_ssh/tm_ssh.conf",
    default    = "tm_ssh/tm_ssh.conf" ]

Virtualization Drivers

The virtualization drivers are used create, control and monitor VMs on the cluster nodes. You can define more than one virtualization driver (e.g. you have different virtualizers in several cluster nodes) but make sure it has different names. To define it, the following needs to be set:

  • name: name of the virtualization driver.
  • executable: path of the virtualization driver executable, can be an absolute path or relative to $ONE_LOCATION/lib/mads (or /usr/lib/one/mads/ in a system wide installation)
  • arguments: for the driver executable
  • type: driver type, supported drivers: xen, kvm or ec2
  • default: default values and configuration parameters for the driver, can be an absolute path or relative to $ONE_LOCATION/etc (or /etc/one/ in a system guide installation)

For more information on configuring and setting up the virtualizer please check the guide that suits you:

Sample configuration:

#-------------------------------------------------------------------------------
# Virtualization Driver Configuration                                           
#-------------------------------------------------------------------------------

VM_MAD = [
    name       = "vmm_kvm",
    executable = "one_vmm_kvm",
    default    = "vmm_kvm/vmm_kvm.conf",
    type       = "kvm" ]           

Hook System

Hooks in OpenNebula are programs (usually scripts) which execution is triggered by a change in state in Virtual Machines. The hooks can be executed either locally or remotely in the node where the VM is running. To configure the Hook System the following needs to be set in the OpenNebula configuration file:

  • executable: path of the hook driver executable, can be an absolute path or relative to $ONE_LOCATION/lib/mads (or /usr/lib/one/mads/ if OpenNebula was installed in /)
  • arguments : for the driver executable, can be an absolute path or relative to $ONE_LOCATION/etc (or /etc/one/ if OpenNebula was installed in /)

Sample configuration:

HM_MAD = [
    executable = "one_hm" ]

Then each hook has to be configured, and for each one the following needs to be set:

  • name: for the hook, useful to track the hook (OPTIONAL).
  • on: when the hook should be executed,
    • - CREATE, when the VM is created (onevm create)
    • - RUNNING, after the VM is successfully booted
    • - SHUTDOWN, after the VM is shutdown
    • - STOP, after the VM is stopped (including VM image transfers)
    • - DONE, after the VM is deleted or shutdown
  • command: use absolute path here
  • arguments: for the hook. You can access to VM template variables with $
    • - $ATTR, the value of an attribute e.g. $NAME or $VMID
    • - $ATTR[VAR], the value of a vector e.g. $NIC[MAC]
    • - $ATTR[VAR, COND], same of previous but COND select between multiple ATTRs e.g. $NIC[MAC, NETWORK=“Public”]
  • remote: values,
    • - YES, The hook is executed in the host where the VM was allocated
    • - NO, The hook is executed in the OpenNebula server (default)

Sample configuration:

VM_HOOK = [
    name      = "dhcp",
    on        = "create",
    command   = "/bin/echo",
    arguments = "$NAME > /tmp/test.$VMID" ]

Example Configuration File

HOST_MONITORING_INTERVAL = 10
VM_POLLING_INTERVAL      = 10
VM_DIR=/local/one_images
PORT=2633
DB = [ backend = "sqlite" ]
VNC_BASE_PORT = 5000
DEBUG_LEVEL=3
NETWORK_SIZE = 254
MAC_PREFIX   = "00:50"

IM_MAD = [
    name       = "im_kvm",
    executable = "one_im_ssh",
    arguments  = "im_kvm/im_kvm.conf" ]
VM_MAD = [
    name       = "vmm_kvm",
    executable = "one_vmm_kvm",
    default    = "vmm_kvm/vmm_kvm.conf",
    type       = "kvm" ]
TM_MAD = [
    name       = "tm_nfs",
    executable = "one_tm",
    arguments  = "tm_nfs/tm_nfs.conf" ]

HM_MAD = [
    executable = "one_hm" ]
VM_HOOK = [
    name      = "mail",
    on        = "running",
    command   = "/usr/local/one/bin/send_mail",
    arguments = "$VMID $NAME",
    remote    = "no" ]