Product SiteDocumentation Site

2. Create a Red Hat Enterprise Linux Template

Now that you have created a Red Hat Enterprise Linux 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.
Before your virtual machine can be used to create a template, 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
  1. Connect to the Red Hat Enterprise Linux 6 virtual machine to be used as a template. Flag the system for reconfiguration by running the following command as root:
    # touch /.unconfigured
  2. Remove ssh host keys. Run:
    # rm -rf /etc/ssh/ssh_host_*
  3. Shut down the virtual machine. Run:
    # poweroff
  4. 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
  1. Back in the administration portal, click the VMs icon on the Virtual Machines tab, select the sealed Red Hat Enterprise Linux 6 virtual machine. Ensure that its status is Down.
  2. Click Make Template. The New Virtual Machine Template displays.
    Make new virtual machine template
    Figure 23. Make new virtual machine template

    Enter a suitable Name and Description for the template. Retain all the other default settings and click OK.
  3. On the Tree pane, click Templates. On the Templates tab, the template displays the "Image Locked" status icon while it is being created. 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.
    New Red Hat Enterprise Linux template
    Figure 24. New Red Hat Enterprise Linux template

You have prepared a virtual machine template for use. You can now clone Red Hat Enterprise Linux virtual machines using this template.