Project

xen-ruby

0.0
No commit activity in last 3 years
No release in over 3 years
simple gem to controle xen dom0
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.5.2
>= 0

Runtime

>= 0
 Project 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