knife-xapi 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +13 -9
- data/lib/chef/knife/xapi_guest_create.rb +7 -7
- data/lib/knife-xapi/version.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -23,16 +23,20 @@ Chef::Config[:knife][:xapi_bootstrap] :: Not implemented yet, but will be the b
|
|
23
23
|
==Usage
|
24
24
|
|
25
25
|
Basic usage to create a VM from existing VM template:
|
26
|
-
knife xapi guest create "NewBox" "public" --xapi-vm-template "MyBaseBox" --host http://sandbox/
|
26
|
+
knife xapi guest create "NewBox" "public" --xapi-vm-template "MyBaseBox" --host http://sandbox/
|
27
27
|
|
28
28
|
|
29
29
|
More verbose example using a kickstart file and booting the Centos 5 default template:
|
30
|
-
knife xapi guest create "MySpiffyBox" "pub_network" --host http://sandbox/
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
30
|
+
knife xapi guest create "MySpiffyBox" "pub_network" --host http://sandbox/ \
|
31
|
+
-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" \
|
32
|
+
-R http://192.168.6.5/repo/centos/5/os/x86_64 -C 4 -M 4g -D 5g
|
33
|
+
*-B Boot args where i am assigning all the centos/rhel boot args for Ip setup and kickstart file
|
34
|
+
*-R Repo URL used by xenserver to start the net install
|
35
|
+
*-C Number of cpus for this guest
|
36
|
+
*-M Memory size
|
37
|
+
*-D Disk size
|
38
|
+
|
39
|
+
Use Knife builtin help schematic for more info
|
40
|
+
knife xapi guest create --help
|
41
|
+
|
38
42
|
|
@@ -96,7 +96,7 @@ class Chef
|
|
96
96
|
ui.msg "Cloning Guest from Template: #{h.color(template_ref, :bold, :cyan )}"
|
97
97
|
vm_ref = xapi.VM.clone(template_ref, server_name)
|
98
98
|
|
99
|
-
|
99
|
+
begin
|
100
100
|
xapi.VM.set_name_description(vm_ref, "VM built by knife-xapi as #{server_name}")
|
101
101
|
|
102
102
|
# configure the install repo
|
@@ -154,12 +154,12 @@ class Chef
|
|
154
154
|
ui.msg "Starting new Guest: #{h.color( provisioned, :cyan)} "
|
155
155
|
xapi.Async.VM.start(vm_ref, false, true)
|
156
156
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
157
|
+
rescue Exception => e
|
158
|
+
ui.msg "#{h.color 'ERROR:'} #{h.color( e.message, :red )}"
|
159
|
+
ui.error "#{h.color( e.backtrace, :yellow)}"
|
160
|
+
|
161
|
+
cleanup(vm_ref)
|
162
|
+
end
|
163
163
|
# TODO: bootstrap
|
164
164
|
end
|
165
165
|
|
data/lib/knife-xapi/version.rb
CHANGED