Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple ruby / xen module
Ruby
branch: master

This branch is 54 commits ahead of rottenbytes:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.gitignore
Gemfile
Gemfile.lock
LICENSE
README
Rakefile
VERSION
xen-ruby.gemspec

README

A simple ruby module to admin xen instances
This gem includes a log mechanism (log4r) with various modes (DEBUG, INFO, WARN ...).


gem install xen-ruby

How to use it :

###########################
# To get instance informations
instance = Xen::Instance.find_by_name(name)

# To get all instaces
puts Xen::Instance.all

###########################
# To start an instance

instance.start(name)

# or
instance = Xen::Instance.find_by_name(name)
instance.start

# or
instance = Xen::Instance.new(name)
instance.start

###########################
# To create a new instance 
# attributes includes {:mem => "", :size => "", :name => "", :ip => "", :vcpus: => "",
# :arch => "", :dist => ""}
# mem   = Memory
# size  = HDD size
# name  = Hostname
# ip    = Ip address
# vcpus = Virtual cpu's
# arch  = System architecture [i386|amd64]
# dist  = distribution [lucid, hardy, etc.]
Xen::Instance.create(attributes)

##########################
# Instance actions
instance = Xen::Instance.find_by_name(name)

# start
instance.start

# stop
instance.shutdown

# reboot
instance.reboot

# pause
instance.pause

# unpause
instance.unpause

# kill
instance.destroy



##################################
Creating & installing the gem :

gem build xen.gemspec
sudo gem install xen-<version>.gem


todo:
- Xen::Instance.create have a small bug (timeout)
- Tests

Something went wrong with that request. Please try again.