Knife Plugin For XAPI to control xenserver
Switch branches/tags
Nothing to show
Pull request Compare This branch is 144 commits behind spheromak:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
LICENSE
README.rdoc
Rakefile

README.rdoc

Knife Xapi

This plugin gives knife the ability to create guests on a XAPI compatable hyper visor

Installation

This plugin is distributed as a Ruby Gem. To install it, run:

gem install knife-xapi

Configuration

Config options are extenable in the knife.rb the folowing k/v pairs are implemented

Chef::Config[:xenserver_host]

The API Host to connect to

Chef::Config[:xenserver_username]

The User name to connect to the api with

Chef::Config[:xenserver_password]

The Password (if not set will prompt on commandline)

Chef::Config[:xapi_vm_template]

Set a default template to be used when creating Guests

Chef::Config[:xapi_install_repo]

The install repo config option to set when using Xen builtin templates

Chef::Config[:xapi_sr]

The Storage Repository to provision from, uses pool/hypervisor default when not set

Chef::Config[:xapi_disk_size]

Default VM disk size (8g if not specified)

Chef::Config[:xapi_cpus]

The Default CPUs to provision for guests (2 if not specified)

Chef::Config[:xapi_mem] = mem

The Defaul ammount of Memory for guests (1g if not specified)

Chef::Config[:xapi_kernel_params]

Optional Boot paramaters to pass to the guest

Chef::Config[:xapi_bootstrap]

Not implemented yet, but will be the bootstrap script to execute after guest create

Usage

Basic usage to create a VM from existing VM template:

knife xapi guest create "NewBox" "public"  --xapi-vm-template "MyBaseBox"   --host http://sandbox/

More verbose example using a kickstart file and booting the Centos 5 default template:

knife xapi guest create "MySpiffyBox" "pub_network" --host http://sandbox/ \
  -B "dns=8.8.8.8 ks=http://192.168.6.4/repo/ks/default.ks ip=192.168.6.7 netmask=255.255.255.0 gateway=192.168.6.1" \
  -R http://192.168.6.5/repo/centos/5/os/x86_64 -C 4 -M 4g -D 5g

*-B Boot args where i am assigning all the centos/rhel boot args for Ip setup and kickstart file *-R Repo URL used by xenserver to start the net install *-C Number of cpus for this guest *-M Memory size *-D Disk size

Use Knife builtin help schematic for more info

knife xapi guest create --help