Information Technology Reference
In-Depth Information
Creating a Red Hat Enterprise Linux template
To create a RHEL virtual machine template, you need to seal a virtual machine in order to
remove a few important system-related settings so that they do not get propagated across
the templates and on to the virtual machines that we are going to create using these tem-
plates. To seal a Linux virtual machine, follow these steps:
1. Log in to the virtual machine as a root, and perform the following configuration:
# touch /.unconfigured
2. Remove SSH host keys:
# rm -rf /etc/ssh/ssh_host_*
3. Modify the HOSTNAME parameter setting under the / etc/sysconfig/net-
work file to localhost.localdomain .
4. Remove HWADDR= line from /etc/sysconfig/network-scripts/
ifcfg-eth* .
5. Remove the network-related udev rule using the following command:
# rm -rf /etc/udev/rules.d/70-*
6. Optionally, you can install any software packages that need to be common for all
your Linux virtual machines, for example, RHEV guest agent's RPM. You can also
remove any system logs that you don't want to propagate across the virtual ma-
chines created using these templates for any security reasons.
7. Finally, turn off the power of the virtual machine using the following command:
# poweroff
Alternatively, you can use cloud-init instead of following all the preceding steps. The
Cloud-Init tool allows you to automate early configuration tasks in your virtual machines,
including setting hostnames, authorized keys, and more. For detailed information on how
to use cloud-init, please refer to the Sealing Templates in Preparation for Deployment sec-
tion in RHEV 3.3 Administration Guide at https://access.redhat.com/documentation/en-US/
Red_Hat_Enterprise_Virtualization/3.3/html-single/Administration_Guide/
index.html#sect-Using_Cloud-Init_to_Automate_the_Configuration_of_Virtual_Machines .
Search WWH ::




Custom Search