4.2.2. Create a Red Hat Enterprise Linux Template

To make a Red Hat Enterprise Linux virtual machine template, use the virtual machine you created earlier as a basis. Before it can be used, it has to be sealed. This ensures that machine-specific settings are not propagated through the template.
Summary
You will now generalize (or "seal") a Linux virtual machine before you make it into a template. This prevents conflicts between virtual machines deployed from the template.

Procedure 4.5. Preparing a Red Hat Enterprise Linux virtual machine for use as a template

  1. Log in to the virtual machine. Flag the system for re-configuration by running the following command as root:
    # touch /.unconfigured
  2. Remove ssh host keys. Run:
    # rm -rf /etc/ssh/ssh_host_*
  3. Set HOSTNAME=localhost.localdomain in /etc/sysconfig/network
  4. Remove /etc/udev/rules.d/70-*. Run:
    # rm -rf /etc/udev/rules.d/70-*
  5. Remove the HWADDR= line from /etc/sysconfig/network-scripts/ifcfg-eth*.
  6. Delete all the logs from /var/log and build logs from /root.
  7. Shut down the virtual machine. Run:
    # poweroff
Result
The virtual machine is sealed and can be made into a template. You can deploy Linux virtual machines from this template without experiencing configuration-file-related conflicts.