10.3.2. Sealing a Linux Virtual Machine for Deployment as a Template using sys-unconfig

Summary
Generalize (seal) a Linux virtual machine using the sys-unconfig command before making it into a template. This prevents conflicts between virtual machines deployed from the template.

Procedure 10.8. Sealing a Linux Virtual Machine using sys-unconfig

  1. Log in to the virtual machine.
  2. Remove ssh host keys. Run:
    # rm -rf /etc/ssh/ssh_host_*
  3. Set HOSTNAME=localhost.localdomain in /etc/sysconfig/network
  4. Remove the HWADDR= line from /etc/sysconfig/network-scripts/ifcfg-eth*.
  5. Optionally delete all the logs from /var/log and build logs from /root.
  6. Run the following command:
    # sys-unconfig
Result
The virtual machine shuts down; it is now sealed and can be made into a template. You can deploy Linux virtual machines from this template without experiencing configuration file conflicts.