[CentOS] Easy way to strip down CentOS?

Thu Feb 26 08:47:43 UTC 2015
Chris Murphy <lists at colorremedies.com>

The best way to do this is a new minimal install either in the GUI
installer or with kickstart. And build up from there.

If you do an install to e.g. CentOS-base.qcow2, that image already has
machine-id and hostname set. While not running a VM, use guestfish to
mount the qcow2, and make /etc/machine-id empty. Now, only use this
base.qcow2 as a backing image. That is, never use it directly in a VM.
Use

qemu-img create -b base.qcow2 -f qcow2 guest1.qcow2
qemu-img create -b base.qcow2 -f qcow2 guest2.qcow2
qemu-img create -b base.qcow2 -f qcow2 guest3.qcow2

Now use the guestn.qcow2 in the VM. And at first boot, the machine-id
will be populated. I'm not sure of any negative consequences of not
doing this, but if you want to use remote journalling it's necessary
so that the single journal can keep machines uniquely identified (even
when changing the hostname).

http://fedoraproject.org/wiki/Changes/Remote_Journal_Logging
https://kashyapc.fedorapeople.org/virt/lc-2012/snapshots-handout.html

Extra info: Anaconda uses this on lives to do installations (quite a
few of these options are consolidated with -a):
rsync -pogAXtlHrDx

-- 
Chris Murphy