Kartik Subbarao
2011-Jul-19 16:36 UTC
[CentOS-virt] Suggestions to improve this minimal kickstart config for CentOS 6?
I've come up with the following kickstart config (see below) for deploying a minimal CentOS 6 VM. It takes about 460MB. I'm assuming that all of the -firmware RPMs aren't needed for a VM installation, so I removed them. Also removed as many selinux packages as possible since I don't need that. I was wondering whether anyone could offer any further suggestions on minimizing the disk usage of the VM image. Also, I wanted to ask whether it might make sense to post this type of configuration to the CentOS wiki, possibly linked from the following page: http://wiki.centos.org/TipsAndTricks/KickStart This might make it easy for people who are building VMs for reference. Thanks, -Kartik ======= lang en_US.UTF-8 keyboard us timezone America/New_York auth --useshadow --passalgo=md5 selinux --disabled firewall --disabled zerombr bootloader --location=mbr network --bootproto=dhcp --device=eth0 --onboot=on services --enabled=network rootpw admin123 clearpart --all --initlabel part / --asprimary --fstype="ext3" --grow --maxsize=1000 --size=1 # Repositories url --url="http://mirrors.kernel.org/centos/6.0/os/x86_64/" %packages --excludedocs --nobase --instLangs=en @Core %post rpm -e $(rpm -qa |grep -i firmware) yum -y remove audit authconfig checkpolicy libsemanage libselinux-utils policycoreutils selinux-policy selinux-policy-targeted rm -rf /etc/selinux/targeted rpm -e --nodeps redhat-logos %end
Kartik Subbarao
2011-Jul-19 21:15 UTC
[CentOS-virt] Suggestions to improve this minimal kickstart config for CentOS 6?
On 07/19/2011 12:36 PM, Kartik Subbarao wrote:> rpm -e $(rpm -qa |grep -i firmware)This should be changed to: rpm -e $(rpm -qa | grep -i firmware | grep -v kernel-firmware) Since apparently kernel depends on kernel-firmware. -Kartik
Manuel Wolfshant
2011-Jul-20 14:01 UTC
[CentOS-virt] Suggestions to improve this minimal kickstart config for CentOS 6?
On 07/20/2011 04:48 PM, Kartik Subbarao wrote:> On 07/19/2011 05:36 PM, Manuel Wolfshant wrote: >> Try the attached ks. It installs around 180 packages. libselinux-utils >> is in because I find it mandatory to be able to modify the selinux >> configuration of an existing system. > > Thanks for the info. I created a VM with this config and it took up > about 512MB of disk space, which is higher than the kickstart file > that I posted (about 460MB).you removed selinux and also used rpm -e --nodeps which I would never promote (even if I also use on occasions). ditch from my list the packages which install firmware and you'll end up at roughly the same size as yours. anyway my target was never minimal space on disk (today even CFs and SSD are several times larger than what the ks installs ) but minimal number of packages while still maintaining out of the box all the proper functionality ( or at least my vision on it), including for servers with real storage behind them ( brocade, etc ). and I emphasize again: including selinux tools.> I'm running x86_64 so I'll probably see different sizes than your > system which appears to be i686.my ks works on both, just adjust the repository used for install> > In any event, thanks for taking the time to post your kickstart file. > It helps me validate that what I have is reasonably minimal, that I'm > probably not missing any major sources of size reductions.welcome
Ed Heron
2011-Aug-01 17:44 UTC
[CentOS-virt] Suggestions to improve this minimal kickstart config for CentOS 6?
On Tue, 2011-07-19 at 12:36 -0400, Kartik Subbarao wrote:> I've come up with the following kickstart config (see below) for > deploying a minimal CentOS 6 VM. It takes about 460MB. I'm assuming that > all of the -firmware RPMs aren't needed for a VM installation, so I > removed them. Also removed as many selinux packages as possible since I > don't need that. > > I was wondering whether anyone could offer any further suggestions on > minimizing the disk usage of the VM image. > ... > > =======> > ... > rootpw admin123I use the --iscrypted option so people can't easily see my default root password. An easy method of viewing the command is looking at /root/anaconda-ks.cfg (at least it was in 5) after install. For setting unique initial root passwords, there is a method for creating it on the command line.> ... > # Repositories > url --url="http://mirrors.kernel.org/centos/6.0/os/x86_64/" >Shouldn't we encourage the creation of a local mirror? Installs are much faster. Also, with local mirrors, you can snapshot the repo. This allows for testing updates before pushing them to your live servers.> ...I create ks files for many of my CentOS and CentOS derived (Elastix) boxes. Backups take less space when you only save data. Routers are great for this as they rarely change (except possibly for firewall rules). With PXE boot, I can rebuild a router in 10 minutes. Also handy if the router hardware fails (I'm using old PCs). An on-site user without any Linux knowledge can install a replacement router (or re-install an existing router if it is suspected to be compromised) in little time. As long as the ks file is used as the master configuration where changes are made and the router re-installed to make them active, you don't get into a position where a change is lost if the hardware fails.