Code Monkey home page Code Monkey logo

knife-xapi's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.