forked from rottenbytes/ruby-xen
-
Notifications
You must be signed in to change notification settings - Fork 1
Simple ruby / xen module
License
foexle/ruby-xen
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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
About
Simple ruby / xen module
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published
Languages
- Ruby 100.0%