Configure Red Hat or Fedora as a guest template

I have several tips how to configure Red Hat Enterprise Linux or Fedora as a guest template. That it an image used for fast provisioning of systems. My tips works with RHEL virtualization, RHEV hypervisor or any other virtualization technologies.

Tip: Do not monitor virtual discs.

Stop and disable disc SMART monitoring. Since discs are virtual, there is no need of monitoring them for hardware failures. Use smartd daemon on the host, but not guests.

# service smartd stop; chkconfig --del smartd

Tip: Give your host shutdown support.

If you did Minimal Installation, you are probably missing ACPI daemon that handles graceful shutdowns. Power outage should never crash your guest.

# yum install acpid; chkconfig acpid on; service acpid start

Note: Starting from Fedora 14 the "halt" command no longer switches off the cord, to do it use "poweroff". I was happy "halt" user for many, many years. With the systemd now, I have to create an alias :-)

Tip: Install and enable ntp daemon.

Time keeping is not a duck soup. Certainly not for virtualization hosts, and so I would recommend installing and enabling ntpd. Do not forget to set time properly prior starting up the daemon! It will eventually stop if the time-drift is too big.

# date +%T -s "14:20:00"
# yum install ntp; chkconfig ntpd on; service ntpd start

Tip: Proxy your yum.

Relatively "cheap" trick to save some bandwith is to use proxy for yum. Install squid on the host system (or anywhere on the LAN) and add proxy=http://xxx:3128 to the /etc/yum.conf file. That's it. I have to admit much more clever solution would be to use Pulp repository manager.

Tip: Get ready to be provisioned.

Once you are ready, you should execute the following last steps that will prepare the image to be reconfigured after restart, clean yum cache and remove generated ssh keys:

# touch /.unconfigure
# yum clean all
# rm -rf /etc/ssh/ssh_host_*
# poweroff

30 August 2011 | rhev | fedora | rhel