forked from rottenbytes/ruby-xen
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME
More file actions
76 lines (52 loc) · 1.31 KB
/
README
File metadata and controls
76 lines (52 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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