Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


opennebula_ng (14) Versions 4.8.2

Installs/Configures opennebula_ng

cookbook 'opennebula_ng', '= 4.8.2', :supermarket
cookbook 'opennebula_ng', '= 4.8.2'
knife supermarket install opennebula_ng
knife supermarket download opennebula_ng
Quality 100%

opennebula_ng cookbook

A cookbook for managing OpenNebula via the Chef configuration management tool.

Supported Platforms

  • Debian
  • Ubuntu


To setup a minimal configuration, standalone OpenNebula server, set the following attributes to configure your network

node['opennebula_ng']['interfaces']['br0']['type'] = 'inet static'
node['opennebula_ng']['interfaces']['br0']['address'] = ''
node['opennebula_ng']['interfaces']['br0']['network'] = ''
node['opennebula_ng']['interfaces']['br0']['netmask'] = ''
node['opennebula_ng']['interfaces']['br0']['broadcast'] = ''
node['opennebula_ng']['interfaces']['br0']['gateway'] = ''

And run the following recipes:

  • default
  • sunstone
  • node
  • register_nodes

This will do the following things

  • Install the Sunstone frontend
  • Configure the network, add OpenNebula bridge
  • Register the current host as an OpenNebula node

You should be able to connect to your new OpenNebula installation using



The default recpe just includes the apt_repository recipe


This recipe sets up the official OpenNebula PPA for Ubuntu (stable)


This recipe installs and configures the sunstone frontend.

  • Installs opennebula and opennebula-sunstone packages
  • Takes care of SSH and authorized_keys configuration


This recipe turns your machine into an opennebula node

  • Configures networking according to node attributes (DANGER: touches /etc/network/interfaces)
  • Configures the OpenNebula bridge interface
  • Configures qEMU
  • Configures libvirt

MAKE SURE you configure the following attributes (e.g. create one file for each node in your
wrapper cookbooks attribute dir, e.g. attributes/myhost1.rb)

if == 'myhost1'
  node['opennebula_ng']['interfaces']['br0']['type'] = 'inet static'
  node['opennebula_ng']['interfaces']['br0']['address'] = ''
  node['opennebula_ng']['interfaces']['br0']['network'] = ''
  node['opennebula_ng']['interfaces']['br0']['netmask'] = ''
  node['opennebula_ng']['interfaces']['br0']['broadcast'] = ''
  node['opennebula_ng']['interfaces']['br0']['gateway'] = ''

  node['opennebula_ng']['interfaces']['br0']['bridge_ports'] = 'eth0'
  node['opennebula_ng']['interfaces']['br0']['bridge_fd'] = 9
  node['opennebula_ng']['interfaces']['br0']['bridge_hello'] = 2
  node['opennebula_ng']['interfaces']['br0']['bridge_maxage'] = 12
  node['opennebula_ng']['interfaces']['br0']['bridge_stp'] = 'off'

You can also configure additional interfaces, if required

node['opennebula_ng']['interfaces']['br1']['type'] = 'inet static'
node['opennebula_ng']['interfaces']['br1']['address'] = ''
node['opennebula_ng']['interfaces']['br1']['network'] = ''
node['opennebula_ng']['interfaces']['br1']['netmask'] = ''
node['opennebula_ng']['interfaces']['br1']['broadcast'] = ''

node['opennebula_ng']['interfaces']['br1']['bridge_ports'] = 'eth1'
node['opennebula_ng']['interfaces']['br1']['bridge_fd'] = 9
node['opennebula_ng']['interfaces']['br1']['bridge_hello'] = 2
node['opennebula_ng']['interfaces']['br1']['bridge_maxage'] = 12
node['opennebula_ng']['interfaces']['br1']['bridge_stp'] = 'off'


Configures OpenNebula to use a MariaDB backend.

Adjust the following attributes in case they are different from the defaults:

# Default mysql database settings
node['opennebula_ng']['mysql']['server']  = 'localhost'
node['opennebula_ng']['mysql']['port']    = 0
node['opennebula_ng']['mysql']['user']    = 'oneadmin'
node['opennebula_ng']['mysql']['passwd']  = 'oneadmin'
node['opennebula_ng']['mysql']['db_name'] = 'opennebula'

Make sure you set a root password (This password will also be used for the debian-sys-maint user,
in case you use Debian/Ubuntu.

node['mysqld']['root_password'] = 'get_me_from_encrypted_data_bag_maybe?'

Set the wsrep ssh auth, for example, use the root user which password we just specified:

node['mysqld']['my.cnf']['mysqld']['wsrep_sst_auth'] = "root:#{node['mysqld']['root_password']}"

In case you have multiple interfaces, you might also want to specify the IP of the interface the
replication should use

node['mysqld']['my.cnf']['mysqld']['wsrep_node_address'] = 'eth1'

In case you use more than one mariadb galera node, set this attribute to include all galera nodes
in your cluster

node['mysqld']['my.cnf']['mysqld']['wsrep_cluster_address'] = 'gcomm://node1,node2,node3'

Its recommended to keep one Galera node on each physical cluster (as virtual machines), and then
default each machine to connect to the one their hosting. This can be done like this:

# Connect to different clusters
if == 'node1'
  default['opennebula_ng']['mysql']['server']  = 'galera.node.on.host1'
elsif == 'node2'
  default['opennebula_ng']['mysql']['server']  = 'galera.node.on.host2'
  default['opennebula_ng']['mysql']['server']  = 'galera.node.on.host1'


Use this cookbook if you want to initialize a new clusters first node:

sudo chef-client --once -o 'recipe[opennebula_ng::mariadb_galera_init]'

You can also include it (if required) in a mariadb_galera_init cookbook in your wrapper cookbook

include_recipe 'opennebula_ng::mariadb_galera_init'

This cookbook just calls mysqld::mariadb_galera_init. Having it here is useful, as we set some
attributes which are not available when calling the mysqld recipe directly.


This recipe configures the /etc/one/oned.conf configuration file on the servers to connect to the
mariadb cluster specified in the arguments from the mariadb_server recipe.

Note: If those values are changed, the file is not automatically updated. This is due to a bug with
multiline regular expressions. See recipes/mariadb_client.rb for details


This recipe registers your hosts at oned.

The configuration is set via attributes, and supports all parameters that onehost supports.

The default is to register the node chef is currently running on, using kvm

# You can add all your nodes centrally here
node['opennebula_ng']['nodes'] = {
  myhost1: { im: 'kvm', vm: 'kvm', net: 'dummy' },
  myhost2: { im: 'kvm', vm: 'kvm', net: 'dummy' },
  myhost3: { im: 'kvm', vm: 'kvm', net: 'dummy' },


This recipe registers virtual networks using onenet.

You can specify your network configuration using the following attributes. Both fixed and ranged
networks are supported.

node['opennebula_ng']['virtual_networks'] = {
  frontnet: {
    TYPE: 'fixed',
    BRIDGE: 'br0',
    GATEWAY: '',
    DNS: '""',
    LEASES: ['[ IP= ]', '[ IP= ]']
  backnet: {
    TYPE: 'ranged',
    BRIDGE: 'br1',
    IP_START: '',
    IP_END: '',

Note: If you later add more addresses to an existing network, the settings are not automatically
updated on the nodes. The recipe skips creating a network if the network already exists.


A recipe to configure LVM datastores.

  • Installs and configures lvm packages
  • Creates datastores according to attributes

You can configure the datastores using the following attributes:

node['opennebula_ng']['lvm']['datastores'] = {
  'my datastore' => {
    DS_MAD: 'lvm',
    TM_MAD: 'lvm',
    VG_NAME: 'vg-one',
    BRIDGE_LIST: node['hostname'], # Add all hostnames of hosts accessing this datastore


This recipe configures the host to be a NFS server. It can be configured using the following

# Network to export NFS directories to, defaults to all hosts
node['opennebula_ng']['nfs']['network'] = '*' # or a network like e.g. ''

# NFS fsid. Must be unique
node['opennebula_ng']['nfs']['fsid'] = 1

# Hostname/IP of the NFS server (usually the frontend machine)
node['opennebula_ng']['nfs']['server'] = 'myhost1'


Configures the host to be an NFS client, mouting /var/lib/one from the server stored in


Configures the auth tokens in /var/lib/one/.one. When using a shared database, but not a shared
/var/lib/one/.one directory, they need to be in sync between all servers.

You can set the shared items using the following attributes:

# Set shared passwords between all opennebula hosts for serveradmin and oneadmin
node['opennebula_ng']['one_auth']['oneadmin']['password'] = 'password_from_encrypted_data_bag_maybe?'
node['opennebula_ng']['one_auth']['serveradmin']['password'] = 'another_password'

You can also set the ssh keypair (as every OpenNebula host needs to be able to connect to the
others, using the "oneadmin" user).

Hint: You can generate a keypair using the ssh-keygen command.

node['opennebula_ng']['one_auth']['oneadmin']['id_rsa'] = "-----BEGIN RSA PRIVATE KEY-----\nMIIE..."
node['opennebula_ng']['one_auth']['oneadmin'][''] = 'ssh-rsa AAAA...'

NOTE: This recipe assumes that the oneuser has id 0, and serveradmin the id 1. This is the default.
If you have them set to something else, make sure to adjust the id attributes!

node['opennebula_ng']['one_auth']['oneadmin']['id'] = 0
node['opennebula_ng']['one_auth']['serveradmin']['id'] = 1

You can also configure (if needed) the oneadmin's home directory as well as the one_auth file that
will be used:

node['opennebula_ng']['one_auth']['oneadmin']['home'] = '/var/lib/one'
node['opennebula_ng']['one_auth']['oneadmin']['auth_file'] = '/var/lib/one/.one/one_auth'


Please be aware, that you probably want a reverse proxy like nginx incl. SSL
before you deploy OpenNebula to your production servers.

You can easily do this e.g. using the
certificate and
nginx cookbooks.


  1. Fork the repository on Github
  2. Create a named feature branch (i.e. add-new-recipe)
  3. Write you change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request


Author: Chris Aumann (
Copyright: Copyright (c) 2014 Vaamo Finanz AG
License: Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

apt >= 0.0.0
nfs >= 0.0.0
mysqld >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.


  • Add one_auth recipe, to set shared passwords for "oneadmin" and "serveradmin" users, as well as deploy ssh keys

Compatibility changes:

  • Renamed node['opennebula_ng']['one_auth'] attribtue to node['opennebula_ng']['one_auth']['oneadmin']['auth_file']
  • Renamed node['opennebula_ng']['one_home'] attribute to node['opennebula_ng']['one_auth']['oneadmin']['home']


  • Use mariadb galera by default


  • Upgrade to OpenNebula 4.8 packages


  • Initial release of opennebula_ng

Foodcritic Metric

4.8.2 passed this metric