ONED Configuration 3.4

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

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.
  • HOST_PER_INTERVAL: Number of hosts monitored in each interval.
  • VM_POLLING_INTERVAL : Time in seconds between virtual machine monitorization (set to 0 to disable VM monitoring).
  • VM_PER_INTERVAL: Number of VMs monitored in each interval.
  • 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 /var/log/one/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
HOST_PER_INTERVAL        = 15
 
VM_POLLING_INTERVAL      = 10
VM_PER_INTERVAL          = 5
 
SCRIPTS_REMOTE_DIR=/tmp/one
 
PORT=2633
 
# Use this line for sqlite
# DB = [ backend = "sqlite" ]
 
DB = [ backend = "mysql",
       server  = "localhost",
       user    = "oneadmin",
       passwd  = "one_13.0",
       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"

Datastores

The Storage Subsystem 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 Machines simultaneously, and also shared with other users.

Here you can configure the default values for the Datastores and Image templates. You have more information about the templates syntax here.

  • DATASTORE_LOCATION: Path for Datastores in the hosts. It is the same for all the hosts in the cluster. DATASTORE_LOCATION is only for the hosts and not the front-end. It defaults to /var/lib/one/datastores (or $ONE_LOCATION/var/datastores in self-contained mode)
  • 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. The missing DEV_PREFIX attribute is filled when Images are created, so changing this prefix won't affect existing Images. It can be set to:

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

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

Sample configuration:

#*******************************************************************************
# Image Repository Configuration
#*******************************************************************************
#DATASTORE_LOCATION = /var/lib/one/datastores
 
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 /usr/lib/one/mads/
  • arguments: for the driver executable, usually a probe configuration file, can be an absolute path or relative to /etc/one/.
  • default: default values and configuration parameters for the driver, can be an absolute path or relative to /etc/one/.

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 Driver

The transfer drivers are used to transfer, clone, remove and create VM images. The default TM_MAD driver includes plugins for all supported storage modes. You may need to modify the TM_MAD to add custom plugins.

  • executable: path of the transfer driver executable, can be an absolute path or relative to /usr/lib/one/mads/
  • arguments: for the driver executable:
    • -t: number of threads, i.e. number of transfers made at the same time
    • -d: list of transfer drivers separated by commas, if not defined all the drivers available will be enabled

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

Sample configuration:

#-------------------------------------------------------------------------------
# Transfer Manager Driver Configuration
#-------------------------------------------------------------------------------
 
TM_MAD = [
    executable = "one_tm",
    arguments  = "-t 15 -d dummy,lvm,shared,qcow2,ssh,vmware,iscsi" ]

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 /usr/lib/one/mads/
  • arguments: for the driver executable
  • type: driver type, supported drivers: xen, kvm or xml
  • default: default values and configuration parameters for the driver, can be an absolute path or relative to /etc/one/

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_ssh",
    arguments  = "-t 15 -r 0 kvm",
    default    = "vmm_ssh/vmm_ssh_kvm.conf",
    type       = "kvm" ]           

Datastore Driver

The Datastore Driver defines a set of scripts to manage the storage backend.

  • executable: path of the transfer driver executable, can be an absolute path or relative to /usr/lib/one/mads/
  • arguments: for the driver executable
    • -t number of threads, i.e. number of repo operations at the same time
    • -d datastore mads separated by commas

Sample configuration:

DATASTORE_MAD = [
    executable = "one_datastore",
    arguments  = "-t 15 -d fs,vmware,iscsi"
]

For more information on this Driver and how to customize it, please visit its reference guide.

Hook System

Hooks in OpenNebula are programs (usually scripts) which execution is triggered by a change in state in Virtual Machines or Hosts. The hooks can be executed either locally or remotely in the node where the VM or Host 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 /usr/lib/one/mads/
  • arguments : for the driver executable, can be an absolute path or relative to /etc/one/

Sample configuration:

HM_MAD = [
    executable = "one_hm" ]

Virtual Machine Hooks (VM_HOOK) defined by:

  • 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)
    • PROLOG, when the VM is in the prolog state
    • 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
    • FAILED, when the VM enters the failed state
  • command: path can be absolute or relative to /usr/share/one/hooks
  • arguments: for the hook. You can access to VM information with $
    • $VMID, the ID of the virtual machine
    • $TEMPLATE, the VM template in xml and base64 encoded multiple
  • 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)

Host Hooks (HOST_HOOK) defined by:

  • name: for the hook, useful to track the hook (OPTIONAL)
  • on: when the hook should be executed,
    • CREATE, when the Host is created (onehost create)
    • ERROR, when the Host enters the error state
    • DISABLE, when the Host is disabled
  • command: path can be absolute or relative to /usr/share/one/hooks
  • arguments: for the hook. You can use the following Host information:
    • $HID, the ID of the host
    • $TEMPLATE, the Host template in xml and base64 encoded
  • remote: values,
    • YES, The hook is executed in the host
    • NO, The hook is executed in the OpenNebula server (default)

Sample configuration:

    VM_HOOK = [
       name      = "on_failure_resubmit",
       on        = "FAILED",
       command   = "/usr/bin/env onevm resubmit",
       arguments = "$VMID" ]

Auth Manager Configuration

  • AUTH_MAD: The driver that will be used to authenticate and authorize OpenNebula requests. If not defined OpenNebula will use the built-in auth policies
    • executable: path of the auth driver executable, can be an absolute path or relative to /usr/lib/one/mads/
    • arguments:
      • –authn: list of authentication modules separated by commas, if not defined all the modules available will be enabled
      • –authz: authorization module
  • SESSION_EXPIRATION_TIME: Time in seconds to keep an authenticated token as valid. During this time, the driver is not used. Use 0 to disable session caching
  • ENABLE_OTHER_PERMISSIONS: Whether or not to enable the permissions for 'other'. Users in the oneadmin group will still be able to change these permissions. Values: YES or NO

Sample configuration:

AUTH_MAD = [
    executable = "one_auth_mad",
    arguments  = "--authz quota --authn ssh,x509,server_cipher,server_x509"
]
 
SESSION_EXPIRATION_TIME = 900
 
#ENABLE_OTHER_PERMISSIONS = "YES"

Restricted Attributes Configuration

  • VM_RESTRICTED_ATTR: Virtual Machine attribute to be restricted for users outside the oneadmin group
  • IMAGE_RESTRICTED_ATTR: Image attribute to be restricted for users outside the oneadmin group

Sample configuration:

VM_RESTRICTED_ATTR = "CONTEXT/FILES"
VM_RESTRICTED_ATTR = "DISK/SOURCE"
VM_RESTRICTED_ATTR = "NIC/MAC"
VM_RESTRICTED_ATTR = "NIC/VLAN_ID"
VM_RESTRICTED_ATTR = "RANK"
 
IMAGE_RESTRICTED_ATTR = "SOURCE"