Now that you know how to create a virtual machine, you can save its settings into a template. This template will retain the original virtual machine's configurations, including virtual disk and network interface settings, operating systems and applications. You can use this template to rapidly create replicas of the original virtual machine.
4.2.1. Create a Red Hat Enterprise Linux Template
To make a Red Hat Enterprise Linux virtual machine template, use the virtual machine you created in Section 4.1.1, “Create a Red Hat Enterprise Linux Virtual Machine” 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.
To prepare a Red Hat Enterprise Linux virtual machine for use as a template
Connect to the Red Hat Enterprise Linux virtual machine to be used as a template. 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_*
Shut down the virtual machine. Run:
# poweroff
The virtual machine has now been sealed, and is ready to be used as a template for Linux virtual machines.
To create a template from a Red Hat Enterprise Linux virtual machine
In the administration portal, click the Virtual Machines tab. Select the sealed Red Hat Enterprise Linux 6 virtual machine. Ensure that it has a status of Down.
Click Make Template. The New Virtual Machine Template displays.
Figure 4.9. Make new virtual machine template
Enter information into the following fields:
Name: Name of the new template
Description: Description of the new template
Host Cluster: The Host Cluster for the virtual machines using this template.
Make Private: If you tick this checkbox, the template will only be available to the template's creator and the administrative user. Nobody else can use this template unless they are given permissions by the existing permitted users.
Click OK. The virtual machine displays a status of "Image Locked" while the template is being created. The template is created and added to the Templates tab. During this time, the action buttons for the template remain disabled. Once created, the action buttons are enabled and the template is ready for use.