Skip to content
Gary edited this page Apr 28, 2016 · 1 revision

In order to use this driver with chef-provisioning the driver URL needs to be specified via environment variable or with_driver directive.

Starting in version 0.3.3 the driver URL has the following format:

opennebula:<endpoint_url>:<profile>

Example:

with_driver "opennebula:http://1.2.3.4:443/api:boggi"

Where boggi profile is stored the profile file. The file will be searched in the following order:

  1. ENV['ONE_CONFIG']
  2. "#{ENV['HOME']}/.one/one_config"
  3. /var/lib/one/.one/one_config

A sample one_config file would look like this:

"boggi": {
  "credentials": "boggi:my_token",
  "options": {
    "timeout": 2,
    "sync": true,
    "http_proxy": "http://my.proxy.com"
  }
},
"testuser": {
  "credentials": "testuser:test_token"
}

To use OneFlow, you also need to specify a with_flow_url directive. This is the API endpoint of your OneFlow.

Example:

with_flow_url "http://gary.1.2.3.4:9876"

In context of OpenNebula machine resource will take the following additional options:

machine_options {
	:bootstrap_options => {
		:template => Hash defining the VM template,
		:template_file => String location of the VM template file,
		:template_name => String name of the OpenNebula template to use
		:template_id => Integer id of the OpenNebula template to use
		:template_options => Hash values to be merged with VM template
		:is_shutdown => [TrueClass, FalseClass] call vm.shutodwn instead of vm.stop during :stop action
		:shutdown_hard => [TrueClass, FalseClass] flag indicating hard or soft shutdown
    :mode => String octed to set permissions to the machine
	},
	:sudo => true,
	:ssh_username => 'local',
	:ssh_gateway => '[email protected]',
	:ssh_options => {
	  Hash containing SSH options as specified by net-ssh gem
	  please see https://github.com/net-ssh/net-ssh for all options
	  Example options:
	  :paranoid => false,
	  :auth_methods => ['publickey'],
	  :keys => [ File.open(File.expand_path('~/.ssh/id_rsa_new')).read ]
	  :keys_only => false,
	  :forward_agent => true,
	  :proxy => 'ssh myproxy.net nc %h %p',
	  :use_agent => true,
	  :user_known_hosts_file => '/dev/null'
	}
  :vm_name => [Symbol, String] Change how the machine shows up in OpenNebula UI and CLI tools.
			       Use :short to rename the machine to the short hostname.
			       Use a string to rename the machine to an arbitrary name.
			       Note this does not change the hostname of the machine, it
			       simply renames the VM in OpenNebula.
  :connection_timeout => [Integer] max wait time to establish connection
}
Clone this wiki locally