streda 17. decembra 2008

Konfiguracia prisposobenia Linux VMs pri nasadeni s template

Apologies if this has already been addressed (I don't recall if it has or not), but serendipitously I learned about a boot script called "firstboot" that can perform functions that are similar to sysprep. The example below (summarized from a community forum thread) details a RHEL4 config. To find an RPM for "firstboot" for other versions of Linux, simply Google the keywords of "firstboot RPM" and voila.

=========================================================================================================

RHEL4 already has a "firstboot" script. It runs the python based
application that is used to finalize the configuration during an
install. Setup a RHEL4 template and now deploy a new
VM it runs the GUI to prompt me for all settings. To accomplish this try:

  1. Install and perform basic configuration just like normal
  2. Turn on the firstboot init script with the commands "chkconfig --add firstboot" and "chkconfig firstboot on" (this gets deleted and disabled after the first install finishes)
  3. Delete the firstboot file - "rm -f /etc/sysconfig/firstboot" (This gets created after the first run completes to prevent firstboot from running again)
  4. If you want to completely reconfigure all aspects of the system,
    then alos create a file in the /etc directory - "touch /etc/reconfigSys" (This commands firstboot to not just configure the parameters firstboot
    normally does during install, but to reconfigure everything)

Shutdown the VM and convert it to a template. Now when you deploy a template as a new VM, it runs the firstboot application with
the "reconfig" option and it can reconfigure the entire OS as needed.

Hope this helps.