Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

merging jedi4ever veewee/master

  • Loading branch information...
commit 88d83ed386b49dc9b3597c1e23714a20c8815494 2 parents 61945d4 + 546abda
Hippie Hacker authored

Showing 492 changed files with 4,288 additions and 2,542 deletions. Show diff stats Hide diff stats

  1. +2 3 .rvmrc
  2. +6 0 Gemfile
  3. +22 180 README.md
  4. +70 11 Rakefile
  5. +6 1 bin/veewee
  6. +2 1  doc/README-changes.txt
  7. +1 1  doc/TODO
  8. +8 1 doc/definition.md
  9. +9 1 doc/kvm.md
  10. +7 1 doc/requirements.md
  11. +7 7 doc/vagrant.md
  12. +3 5 lib/fission.rb
  13. +0 76 lib/fission/cli.rb
  14. +0 15 lib/fission/command.rb
  15. +0 68 lib/fission/command/clone.rb
  16. +0 71 lib/fission/command/delete.rb
  17. +0 52 lib/fission/command/snapshot_create.rb
  18. +0 45 lib/fission/command/snapshot_list.rb
  19. +0 54 lib/fission/command/snapshot_revert.rb
  20. +0 69 lib/fission/command/start.rb
  21. +0 31 lib/fission/command/status.rb
  22. +0 49 lib/fission/command/stop.rb
  23. +0 67 lib/fission/command/suspend.rb
  24. +52 5 lib/fission/config.rb
  25. +0 5 lib/fission/core_ext/class.rb
  26. +0 7 lib/fission/core_ext/file.rb
  27. +0 112 lib/fission/core_ext/object.rb
  28. +0 9 lib/fission/error.rb
  29. +0 17 lib/fission/fusion.rb
  30. +0 74 lib/fission/leasesfile.rb
  31. +0 39 lib/fission/metadata.rb
  32. +0 16 lib/fission/response.rb
  33. +0 22 lib/fission/ui.rb
  34. +0 3  lib/fission/version.rb
  35. +0 361 lib/fission/vm.rb
  36. +76 0 lib/python/parallels_send_string.py
  37. +1 1  lib/veewee/cli.rb
  38. +2 2 lib/veewee/command.rb
  39. +1 1  lib/veewee/command/base.rb
  40. +2 1  lib/veewee/command/{vmfusion.rb → fusion.rb}
  41. +2 1  lib/veewee/command/group_base.rb
  42. +3 1 lib/veewee/command/kvm.rb
  43. +1 0  lib/veewee/command/parallels.rb
  44. +4 0 lib/veewee/command/vagrant/basebox.rb
  45. +4 1 lib/veewee/command/vagrant/build.rb
  46. +1 1  lib/veewee/command/vagrant/define.rb
  47. +1 1  lib/veewee/command/vagrant/destroy.rb
  48. +11 1 lib/veewee/command/vagrant/export.rb
  49. +1 1  lib/veewee/command/vagrant/halt.rb
  50. +2 2 lib/veewee/command/vagrant/list.rb
  51. +2 2 lib/veewee/command/vagrant/ostypes.rb
  52. +45 0 lib/veewee/command/vagrant/screenshot.rb
  53. +2 3 lib/veewee/command/vagrant/ssh.rb
  54. +3 3 lib/veewee/command/vagrant/templates.rb
  55. +2 2 lib/veewee/command/vagrant/undefine.rb
  56. +1 1  lib/veewee/command/vagrant/up.rb
  57. +46 0 lib/veewee/command/vagrant/validate.rb
  58. +18 4 lib/veewee/command/{virtualbox.rb → vbox.rb}
  59. +2 2 lib/veewee/config.rb
  60. +4 4 lib/veewee/config/definition.rb
  61. +36 2 lib/veewee/config/ostypes.yml
  62. +15 3 lib/veewee/definition.rb
  63. +29 10 lib/veewee/definitions.rb
  64. +11 1 lib/veewee/environment.rb
  65. +9 0 lib/veewee/provider/core/box.rb
  66. +63 21 lib/veewee/provider/core/box/build.rb
  67. +6 3 lib/veewee/provider/core/box/exec.rb
  68. +3 3 lib/veewee/provider/core/box/floppy.rb
  69. +3 3 lib/veewee/provider/core/box/scp.rb
  70. +1 1  lib/veewee/provider/core/box/ssh.rb
  71. +64 0 lib/veewee/provider/core/box/validate_tags.rb
  72. +3 3 lib/veewee/provider/core/box/vnc.rb
  73. +45 38 lib/veewee/provider/core/helper/iso.rb
  74. +32 49 lib/veewee/provider/core/helper/scancode.rb
  75. +6 6 lib/veewee/provider/core/helper/shell.rb
  76. +19 20 lib/veewee/provider/core/helper/ssh.rb
  77. +9 7 lib/veewee/provider/core/helper/tcp.rb
  78. +15 10 lib/veewee/provider/core/helper/web.rb
  79. +25 13 lib/veewee/provider/core/provider.rb
  80. +8 8 lib/veewee/provider/core/provider/tunnel.rb
  81. +3 2 lib/veewee/provider/kvm/box/create.rb
  82. +1 1  lib/veewee/provider/kvm/box/destroy.rb
  83. +3 3 lib/veewee/provider/kvm/box/helper/console_type.rb
  84. +2 2 lib/veewee/provider/kvm/box/helper/ip.rb
  85. +2 2 lib/veewee/provider/kvm/box/helper/status.rb
  86. +1 33 lib/veewee/provider/kvm/box/validate_kvm.rb
  87. +1 1  lib/veewee/provider/kvm/provider.rb
  88. +1 1  lib/veewee/provider/parallels/box/create.rb
  89. +1 2  lib/veewee/provider/parallels/box/destroy.rb
  90. +1 1  lib/veewee/provider/parallels/box/helper/buildinfo.rb
  91. +59 81 lib/veewee/provider/parallels/box/helper/console_type.rb
  92. +1 35 lib/veewee/provider/parallels/box/validate_parallels.rb
  93. +2 0  lib/veewee/provider/virtualbox/box.rb
  94. +1 1  lib/veewee/provider/virtualbox/box/build.rb
  95. +16 4 lib/veewee/provider/virtualbox/box/create.rb
  96. +11 13 lib/veewee/provider/virtualbox/box/destroy.rb
  97. +20 19 lib/veewee/provider/virtualbox/box/export_vagrant.rb
  98. +2 2 lib/veewee/provider/virtualbox/box/helper/buildinfo.rb
  99. +10 10 lib/veewee/provider/virtualbox/box/helper/console_type.rb
  100. +44 35 lib/veewee/provider/virtualbox/box/helper/create.rb
  101. +2 2 lib/veewee/provider/virtualbox/box/helper/forwarding.rb
  102. +2 3 lib/veewee/provider/virtualbox/box/helper/guest_additions.rb
  103. +17 0 lib/veewee/provider/virtualbox/box/helper/natinterface.rb
  104. +8 0 lib/veewee/provider/virtualbox/box/helper/version.rb
  105. +2 2 lib/veewee/provider/virtualbox/box/poweroff.rb
  106. +24 0 lib/veewee/provider/virtualbox/box/screenshot.rb
  107. +11 5 lib/veewee/provider/virtualbox/box/up.rb
  108. +2 41 lib/veewee/provider/virtualbox/box/validate_vagrant.rb
  109. +3 11 lib/veewee/provider/vmfusion/box.rb
  110. +1 1  lib/veewee/provider/vmfusion/box/create.rb
  111. +2 3 lib/veewee/provider/vmfusion/box/destroy.rb
  112. +1 1  lib/veewee/provider/vmfusion/box/export_ova.rb
  113. +22 10 lib/veewee/provider/vmfusion/box/helper/buildinfo.rb
  114. +48 3 lib/veewee/provider/vmfusion/box/helper/ip.rb
  115. +3 3 lib/veewee/provider/vmfusion/box/helper/vnc.rb
  116. +9 0 lib/veewee/provider/vmfusion/box/template.rb
  117. +1 1  lib/veewee/provider/vmfusion/box/template.vmx.erb
  118. +1 35 lib/veewee/provider/vmfusion/box/validate_vmfusion.rb
  119. +19 2 lib/veewee/provider/vmfusion/provider.rb
  120. +1 1  lib/veewee/providers.rb
  121. +2 3 lib/veewee/templates.rb
  122. +5 3 lib/veewee/ui.rb
  123. +1 1  lib/veewee/version.rb
  124. +1 1  templates/CentOS-4.8-i386/definition.rb
  125. +1 1  templates/CentOS-5.5-i386-netboot/definition.rb
  126. +1 1  templates/CentOS-5.5-x86_64-netboot/definition.rb
  127. +20 8 templates/CentOS-5.6-i386-netboot/postinstall.sh
  128. +2 2 templates/CentOS-5.7-i386-netboot/definition.rb
  129. +3 1 templates/CentOS-5.7-i386-netboot/ks.cfg
  130. +2 2 templates/CentOS-5.7-x86_64-netboot/definition.rb
  131. +3 1 templates/CentOS-5.7-x86_64-netboot/ks.cfg
  132. +16 0 templates/CentOS-5.8-i386-netboot/definition.rb
  133. +47 0 templates/CentOS-5.8-i386-netboot/ks.cfg
  134. +53 0 templates/CentOS-5.8-i386-netboot/postinstall.sh
  135. +16 0 templates/CentOS-5.8-i386/definition.rb
  136. +47 0 templates/CentOS-5.8-i386/ks.cfg
  137. +53 0 templates/CentOS-5.8-i386/postinstall.sh
  138. +16 0 templates/CentOS-5.8-x86_64-netboot/definition.rb
  139. +47 0 templates/CentOS-5.8-x86_64-netboot/ks.cfg
  140. +53 0 templates/CentOS-5.8-x86_64-netboot/postinstall.sh
  141. +16 0 templates/CentOS-5.8-x86_64/definition.rb
  142. +47 0 templates/CentOS-5.8-x86_64/ks.cfg
  143. +60 0 templates/CentOS-5.8-x86_64/postinstall.sh
  144. +14 0 templates/CentOS-6.0-i386-netboot/base.sh
  145. +3 0  templates/CentOS-6.0-i386-netboot/chef.sh
  146. +5 0 templates/CentOS-6.0-i386-netboot/cleanup.sh
  147. +34 10 templates/CentOS-6.0-i386-netboot/definition.rb
  148. +19 30 templates/CentOS-6.0-i386-netboot/ks.cfg
  149. +12 0 templates/CentOS-6.0-i386-netboot/puppet.sh
  150. +3 0  templates/CentOS-6.0-i386-netboot/ruby.sh
  151. +18 0 templates/CentOS-6.0-i386-netboot/vagrant.sh
  152. +8 0 templates/CentOS-6.0-i386-netboot/virtualbox.sh
  153. +3 0  templates/CentOS-6.0-i386-netboot/zerodisk.sh
  154. +22 0 templates/CentOS-6.0-i386/base.sh
  155. +3 0  templates/CentOS-6.0-i386/chef.sh
  156. +5 0 templates/CentOS-6.0-i386/cleanup.sh
  157. +35 12 templates/CentOS-6.0-i386/definition.rb
  158. +12 18 templates/CentOS-6.0-i386/ks.cfg
  159. +12 0 templates/CentOS-6.0-i386/puppet.sh
  160. +3 0  templates/CentOS-6.0-i386/ruby.sh
  161. +18 0 templates/CentOS-6.0-i386/vagrant.sh
  162. +8 0 templates/CentOS-6.0-i386/virtualbox.sh
  163. +3 0  templates/CentOS-6.0-i386/zerodisk.sh
  164. +22 0 templates/CentOS-6.0-x86_64-minimal/base.sh
  165. +3 0  templates/CentOS-6.0-x86_64-minimal/chef.sh
  166. +5 0 templates/CentOS-6.0-x86_64-minimal/cleanup.sh
  167. +33 10 templates/CentOS-6.0-x86_64-minimal/definition.rb
  168. +11 7 templates/CentOS-6.0-x86_64-minimal/ks.cfg
  169. +0 58 templates/CentOS-6.0-x86_64-minimal/postinstall.sh
  170. +12 0 templates/CentOS-6.0-x86_64-minimal/puppet.sh
  171. +3 0  templates/CentOS-6.0-x86_64-minimal/ruby.sh
  172. +18 0 templates/CentOS-6.0-x86_64-minimal/vagrant.sh
  173. +8 0 templates/CentOS-6.0-x86_64-minimal/virtualbox.sh
  174. +3 0  templates/CentOS-6.0-x86_64-minimal/zerodisk.sh
  175. +14 0 templates/CentOS-6.0-x86_64-netboot/base.sh
  176. +3 0  templates/CentOS-6.0-x86_64-netboot/chef.sh
  177. +5 0 templates/CentOS-6.0-x86_64-netboot/cleanup.sh
  178. +33 9 templates/CentOS-6.0-x86_64-netboot/definition.rb
  179. +18 30 templates/CentOS-6.0-x86_64-netboot/ks.cfg
  180. +12 0 templates/CentOS-6.0-x86_64-netboot/puppet.sh
  181. +3 0  templates/CentOS-6.0-x86_64-netboot/ruby.sh
  182. +18 0 templates/CentOS-6.0-x86_64-netboot/vagrant.sh
  183. +8 0 templates/CentOS-6.0-x86_64-netboot/virtualbox.sh
  184. +3 0  templates/CentOS-6.0-x86_64-netboot/zerodisk.sh
  185. +10 0 templates/CentOS-6.0-x86_64/base.sh
  186. +1 0  templates/CentOS-6.0-x86_64/chef.sh
  187. +1 0  templates/CentOS-6.0-x86_64/cleanup.sh
  188. +17 8 templates/CentOS-6.0-x86_64/definition.rb
  189. +12 18 templates/CentOS-6.0-x86_64/ks.cfg
  190. +1 0  templates/CentOS-6.0-x86_64/puppet.sh
  191. +2 1  templates/CentOS-6.0-x86_64/ruby.sh
  192. +13 4 templates/CentOS-6.0-x86_64/vagrant.sh
  193. +4 4 templates/CentOS-6.0-x86_64/virtualbox.sh
  194. +3 0  templates/CentOS-6.0-x86_64/zerodisk.sh
  195. +10 1 templates/CentOS-6.1-x86_64-minimal/base.sh
  196. +1 0  templates/CentOS-6.1-x86_64-minimal/chef.sh
  197. +1 0  templates/CentOS-6.1-x86_64-minimal/cleanup.sh
  198. +4 3 templates/CentOS-6.1-x86_64-minimal/definition.rb
  199. +13 18 templates/CentOS-6.1-x86_64-minimal/ks.cfg
  200. +1 0  templates/CentOS-6.1-x86_64-minimal/puppet.sh
  201. +2 1  templates/CentOS-6.1-x86_64-minimal/ruby.sh
  202. +8 5 templates/CentOS-6.1-x86_64-minimal/vagrant.sh
  203. +2 2 templates/CentOS-6.1-x86_64-minimal/virtualbox.sh
  204. +3 0  templates/CentOS-6.1-x86_64-minimal/zerodisk.sh
  205. +2 1  templates/CentOS-6.1-x86_64-netboot/base.sh
  206. +1 0  templates/CentOS-6.1-x86_64-netboot/chef.sh
  207. +1 0  templates/CentOS-6.1-x86_64-netboot/cleanup.sh
  208. +8 7 templates/CentOS-6.1-x86_64-netboot/definition.rb
  209. +13 17 templates/CentOS-6.1-x86_64-netboot/ks.cfg
  210. +0 48 templates/CentOS-6.1-x86_64-netboot/postinstall.sh
  211. +1 0  templates/CentOS-6.1-x86_64-netboot/puppet.sh
  212. +2 1  templates/CentOS-6.1-x86_64-netboot/ruby.sh
  213. +8 5 templates/CentOS-6.1-x86_64-netboot/vagrant.sh
  214. +3 3 templates/CentOS-6.1-x86_64-netboot/virtualbox.sh
  215. +3 0  templates/CentOS-6.1-x86_64-netboot/zerodisk.sh
  216. +22 0 templates/CentOS-6.2-i386-minimal/base.sh
  217. +3 0  templates/CentOS-6.2-i386-minimal/chef.sh
  218. +5 0 templates/CentOS-6.2-i386-minimal/cleanup.sh
  219. +40 0 templates/CentOS-6.2-i386-minimal/definition.rb
  220. +42 0 templates/CentOS-6.2-i386-minimal/ks.cfg
  221. +12 0 templates/CentOS-6.2-i386-minimal/puppet.sh
  222. +3 0  templates/CentOS-6.2-i386-minimal/ruby.sh
  223. +18 0 templates/CentOS-6.2-i386-minimal/vagrant.sh
  224. +8 0 templates/CentOS-6.2-i386-minimal/virtualbox.sh
  225. +3 0  templates/CentOS-6.2-i386-minimal/zerodisk.sh
  226. +8 0 templates/CentOS-6.2-x86_64-minimal/base.sh
  227. +3 2 templates/CentOS-6.2-x86_64-minimal/definition.rb
  228. +4 1 templates/CentOS-6.2-x86_64-minimal/ks.cfg
  229. +7 5 templates/CentOS-6.2-x86_64-minimal/vagrant.sh
  230. +3 0  templates/CentOS-6.2-x86_64-minimal/zerodisk.sh
  231. +2 1  templates/CentOS-6.2-x86_64-netboot/base.sh
  232. +1 0  templates/CentOS-6.2-x86_64-netboot/chef.sh
  233. +1 0  templates/CentOS-6.2-x86_64-netboot/cleanup.sh
  234. +7 6 templates/CentOS-6.2-x86_64-netboot/definition.rb
  235. +13 17 templates/CentOS-6.2-x86_64-netboot/ks.cfg
  236. +0 48 templates/CentOS-6.2-x86_64-netboot/postinstall.sh
  237. +1 0  templates/CentOS-6.2-x86_64-netboot/puppet.sh
  238. +2 1  templates/CentOS-6.2-x86_64-netboot/ruby.sh
  239. +8 5 templates/CentOS-6.2-x86_64-netboot/vagrant.sh
  240. +3 3 templates/CentOS-6.2-x86_64-netboot/virtualbox.sh
  241. +3 0  templates/CentOS-6.2-x86_64-netboot/zerodisk.sh
  242. +14 0 templates/CentOS-6.3-i386-minimal/base.sh
  243. +3 0  templates/CentOS-6.3-i386-minimal/chef.sh
  244. +5 0 templates/CentOS-6.3-i386-minimal/cleanup.sh
  245. +40 0 templates/CentOS-6.3-i386-minimal/definition.rb
  246. +42 0 templates/CentOS-6.3-i386-minimal/ks.cfg
  247. +12 0 templates/CentOS-6.3-i386-minimal/puppet.sh
  248. +3 0  templates/CentOS-6.3-i386-minimal/ruby.sh
  249. +18 0 templates/CentOS-6.3-i386-minimal/vagrant.sh
  250. +8 0 templates/CentOS-6.3-i386-minimal/virtualbox.sh
  251. +3 0  templates/CentOS-6.3-i386-minimal/zerodisk.sh
  252. +14 0 templates/CentOS-6.3-x86_64-minimal/base.sh
  253. +3 0  templates/CentOS-6.3-x86_64-minimal/chef.sh
  254. +5 0 templates/CentOS-6.3-x86_64-minimal/cleanup.sh
  255. +40 0 templates/CentOS-6.3-x86_64-minimal/definition.rb
  256. +42 0 templates/CentOS-6.3-x86_64-minimal/ks.cfg
  257. +12 0 templates/CentOS-6.3-x86_64-minimal/puppet.sh
  258. +3 0  templates/CentOS-6.3-x86_64-minimal/ruby.sh
  259. +18 0 templates/CentOS-6.3-x86_64-minimal/vagrant.sh
  260. +8 0 templates/CentOS-6.3-x86_64-minimal/virtualbox.sh
  261. +3 0  templates/CentOS-6.3-x86_64-minimal/zerodisk.sh
  262. +9 0 templates/Debian-5.0.10-amd64-netboot/base.sh
  263. +2 0  templates/Debian-5.0.10-amd64-netboot/chef.sh
  264. +10 0 templates/Debian-5.0.10-amd64-netboot/cleanup.sh
  265. +39 0 templates/Debian-5.0.10-amd64-netboot/definition.rb
  266. +60 0 templates/Debian-5.0.10-amd64-netboot/postinstall.sh
  267. +312 0 templates/Debian-5.0.10-amd64-netboot/preseed.cfg
  268. +2 0  templates/Debian-5.0.10-amd64-netboot/puppet.sh
  269. +11 0 templates/Debian-5.0.10-amd64-netboot/ruby.sh
  270. +14 0 templates/Debian-5.0.10-amd64-netboot/vagrant.sh
  271. +15 0 templates/Debian-5.0.10-amd64-netboot/virtualbox.sh
  272. +9 0 templates/Debian-5.0.10-i386-netboot/base.sh
  273. +2 0  templates/Debian-5.0.10-i386-netboot/chef.sh
  274. +10 0 templates/Debian-5.0.10-i386-netboot/cleanup.sh
  275. +39 0 templates/Debian-5.0.10-i386-netboot/definition.rb
  276. +60 0 templates/Debian-5.0.10-i386-netboot/postinstall.sh
  277. +312 0 templates/Debian-5.0.10-i386-netboot/preseed.cfg
  278. +2 0  templates/Debian-5.0.10-i386-netboot/puppet.sh
  279. +11 0 templates/Debian-5.0.10-i386-netboot/ruby.sh
  280. +14 0 templates/Debian-5.0.10-i386-netboot/vagrant.sh
  281. +15 0 templates/Debian-5.0.10-i386-netboot/virtualbox.sh
  282. +2 2 templates/Debian-5.0.8-amd64-netboot/preseed.cfg
  283. +2 2 templates/Debian-5.0.8-i386-netboot/preseed.cfg
  284. +14 0 templates/Debian-6.0.3-amd64-netboot/base.sh
  285. +1 1  templates/Debian-6.0.3-amd64-netboot/definition.rb
  286. +14 0 templates/Debian-6.0.3-i386-netboot/base.sh
  287. +1 1  templates/Debian-6.0.3-i386-netboot/definition.rb
  288. +14 0 templates/Debian-6.0.4-amd64-netboot/base.sh
  289. +1 1  templates/Debian-6.0.4-amd64-netboot/definition.rb
  290. +5 1 templates/Debian-6.0.4-amd64-netboot/vagrant.sh
  291. +14 0 templates/Debian-6.0.4-i386-netboot/base.sh
  292. +1 1  templates/Debian-6.0.4-i386-netboot/definition.rb
  293. +1 1  templates/Debian-6.0.4-i386-netboot/ruby.sh
  294. +5 1 templates/Debian-6.0.4-i386-netboot/vagrant.sh
  295. +27 0 templates/Debian-6.0.5-amd64-netboot/base.sh
  296. +2 0  templates/Debian-6.0.5-amd64-netboot/chef.sh
  297. +4 0 templates/Debian-6.0.5-amd64-netboot/cleanup-virtualbox.sh
  298. +17 0 templates/Debian-6.0.5-amd64-netboot/cleanup.sh
  299. +49 0 templates/Debian-6.0.5-amd64-netboot/definition.rb
  300. +315 0 templates/Debian-6.0.5-amd64-netboot/preseed.cfg
Sorry, we could not display the entire diff because too many files (492) changed.
5 .rvmrc
... ... @@ -1,6 +1,5 @@
1   -rvm use ruby-1.9.2
2   -rvm gemset create veewee
3   -rvm gemset use veewee
  1 +rvm use ruby-1.9.2@veewee --create
  2 +
4 3 alias veewee="bundle exec veewee"
5 4 alias vagrant="bundle exec vagrant"
6 5 alias irb="bundle exec irb"
6 Gemfile
... ... @@ -1,6 +1,12 @@
  1 +#if RUBY_VERSION =~ /1.9/
  2 + #Encoding.default_external = Encoding::UTF_8
  3 + #Encoding.default_internal = Encoding::UTF_8
  4 +#end
  5 +
1 6 source "http://rubygems.org"
2 7
3 8 #gem "veewee", :path => "."
  9 +#gem "fission", :path => '/Users/patrick/dev/fission'
4 10
5 11 group :test do
6 12 gem "rake"
202 README.md
Source Rendered
... ... @@ -1,195 +1,37 @@
1   -# This is a branch that allows windows VM's to be used via winrm and not relying on ssh.
  1 +**VeeWee:** the tool to easily build vagrant base boxes or kvm,virtualbox and fusion images
2 2
3   --------
  3 +Vagrant is a great tool to test new things or changes in a virtual machine(Virtualbox) using either chef or puppet.
  4 +The first step is to download an existing 'base box'. I believe this scares a lot of people as they don't know who or how this box was build. Therefore lots of people end up first building their own base box to use with vagrant.
4 5
  6 +Besides building Vagrant boxes, veewee can also be used for:
5 7
6   -- veewee vbox define windows-7-enterprise-amd64-winrm windows-7-enterprise-amd64-winrm
7   -- veewee vbox build windows-7-enterprise-amd64-winrm
8   -- veewee vbox winrm windows-7-enterprise-amd64-winrm 'hostname'
9   -- veewee vbox copy windows-7-enterprise-amd64-winrm sourcefile.txt destfileinVM.txt
10   -- veewee vbox copy windows-7-enterprise-amd64-winrm sourcefile.txt destfileinVM.txt
11   -- vagrant basebox export windows-7-enterprise-amd64-winrm
12   -- vagrant box add 'windows-7-enterprise-amd64-winrm' 'windows-7-enterprise-amd64-winrm.box'
13   -- vagrant init windows-7-enterprise-amd64-winrm
  8 +- create vmware (fusion), kvm virtual machines
  9 +- interact with with those vms (up, destroy, halt, ssh)
  10 +- export them : OVA for fusion, IMG for KVM and ovf for virtualbox
14 11
15   -```
16   -$ veewee vbox define windows-7-enterprise-amd64-winrm windows-7-enterprise-amd64-winrm
  12 +Before you start read through:
17 13
18   -The basebox 'windows-7-enterprise-amd64-winrm' has been succesfully created from the template 'windows-7-enterprise-amd64-winrm'
19   -You can now edit the definition files stored in definitions/windows-7-enterprise-amd64-winrm or build the box with:
20   -veewee vbox build 'windows-7-enterprise-amd64-winrm'
21   -```
  14 +- the [requirements](https://github.com/jedi4ever/veewee/tree/master/doc/requirements.md)
  15 +- the [installation](https://github.com/jedi4ever/veewee/tree/master/doc/installation.md) procedure
22 16
23   -```
24   -$ veewee vbox build windows-7-enterprise-amd64-winrm --force
25   -Downloading vbox guest additions iso v 4.1.12 - http://download.virtualbox.org/virtualbox/4.1.12/VBoxGuestAdditions_4.1.12.iso
26   -Checking if isofile VBoxGuestAdditions_4.1.12.iso already exists.
27   -Full path: /home/hh/chef/veewee/iso/VBoxGuestAdditions_4.1.12.iso
  17 +Depending on how you want to use veewee, read through one of the following guides: (**work in progres**)
28 18
29   -The isofile VBoxGuestAdditions_4.1.12.iso already exists.
30   -Building Box windows-7-enterprise-amd64-winrm with Definition windows-7-enterprise-amd64-winrm:
31   -- postinstall_include : []
32   -- postinstall_exclude : []
33   -- force : true
  19 +- [guide for vagrant](https://github.com/jedi4ever/veewee/tree/master/doc/vagrant.md)
34 20
35   -The isofile 7600.16385.090713-1255_x64fre_enterprise_en-us_EVAL_Eval_Enterprise-GRMCENXEVAL_EN_DVD.iso already exists.
36   -VBoxManage unregistervm 'windows-7-enterprise-amd64-winrm' --delete
37   -Deleting vm windows-7-enterprise-amd64-winrm
38   -Creating vm windows-7-enterprise-amd64-winrm : 512M - 1 CPU - Windows7_64
39   -Creating new harddrive of size 20280
40   -Mounting cdrom: /home/hh/chef/veewee/iso/7600.16385.090713-1255_x64fre_enterprise_en-us_EVAL_Eval_Enterprise-GRMCENXEVAL_EN_DVD.iso
41   -Mounting guest additions: /home/hh/chef/veewee/iso/VBoxGuestAdditions_4.1.12.iso
42   -Attaching disk: /home/hh/VirtualBox VMs/windows-7-enterprise-amd64-winrm/windows-7-enterprise-amd64-winrm.vdi
43   -Using winrm because winrm_user and winrm_password are both set
44   -Received port hint - 5985
45   -Found port 5985 available
46   -Received port hint - 5985
47   -Found port 5985 available
48   -Waiting 0 seconds for the machine to boot
  21 +- [guide for Virtualbox](https://github.com/jedi4ever/veewee/tree/master/doc/vbox.md)
  22 +- [guide for Vmware fusion](https://github.com/jedi4ever/veewee/tree/master/doc/fusion.md)
  23 +- [guide for KVM](https://github.com/jedi4ever/veewee/tree/master/doc/kvm.md)
49 24
50   -Done typing.
  25 +You can also look at the more detailed pages on each subject in the [documentation directory](https://github.com/jedi4ever/veewee/tree/master/doc)
51 26
52   -Skipping webserver as no kickstartfile was specified
53   -Received port hint - 7000
54   -Found port 7000 available
55   -Waiting for winrm login on 127.0.0.1 with user vagrant to windows on port => 5986 to work, timeout=10000 sec
56   -........................
57   -Executing winrm command: cmd.exe /C dir %TEMP%\\wget.vbs > %TEMP%\null
58   -File Not Found
59   -Creating wget.vbs
60   -Executing winrm command: cmd.exe /C echo "Rendering '%TEMP%\\wget.vbs' chunk 1" && >> %TEMP%\\wget.vbs (echo.url = WScript.Arguments.Named^("url"^)) && >> %TEMP%\\wget.vbs (echo.path = WScript.Arguments.Named^("path"^)) && >> %TEMP%\\wget.vbs (echo.Set objXMLHTTP = CreateObject^("MSXML2.ServerXMLHTTP"^)) && >> %TEMP%\\wget.vbs (echo.Set wshShell = CreateObject^( "WScript.Shell" ^)) && >> %TEMP%\\wget.vbs (echo.Set objUserVariables = wshShell.Environment^("USER"^)) && >> %TEMP%\\wget.vbs (echo.) && >> %TEMP%\\wget.vbs (echo.'http proxy is optional) && >> %TEMP%\\wget.vbs (echo.'attempt to read from HTTP_PROXY env var first) && >> %TEMP%\\wget.vbs (echo.On Error Resume Next) && >> %TEMP%\\wget.vbs (echo.) && >> %TEMP%\\wget.vbs (echo.If NOT ^(objUserVariables^("HTTP_PROXY"^) = ""^) Then) && >> %TEMP%\\wget.vbs (echo.objXMLHTTP.setProxy 2, objUserVariables^("HTTP_PROXY"^)) && >> %TEMP%\\wget.vbs (echo.) && >> %TEMP%\\wget.vbs (echo.'fall back to named arg) && >> %TEMP%\\wget.vbs (echo.ElseIf NOT ^(WScript.Arguments.Named^("proxy"^) = ""^) Then) && >> %TEMP%\\wget.vbs (echo.objXMLHTTP.setProxy 2, WScript.Arguments.Named^("proxy"^)) && >> %TEMP%\\wget.vbs (echo.End If) && >> %TEMP%\\wget.vbs (echo.) && >> %TEMP%\\wget.vbs (echo.On Error Goto 0) && >> %TEMP%\\wget.vbs (echo.) && >> %TEMP%\\wget.vbs (echo.objXMLHTTP.open "GET", url, false) && >> %TEMP%\\wget.vbs (echo.objXMLHTTP.send^(^)) && >> %TEMP%\\wget.vbs (echo.If objXMLHTTP.Status = 200 Then) && >> %TEMP%\\wget.vbs (echo.Set objADOStream = CreateObject^("ADODB.Stream"^)) && >> %TEMP%\\wget.vbs (echo.objADOStream.Open) && >> %TEMP%\\wget.vbs (echo.objADOStream.Type = 1) && >> %TEMP%\\wget.vbs (echo.objADOStream.Write objXMLHTTP.ResponseBody) && >> %TEMP%\\wget.vbs (echo.objADOStream.Position = 0) && >> %TEMP%\\wget.vbs (echo.Set objFSO = Createobject^("Scripting.FileSystemObject"^)) && >> %TEMP%\\wget.vbs (echo.If objFSO.Fileexists^(path^) Then objFSO.DeleteFile path) && >> %TEMP%\\wget.vbs (echo.Set objFSO = Nothing) && >> %TEMP%\\wget.vbs (echo.objADOStream.SaveToFile path) && >> %TEMP%\\wget.vbs (echo.objADOStream.Close)
61   -"Rendering 'C:\Users\vagrant\AppData\Local\Temp\\wget.vbs' chunk 1"
62   -Executing winrm command: cmd.exe /C echo "Rendering '%TEMP%\\wget.vbs' chunk 2" && >> %TEMP%\\wget.vbs (echo.Set objADOStream = Nothing) && >> %TEMP%\\wget.vbs (echo.End if) && >> %TEMP%\\wget.vbs (echo.Set objXMLHTTP = Nothing)
63   -"Rendering 'C:\Users\vagrant\AppData\Local\Temp\\wget.vbs' chunk 2"
64   -Spinning up a wait_for_http_request on http://10.0.2.2:7000//tmp/.veewee_version20121022-9183-15gv13c
65   -Going to try and copy /tmp/.veewee_version20121022-9183-15gv13c to ".veewee_version"
66   -Executing winrm command: cmd.exe /C cscript %TEMP%\wget.vbs /url:http://10.0.2.2:7000/tmp/.veewee_version20121022-9183-15gv13c /path:.veewee_version
67   -Serving file /tmp/.veewee_version20121022-9183-15gv13c
68   -Microsoft (R) Windows Script Host Version 5.8
69   -Copyright (C) Microsoft Corporation. All rights reserved.
  27 +People have reported good experiences, why don't you give it a try?
70 28
71   -Received port hint - 7000
72   -Found port 7001 available
73   -Changing wincp port from 7000 to 7001
74   -Executing winrm command: cmd.exe /C dir %TEMP%\\wget.vbs > %TEMP%\null
75   -Spinning up a wait_for_http_request on http://10.0.2.2:7001//tmp/.vbox_version20121022-9183-1guel7e
76   -Going to try and copy /tmp/.vbox_version20121022-9183-1guel7e to ".vbox_version"
77   -Executing winrm command: cmd.exe /C cscript %TEMP%\wget.vbs /url:http://10.0.2.2:7001/tmp/.vbox_version20121022-9183-1guel7e /path:.vbox_version
78   -Serving file /tmp/.vbox_version20121022-9183-1guel7e
79   -Microsoft (R) Windows Script Host Version 5.8
80   -Copyright (C) Microsoft Corporation. All rights reserved.
  29 +## If you have a setup working, share your 'definition' with me. That would be fun!
81 30
82   -Received port hint - 7001
83   -Found port 7002 available
84   -Changing wincp port from 7001 to 7002
85   -Executing winrm command: cmd.exe /C dir %TEMP%\\wget.vbs > %TEMP%\null
86   -Spinning up a wait_for_http_request on http://10.0.2.2:7002//home/hh/chef/veewee/definitions/windows-7-enterprise-amd64-winrm/install-chef.bat
87   -Going to try and copy /home/hh/chef/veewee/definitions/windows-7-enterprise-amd64-winrm/install-chef.bat to "install-chef.bat"
88   -Executing winrm command: cmd.exe /C cscript %TEMP%\wget.vbs /url:http://10.0.2.2:7002/home/hh/chef/veewee/definitions/windows-7-enterprise-amd64-winrm/install-chef.bat /path:install-chef.bat
89   -Serving file /home/hh/chef/veewee/definitions/windows-7-enterprise-amd64-winrm/install-chef.bat
90   -Microsoft (R) Windows Script Host Version 5.8
91   -Copyright (C) Microsoft Corporation. All rights reserved.
  31 +IDEAS:
92 32
93   -Executing winrm command: install-chef.bat
  33 +- Now you integrate this with your CI build to create a daily basebox
94 34
95   -C:\Users\vagrant>cmd /C cscript C:\Users\vagrant\AppData\Local\Temp\wget.vbs /url:http://www.opscode.com/chef/install.msi /path:C:\Users\vagrant\AppData\Local\Temp\chef-client.msi
96   -Microsoft (R) Windows Script Host Version 5.8
97   -Copyright (C) Microsoft Corporation. All rights reserved.
  35 +[whren - 2012/04/12]
98 36
99   -
100   -C:\Users\vagrant>cmd /C msiexec /qn /i C:\Users\vagrant\AppData\Local\Temp\chef-client.msi
101   -The box windows-7-enterprise-amd64-winrm was build succesfully!
102   -You can now login to the box with:
103   -knife winrm -m 127.0.0.1 -P 5986 -x vagrant -P vagrant COMMAND
104   -```
105   -
106   -```
107   -$ veewee vbox winrm windows-7-enterprise-amd64-winrm hostname
108   -Executing winrm command: hostname
109   -vagrant-win7ent
110   -```
111   -
112   -```
113   -$ veewee vbox winrm windows-7-enterprise-amd64-winrm 'dir %TEMP%'
114   -Executing winrm command: dir %TEMP%
115   - Volume in drive C is Windows 7 Enterprise
116   - Volume Serial Number is 58F7-01E9
117   -
118   - Directory of C:\Users\vagrant\AppData\Local\Temp
119   -
120   -10/22/2012 11:26 PM <DIR> .
121   -10/22/2012 11:26 PM <DIR> ..
122   -10/22/2012 11:26 PM 63,636,395 chef-client.msi
123   -10/22/2012 11:25 PM 0 FXSAPIDebugLogFile.txt
124   -10/22/2012 11:24 PM <DIR> Low
125   -10/22/2012 11:25 PM 283 null
126   -10/22/2012 11:24 PM 49,208 vagrant.bmp
127   -10/22/2012 11:24 PM 1,105 wget.vbs
128   -10/22/2012 11:25 PM 843 wmsetup.log
129   -10/22/2012 11:25 PM <DIR> WPDNSE
130   - 6 File(s) 63,687,834 bytes
131   - 4 Dir(s) 1,431,273,472 bytes free
132   -```
133   -
134   -```
135   -$ veewee vbox winrm windows-7-enterprise-amd64-winrm 'dir'
136   -Executing winrm command: dir
137   - Volume in drive C is Windows 7 Enterprise
138   - Volume Serial Number is 58F7-01E9
139   -
140   - Directory of C:\Users\vagrant
141   -
142   -10/22/2012 11:25 PM <DIR> .
143   -10/22/2012 11:25 PM <DIR> ..
144   -10/22/2012 11:25 PM 7 .vbox_version
145   -10/22/2012 11:24 PM 13 .veewee_version
146   -10/22/2012 11:25 PM <DIR> Contacts
147   -10/22/2012 11:25 PM <DIR> Desktop
148   -10/22/2012 11:25 PM <DIR> Documents
149   -10/22/2012 11:25 PM <DIR> Downloads
150   -10/22/2012 11:25 PM <DIR> Favorites
151   -10/22/2012 11:25 PM 150 install-chef.bat
152   -10/22/2012 11:25 PM <DIR> Links
153   -10/22/2012 11:25 PM <DIR> Music
154   -10/22/2012 11:25 PM <DIR> Pictures
155   -10/22/2012 11:25 PM <DIR> Saved Games
156   -10/22/2012 11:25 PM <DIR> Searches
157   -10/22/2012 11:25 PM <DIR> Videos
158   - 3 File(s) 170 bytes
159   - 13 Dir(s) 1,431,273,472 bytes free
160   -```
161   -
162   -```
163   -$ vagrant basebox export windows-7-enterprise-amd64-winrm --force
164   -[vagrant] Vagrant requires the box to be shutdown, before it can export
165   -[vagrant] Sudo also needs to work for user
166   -[vagrant] Performing a clean shutdown now.
167   -[vagrant] Waiting for winrm login on 127.0.0.1 with user vagrant to windows on port => 5986 to work, timeout=10000 sec
168   -[vagrant] .[vagrant]
169   -[vagrant] Executing winrm command: shutdown /s /t 10 /c "Vagrant Shutdown" /f /d p:4:1
170   -[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant] .[vagrant]
171   -[vagrant] Machine windows-7-enterprise-amd64-winrm is powered off cleanly
172   -[vagrant] Excuting vagrant voodoo:
173   -[vagrant] vagrant package --base 'windows-7-enterprise-amd64-winrm' --output 'windows-7-enterprise-amd64-winrm.box'
174   -[vagrant]
175   -[vagrant] To import it into vagrant type:
176   -[vagrant] vagrant box add 'windows-7-enterprise-amd64-winrm' 'windows-7-enterprise-amd64-winrm.box'
177   -[vagrant]
178   -[vagrant] To use it:
179   -[vagrant] vagrant init 'windows-7-enterprise-amd64-winrm'
180   -[vagrant] vagrant up
181   -[vagrant] vagrant ssh
182   -```
183   -
184   -Now you could make windows-7-enterprise-amd64-winrm.box via an internal url and use in a Vagrantfile or
185   -
186   -```
187   -$ vagrant box add 'windows-7-enterprise-amd64-winrm' 'windows-7-enterprise-amd64-winrm.box
188   -[vagrant] Downloading with Vagrant::Downloaders::File...
189   -[vagrant] Copying box to temporary location...
190   -[vagrant] Extracting box...
191   -[vagrant] Verifying box...
192   -[vagrant] Cleaning up downloaded box...
193   -```
194   -
195   -Obviously we have a bit of work to do to get vagrant working with winrm, but at least now we can contruct windows base boxes from scratch.
  37 +See [use of pre_postinstall_file in defition.rb](https://github.com/whren/veewee/wiki/Use-of-pre_postinstall_file-in-definition.rb)
81 Rakefile
@@ -25,7 +25,7 @@ Rake::TestTask.new do |t|
25 25 end
26 26
27 27 desc 'Verify ISO'
28   -task :iso, [:box_name] do |t,args|
  28 +task :iso, [:template_name] do |t,args|
29 29 require 'net/http'
30 30 #if args.to_hash.size!=1
31 31 #puts "needs one arguments: rake iso [\"yourname\"]"
@@ -42,20 +42,39 @@ task :iso, [:box_name] do |t,args|
42 42 response = nil
43 43 while found==false
44 44 uri=URI.parse(url)
45   - Net::HTTP.start(uri.host,uri.port) {|http|
46   - response = http.head(uri.path)
47   - }
48   - unless response['location'].nil?
49   - #puts "Redirecting to "+response['location']
50   - url=response['location']
51   - else
52   - found=true
  45 + if uri.is_a?(URI::HTTP)
  46 + Net::HTTP.start(uri.host,uri.port) {|http|
  47 + response = http.head(uri.path)
  48 + }
  49 + unless response['location'].nil?
  50 + #puts "Redirecting to "+response['location']
  51 + url=response['location']
  52 + else
  53 + length=response['content-length']
  54 + found=true
  55 + end
  56 + elsif uri.is_a?(URI::FTP)
  57 + require 'net/ftp'
  58 + ftp = Net::FTP.new(uri.host)
  59 + ftp.login
  60 + begin
  61 + length = ftp.size(uri.path)
  62 + found = true
  63 + rescue Net::FTPReplyError => e
  64 + reply = e.message
  65 + err_code = reply[0,3].to_i
  66 + unless err_code == 500 || err_code == 502
  67 + # other problem, raise
  68 + raise "Got ftp site but doesn't support size subcommand"
  69 + end
  70 + # fallback solution
  71 + end
  72 +
53 73 end
54 74 end
55   - length=response['content-length']
56 75 if length.to_i < 10000
57 76 puts definition.iso_src
58   - p response['content-type']
  77 + puts "Incorrect length #{length.to_i}"
59 78 puts uri.host,uri.port, uri.path,response.code
60 79 end
61 80 rescue Exception => ex
@@ -63,3 +82,43 @@ task :iso, [:box_name] do |t,args|
63 82 end
64 83 end
65 84 end
  85 +
  86 +desc 'Autobuilds all templates and runs validation.'
  87 +task :autotest, [:pattern] do |t,args|
  88 +
  89 + # We overrule all timeouts for tcp and ssh
  90 + #ENV['VEEWEE_TIMEOUT']='600'
  91 +
  92 + ve=Veewee::Environment.new()
  93 + ve.templates.each do |name,template|
  94 +
  95 + # If pattern was given, only take the ones that match the pattern
  96 + unless args[:pattern].nil?
  97 + next unless name.match(args[:pattern])
  98 + end
  99 +
  100 + begin
  101 + ve.definitions.define("auto",name, { 'force' => true})
  102 + vd=ve.definitions["auto"]
  103 + box=ve.providers["virtualbox"].get_box("auto")
  104 + puts "AUTO: Building #{name}"
  105 + box.build({"auto" => true,"force" => true, 'nogui' => true })
  106 + puts "AUTO: Validating #{name}"
  107 + box.validate_vagrant
  108 + puts "AUTO: Success #{name}"
  109 + box.destroy
  110 + rescue Exception => ex
  111 + puts "AUTO: Template #{name} failed - #{ex}"
  112 + if box.running?
  113 + begin
  114 + screenshot="screenshot-auto-#{name}.png"
  115 + puts "AUTO: Taking snapshot #{screenshot}"
  116 + box.screenshot(screenshot)
  117 + rescue Veewee::Error => ex
  118 + puts "AUTO: Error taking screenshot"
  119 + end
  120 + end
  121 + end
  122 +
  123 + end
  124 +end
7 bin/veewee
... ... @@ -1,4 +1,9 @@
1 1 #!/usr/bin/env ruby
  2 +begin
  3 + require 'rubygems'
  4 +rescue LoadError
  5 +end
  6 +
2 7 require 'veewee'
3 8
4 9 env = Veewee::Environment.new
@@ -18,5 +23,5 @@ begin
18 23 ::Veewee::CLI.start(ARGV,:env => env)
19 24
20 25 rescue Veewee::Error => e
21   - puts "#{e}"
  26 + env.ui.error "#{e}"
22 27 end
3  doc/README-changes.txt
... ... @@ -1,5 +1,6 @@
1 1 Changelog
2 2 now has include-postinstall, exclude-postinstall
  3 + now has pre_postinstall_file allowing pre postinstall execution (ie to export http_proxy, https_proxy)
3 4 ostypes are now synchronized accross kvm
4 5 require libvirt 0.8+ version
5 6 user veewee instead of vagrant
@@ -13,7 +14,7 @@ Todo:
13 14 validate vms - + features selection
14 15 check libvirt version
15 16 windows test
16   - validation of checks (also - inclide/exclude)
  17 + validation of checks (also - include/exclude)
17 18 check execs with exit code
18 19 multinetwork card
19 20 dkms for kernel installs
2  doc/TODO
@@ -54,7 +54,7 @@ Todo:
54 54 validate vms - + features selection
55 55 check libvirt version
56 56 windows test
57   - validation of checks (also - inclide/exclude)
  57 + validation of checks (also - include/exclude)
58 58 check execs with exit code
59 59 multinetwork card
60 60 dkms for kernel installs
9 doc/definition.md
Source Rendered
... ... @@ -1,12 +1,16 @@
1 1 # Veewee definition
2 2
3 3 ## Creating a definition
4   -A definition is create be 'cloning' a *template*.
  4 +A definition is created by 'cloning' a *template*.
5 5
6 6 To create a definition you use the 'define' subcommand:
7 7
8 8 veewee vbox define 'myubuntu' 'ubuntu-10.10-server-amd64'
9 9
  10 +If you want to use an external repo for the definition you can specify a git-url
  11 +
  12 + veewee vbox define 'myubuntu' 'git://github.com/jedi4ever/myubuntu'
  13 +
10 14 ## Modifying a definition
11 15 Definitions are stored under a directory 'definitions' relative to the current directory.
12 16
@@ -48,6 +52,9 @@ The 'Veewee::Session.declare' is now deprecated and you should use 'Veewee::Defi
48 52
49 53 The default user of definitions is now 'veewee' and not 'vagrant'. This is because on other virtualizations like fusion and kvm, there is not relationship with the 'vagrant'. Users 'vagrant' are created by the 'vagrant.sh' script and not by the preseed or kickstart.
50 54
  55 +_Using ERB in files_
  56 +
  57 +Add '.erb' to your files in a definition and they will get rendered (useful for generting kickstart,postinstall) (thx @mconigilaro)
51 58
52 59 ## Listing existing definitions
53 60
10 doc/kvm.md
Source Rendered
... ... @@ -1,2 +1,10 @@
1   -Coming Soon
  1 +NOTE:Virtualbox doesn't like KVM to be enabled
2 2
  3 +check with
  4 +
  5 + kvm_ok
  6 +
  7 +Remove modules:
  8 +
  9 + rmmod kvm_intel
  10 + rmmod kvm
8 doc/requirements.md
Source Rendered
... ... @@ -1 +1,7 @@
1   -Coming Soon
  1 +More Coming Soon
  2 +
  3 +Development Libraries:
  4 +
  5 +libxslt1-dev
  6 +libxml2-dev
  7 +zlib1g-dev
14 doc/vagrant.md
Source Rendered
@@ -2,11 +2,11 @@
2 2 Let's define a Ubuntu 10.10 server i386 basebox called myunbuntubox
3 3 this is essentially making a copy based on the templates provided above.
4 4
5   - $ veewee vbox basebox define 'myubuntubox' 'ubuntu-10.10-server-i386'
  5 + $ veewee vbox define 'myubuntubox' 'ubuntu-10.10-server-i386'
6 6 The basebox 'myubuntubox' has been succesfully created from the template ''ubuntu-10.10-server-i386'
7 7 You can now edit the definition files stored in definitions/myubuntubox
8 8 or build the box with:
9   - veewee vbox basebox build 'myubuntubox'
  9 + veewee vbox build 'myubuntubox'
10 10
11 11 -> This copies over the templates/ubuntu-10.10-server-i386 to definition/myubuntubox
12 12
@@ -17,7 +17,7 @@ this is essentially making a copy based on the templates provided above.
17 17
18 18 Veewee::Definition.declare( {
19 19 :cpu_count => '1', :memory_size=> '256',
20   - :disk_size => '10140', :disk_format => 'VDI',
  20 + :disk_size => '10140', :disk_format => 'VDI', :disk_variant => 'Standard',
21 21 :os_type_id => 'Ubuntu',
22 22 :iso_file => "ubuntu-10.10-server-i386.iso",
23 23 :iso_src => "http://releases.ubuntu.com/maverick/ubuntu-10.10-server-i386.iso",
@@ -47,7 +47,7 @@ If you need to change values in the templates, be sure to run the rake undefine,
47 47 ## Getting the cdrom file in place
48 48 Put your isofile inside the 'currentdir'/iso directory or if you don't run
49 49
50   - $ veewee vbox basebox build 'myubuntubox'
  50 + $ veewee vbox build 'myubuntubox'
51 51
52 52 - the build assumes your iso files are in 'currentdir'/iso
53 53 - if it can not find it will suggest to download the iso for you
@@ -55,7 +55,7 @@ Put your isofile inside the 'currentdir'/iso directory or if you don't run
55 55
56 56 ## Build the new box:
57 57
58   - $ veewee vbox basebox build 'myubuntubox'
  58 + $ veewee vbox build 'myubuntubox'
59 59
60 60 - This will create a machine + disk according to the definition.rb
61 61 - Note: :os_type_id = The internal Name Virtualbox uses for that Distribution
@@ -104,11 +104,11 @@ I suggest the easiest way is to get an account on github and fork of the veewee
104 104
105 105 If you don't use rvm, be sure to execute vagrant through bundle exec
106 106
107   - $ alias vagrant="bundle exec vagrant"
  107 + $ alias veewee="bundle exec veewee"
108 108
109 109 Start of an existing one
110 110
111   - $ veewee vbox basebox define 'mynewos' 'ubuntu...'
  111 + $ veewee vbox define 'mynewos' 'ubuntu...'
112 112
113 113 - Do changes in the currentdir/definitions/mynewos
114 114 - When it builds ok, move the definition/mynewos to a sensible directory under templates
8 lib/fission.rb
@@ -5,9 +5,10 @@
5 5
6 6 $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
7 7
8   -require 'fission/error'
  8 +#require 'fission/error'
9 9 require 'fission/cli'
10 10 require 'fission/command'
  11 +require 'fission/command_helpers'
11 12 require 'fission/command/clone'
12 13 require 'fission/command/snapshot_create'
13 14 require 'fission/command/snapshot_list'
@@ -16,12 +17,12 @@
16 17 require 'fission/command/status'
17 18 require 'fission/command/stop'
18 19 require 'fission/command/suspend'
19   -require 'fission/command/delete'
20 20 require 'fission/config'
21 21 require 'fission/core_ext/class'
22 22 require 'fission/core_ext/file'
23 23 require 'fission/core_ext/object'
24 24 require 'fission/fusion'
  25 +require 'fission/lease'
25 26 require 'fission/metadata'
26 27 require 'fission/response'
27 28 require 'fission/ui'
@@ -35,7 +36,4 @@ def config
35 36 @config ||= Fission::Config.new
36 37 end
37 38
38   - def ui
39   - @ui ||= Fission::UI.new
40   - end
41 39 end
76 lib/fission/cli.rb
... ... @@ -1,76 +0,0 @@
1   -module Fission
2   - class CLI
3   - def self.execute(args=ARGV)
4   - optparse = OptionParser.new do |opts|
5   - opts.banner = "\nUsage: fission [options] COMMAND [arguments]"
6   -
7   - opts.on_head('-v', '--version', 'Output the version of fission') do
8   - Fission.ui.output Fission::VERSION
9   - exit(0)
10   - end
11   -
12   - opts.on_head('-h', '--help', 'Displays this message') do
13   - show_all_help(optparse)
14   - exit(0)
15   - end
16   -
17   - opts.define_tail do
18   - commands_banner
19   - end
20   -
21   - end
22   -
23   - begin
24   - optparse.order! args
25   - rescue OptionParser::InvalidOption => e
26   - Fission.ui.output e
27   - show_all_help(optparse)
28   - exit(1)
29   - end
30   -
31   - if commands.include?(args.first)
32   - @cmd = Fission::Command.const_get(args.first.capitalize).new args.drop 1
33   - elsif is_snapshot_command?(args)
34   - klass = args.take(2).map {|c| c.capitalize}.join('')
35   - @cmd = Fission::Command.const_get(klass).new args.drop 2
36   - else
37   - show_all_help(optparse)
38   - exit(1)
39   - end
40   -
41   - begin
42   - @cmd.execute
43   - rescue Error => e
44   - puts "Error: #{e}"
45   - end
46   - end
47   -
48   - def self.commands
49   - cmds = Dir.entries(File.join(File.dirname(__FILE__), 'command')).select do |file|
50   - !File.directory? file
51   - end
52   -
53   - cmds.map { |cmd| File.basename(cmd, '.rb').gsub '_', ' ' }
54   - end
55   -
56   - private
57   - def self.is_snapshot_command?(args)
58   - args.first == 'snapshot' && args.count > 1 && commands.include?(args.take(2).join(' '))
59   - end
60   -
61   - def self.commands_banner
62   - text = "\nCommands:\n"
63   - Fission::Command.descendants.each do |command_klass|
64   - text << (command_klass.send :help)
65   - end
66   -
67   - text
68   - end
69   -
70   - def self.show_all_help(options)
71   - Fission.ui.output options
72   - Fission.ui.output commands_banner
73   - end
74   -
75   - end
76   -end
15 lib/fission/command.rb
... ... @@ -1,15 +0,0 @@
1   -module Fission
2   - class Command
3   - attr_reader :options, :args
4   -
5   - def initialize(args=[])
6   - @options = OpenStruct.new
7   - @args = args
8   - end
9   -
10   - def self.help
11   - self.new.option_parser.to_s
12   - end
13   -
14   - end
15   -end
68 lib/fission/command/clone.rb
... ... @@ -1,68 +0,0 @@
1   -module Fission
2   - class Command
3   - class Clone < Command
4   -
5   - def initialize(args=[])
6   - super
7   - @options.start = false
8   - end
9   -
10   - def execute
11   - option_parser.parse! @args
12   -
13   - unless @args.count > 1
14   - Fission.ui.output self.class.help
15   - Fission.ui.output ""
16   - Fission.ui.output_and_exit "Incorrect arguments for clone command", 1
17   - end
18   -
19   - source_vm_name = @args.first
20   - target_vm_name = @args[1]
21   - source_vm=Fission::VM.new(source_vm_name)
22   - target_vm=Fission::VM.new(target_vm_name)
23   -
24   - unless source_vm.exists?
25   - Fission.ui.output_and_exit "Unable to find the source vm #{source_vm_name} (#{source_vm.path})", 1
26   - end
27   -
28   - if target_vm.exists?
29   - Fission::ui.output_and_exit "The target vm #{target_vm_name} already exists", 1
30   - end
31   -
32   - clone_task = Fission::VM.clone source_vm_name, target_vm_name
33   -
34   - if clone_task.successful?
35   - Fission.ui.output ''
36   - Fission.ui.output 'Clone complete!'
37   -
38   - if @options.start
39   - Fission.ui.output "Starting '#{target_vm_name}'"
40   -
41   - start_task = target_vm.start
42   -
43   - if start_task.successful?
44   - Fission.ui.output "VM '#{target_vm_name}' started"
45   - else
46   - Fission.ui.output_and_exit "There was an error starting the VM. The error was:\n#{start_task.output}", start_task.code
47   - end
48   - end
49   - else
50   - Fission.ui.output_and_exit "There was an error cloning the VM. The error was:\n#{clone_task.output}", clone_task.code
51   - end
52   - end
53   -
54   - def option_parser
55   - optparse = OptionParser.new do |opts|
56   - opts.banner = "\nclone usage: fission clone source_vm target_vm [options]"
57   -
58   - opts.on '--start', 'Start the VM after cloning' do
59   - @options.start = true
60   - end
61   - end
62   -
63   - optparse
64   - end
65   -
66   - end
67   - end
68   -end
71 lib/fission/command/delete.rb
... ... @@ -1,71 +0,0 @@
1   -module Fission
2   - class Command
3   - class Delete < Command
4   -
5   - def initialize(args=[])
6   - super
7   - @options.force = false
8   - end
9   -
10   - def execute
11   - option_parser.parse! @args
12   -
13   - if @args.count < 1
14   - Fission.ui.output self.class.help
15   - Fission.ui.output ""
16   - Fission.ui.output_and_exit "Incorrect arguments for delete command", 1
17   - end
18   -
19   - target_vm_name = @args.first
20   - target_vm=Fission::VM.new(target_vm_name)
21   - unless target_vm.exists?
22   - Fission.ui.output_and_exit "Vm #{target_vm_name} does not exist at (#{target_vm.path})", 1
23   - end
24   -
25   - if target_vm.running?
26   - Fission.ui.output 'VM is currently running'
27   - if @options.force
28   - Fission.ui.output 'Going to stop it'
29   - Fission::Command::Stop.new([target_vm_name]).execute
30   - else
31   - Fission.ui.output_and_exit "Either stop/suspend the VM or use '--force' and try again.", 1
32   - end
33   - end
34   -
35   -
36   - if Fission::Fusion.running?
37   - Fission.ui.output 'It looks like the Fusion GUI is currently running'
38   -
39   - if @options.force
40   - Fission.ui.output 'The Fusion metadata for the VM may not be removed completely'
41   - else
42   - Fission.ui.output "Either exit the Fusion GUI or use '--force' and try again"
43   - Fission.ui.output_and_exit "NOTE: Forcing a VM deletion with the Fusion GUI running may not clean up all of the VM metadata", 1
44   - end
45   - end
46   -
47   - delete_task = Fission::VM.delete target_vm_name
48   -
49   - if delete_task.successful?
50   - Fission.ui.output ''
51   - Fission.ui.output "Deletion complete!"
52   - else
53   - Fission.ui.output_and_exit "There was an error deleting the VM. The error was:\n#{delete_task.output}", delete_task.code
54   - end
55   - end
56   -
57   - def option_parser
58   - optparse = OptionParser.new do |opts|
59   - opts.banner = "\ndelete usage: fission delete target_vm [--force]"
60   -
61   - opts.on '--force', "Stop the VM if it's running and then delete it" do
62   - @options.force = true
63   - end
64   - end
65   -
66   - optparse
67   - end
68   -
69   - end
70   - end
71   -end
52 lib/fission/command/snapshot_create.rb
... ... @@ -1,52 +0,0 @@
1   -module Fission
2   - class Command
3   - class SnapshotCreate < Command
4   -
5   - def initialize(args=[])
6   - super
7   - end
8   -
9   - def execute
10   - unless @args.count == 2
11   - Fission.ui.output self.class.help
12   - Fission.ui.output ""
13   - Fission.ui.output_and_exit "Incorrect arguments for snapshot create command", 1
14   - end
15   -
16   - vm_name, snap_name = @args.take 2
17   -
18   - vm = Fission::VM.new vm_name
19   - unless vm.exists?
20   - Fission.ui.output_and_exit "Unable to find the VM #{vm_name} (#{Fission::VM.path(vm_name)})", 1
21   - end
22   -
23   - unless vm.running?
24   - Fission.ui.output "VM '#{vm_name}' is not running"
25   - Fission.ui.output_and_exit 'A snapshot cannot be created unless the VM is running', 1
26   - end
27   -
28   - if vm.snapshots.include? snap_name
29   - Fission.ui.output_and_exit "VM '#{vm_name}' already has a snapshot named '#{snap_name}'", 1
30   - end
31   -
32   - Fission.ui.output "Creating snapshot"
33   - task = vm.create_snapshot(snap_name)
34   -
35   - if task.successful?
36   - Fission.ui.output "Snapshot '#{snap_name}' created"
37   - else
38   - Fission.ui.output_and_exit "There was an error creating the snapshot. The error was:\n#{task.output}", task.code
39   - end
40   - end
41   -
42   - def option_parser
43   - optparse = OptionParser.new do |opts|
44   - opts.banner = "\nsnapshot create: fission snapshot create my_vm snapshot_1"
45   - end
46   -
47   - optparse
48   - end
49   -
50   - end
51   - end
52   -end
45 lib/fission/command/snapshot_list.rb
... ... @@ -1,45 +0,0 @@
1   -module Fission
2   - class Command
3   - class SnapshotList < Command
4   -
5   - def initialize(args=[])
6   - super
7   - end
8   -
9   - def execute
10   - unless @args.count == 1
11   - Fission.ui.output self.class.help
12   - Fission.ui.output ""
13   - Fission.ui.output_and_exit "Incorrect arguments for snapshot list command", 1
14   - end
15   -
16   - vm_name = @args.first
17   -
18   - vm = Fission::VM.new vm_name
19   -
20   - unless vm.exists?
21   - Fission.ui.output_and_exit "Unable to find the VM #{vm_name} (#{vm.path})", 1
22   - end
23   -
24   - snaps=vm.snapshots
25   - unless snaps.empty?
26   - Fission.ui.output snaps.join("\n")
27   - else
28   - Fission.ui.output "No snapshots found for VM '#{vm_name}'"
29   - end
30   -
31   - # TODO
32   - Fission.ui.output_and_exit "There was an error listing the snapshots. The error was:\n#{task.output}", task.code
33   - end
34   -
35   - def option_parser
36   - optparse = OptionParser.new do |opts|
37   - opts.banner = "\nsnapshot list: fission snapshot list my_vm"
38   - end
39   -
40   - optparse
41   - end
42   -
43   - end
44   - end
45   -end
54 lib/fission/command/snapshot_revert.rb
... ... @@ -1,54 +0,0 @@
1   -module Fission
2   - class Command
3   - class SnapshotRevert < Command
4   -
5   - def initialize(args=[])
6   - super
7   - end
8   -
9   - def execute
10   - unless @args.count == 2
11   - Fission.ui.output self.class.help
12   - Fission.ui.output ''
13   - Fission.ui.output_and_exit 'Incorrect arguments for snapshot revert command', 1
14   - end
15   -
16   - vm_name, snap_name = @args.take 2
17   - vm = Fission::VM.new vm_name
18   -
19   - unless vm.exists? vm_name
20   - Fission.ui.output_and_exit "Unable to find the VM #{vm_name} (#{Fission::VM.path(vm_name)})", 1
21   - end
22   -
23   - if Fission::Fusion.running?
24   - Fission.ui.output 'It looks like the Fusion GUI is currently running'
25   - Fission.ui.output_and_exit 'Please exit the Fusion GUI and try again', 1
26   - end
27   -
28   - snaps = vm.snapshots
29   -
30   - unless snaps.include? snap_name
31   - Fission.ui.output_and_exit "Unable to find the snapshot '#{snap_name}'", 1
32   - end
33   -
34   - Fission.ui.output "Reverting to snapshot '#{snap_name}'"
35   - task = vm.revert_to_snapshot snap_name
36   -
37   - if task.successful?
38   - Fission.ui.output "Reverted to snapshot '#{snap_name}'"
39   - else
40   - Fission.ui.output_and_exit "There was an error reverting to the snapshot. The error was:\n#{task.output}", task.code
41   - end
42   - end
43   -
44   - def option_parser
45   - optparse = OptionParser.new do |opts|
46   - opts.banner = "\nsnapshot revert: fission snapshot revert my_vm snapshot_1"
47   - end
48   -
49   - optparse
50   - end
51   -
52   - end
53   - end
54   -end
69 lib/fission/command/start.rb
... ... @@ -1,69 +0,0 @@
1   -module Fission
2   - class Command
3   - class Start < Command
4   -
5   - def initialize(args=[])
6   - super
7   - @options.headless = false
8   - end
9   -
10   - def execute
11   - option_parser.parse! @args
12   -
13   - if @args.empty?
14   - Fission.ui.output self.class.help
15   - Fission.ui.output ""
16   - Fission.ui.output_and_exit "Incorrect arguments for start command", 1
17   - end
18   -
19   - vm_name = @args.first
20   -
21   - vm = Fission::VM.new(vm_name)
22   -
23   - unless vm.exists?
24   - Fission.ui.output_and_exit "Unable to find the VM #{vm_name} (#{Fission::VM.path(vm_name)})", 1
25   - end
26   -
27   - if vm.running?
28   - Fission.ui.output ''
29   - Fission.ui.output_and_exit "VM '#{vm_name}' is already running", 0
30   - end
31   -
32   - Fission.ui.output "Starting '#{vm_name}'"
33   - start_args = {}
34   -
35   - if @options.headless
36   -
37   - if Fission::Fusion.running?
38   - Fission.ui.output 'It looks like the Fusion GUI is currently running'
39   - Fission.ui.output 'A VM cannot be started in headless mode when the Fusion GUI is running'
40   - Fission.ui.output_and_exit "Exit the Fusion GUI and try again", 1
41   - else
42   - start_args[:headless] = true
43   - end
44