2creatives / vagrant-centos

Scripts to create a lean CentOS Vagrant box.
Other
239 stars 94 forks source link

Unified script command #12

Open casr opened 10 years ago

casr commented 10 years ago

This is a work in progress. I will update this comment when new ideas arise.

% ./box -h
usage: ./box cleanup
             create
             destroy
             initialize
             interactive
             package

Short summary:
   cleanup     -- prepare the VM for distribution (delete CD-ROMs, etc.)
   create      -- perform an initialize, cleanup and package
   destroy     -- remove the VM from VirtualBox
   initialize  -- setup a box from ks.cfg and shutdown
   interactive -- perform a create step but prompt for options
   package     -- produce a box file for Vagrant consumption

Options:
   -h --help
   -N --name [VM Name]
casr commented 10 years ago

/cc @javornikolov @pinepain

You've both updated the scripts to in the directory to enhance the process in some way. I think I would prefer to unify all of these steps into one script and would appreciate any feedback you have.

pinepain commented 10 years ago

Hi @casr, sure, I will put my hands on it to cleanup a bit and try to push pr asap.

TL;DR I use PXE to do all steps in fully automated way but some things (like mounting ISO image) should be made cross-platform and sometimes ks.cfg uploading via nc hangs at ~48% (at least on OS X 10.9) so I would like to figure out why and try to fix that. In addition I also use virtualbox guest additions from current user installation (from default location) and want to add auto-pick first (latest) image from box folder to use it by default if no one specified.

Also I have in mind to make ks.cfg modular to easy remove virtualbox part and utilize it in production environment.

P.S. I also tried to run net install, is it worth to be added as an option?

casr commented 10 years ago

sometimes ks.cfg uploading via nc hangs at ~48% (at least on OS X 10.9)

Yup, it's a little temperamental! It's because nc immediately delivers it's payload before waiting for all the HTTP headers from Anaconda. Then Anaconda gets confused. I think the -i option for nc does help here but personally I've been using python -m SimpleHTTPServer as it recently became unbearably annoying! I'll open a separate issue for that.

I've been intrigued by the PXE stuff in your repo so looking forward to trying that out!

Also I have in mind to make ks.cfg modular to easy remove virtualbox part and utilize it in production environment.

P.S. I also tried to run net install, is it worth to be added as an option?

Modularising ks.cfg is desirable which would hopefully would help for removing the VirtualBox part but I must admit it probably won't be a focus of this repo (depends how it is done, I guess). Again, if it is modular then assembling a ks.cfg file for a net install suddenly becomes an option too.

casr commented 10 years ago

... hopefully would help for removing the VirtualBox part but I must admit it probably won't be a focus of this repo

Just to be clear, I meant that removing VirtualBox bits isn't a focus. I would very much like to modularise.

javornikolov commented 10 years ago

Just to add one idea here regarding configuration (variables with directory paths, etc. - presently in vars.sh). It could be several levels:

javornikolov commented 10 years ago

In another project: https://github.com/opscode/bento and related the Packer - there is already the idea of modularization. Maybe it's a bit too complicated but it could provide some ideas for this PR. It somehow manages to deal with the auto-boot (no need to manually provide the kickstart url), I'm haven't delved to see how.

javornikolov commented 10 years ago

P.S. I also tried to run net install, is it worth to be added as an option?

I was trying something like that to build box with Oracle Linux with UEK kernel (needs some manual assembling of setup files). For some reason the simple http servers which I tried (based on python and node.js) didn't play well with it. NFS worked OK.

pinepain commented 10 years ago

In general, there are already jedi4ever/veewee project which builds various linuxes vm.