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
- Log in to the virtual machine. Flag the system for re-configuration by running the following command as root:
#
touch /.unconfigured - Remove ssh host keys. Run:
#
rm -rf /etc/ssh/ssh_host_* - Set
HOSTNAME=localhost.localdomainin/etc/sysconfig/network - Remove
/etc/udev/rules.d/70-*. Run:#
rm -rf /etc/udev/rules.d/70-* - Remove the
HWADDR=line from/etc/sysconfig/network-scripts/ifcfg-eth*. - Delete all the logs from
/var/logand build logs from/root. - 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.