Thursday, 19 April 2012

Building RHEL with Kickstart Files

How to build RHEL 6 on an HP Server from DVD installation with a kickstart file on a USB key:

Assume machine has already been hardware mirrored.
USB sticks are enumerated as sda so kickstart file has to use sdb for internal disk.
Those dodgy Dektek sticks enumerate as 2 drives (sda & sdb) so use sdc for internal disk which is why example below uses sdc.

Boot machine of DVD, highlight first install / upgrade option and press tab to edit. Add this to end of line:
ks=hd:sda1:/kickstart-file.cfg
Sample kickstart here, based on an autogen'ed basic server  install. Bit's I modified are in red.

# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
cdrom
lang en_GB.UTF-8
keyboard uk
network --onboot no --device eth0 --noipv4 --noipv6
network --onboot no --device eth1 --noipv4 --noipv6
network --onboot no --device eth2 --noipv4 --noipv6
network --onboot no --device eth3 --noipv4 --noipv6
network --onboot yes --device eth4 --bootproto static --ip 10.182.46.6 --netmask 255.255.255.0 --gateway 10.182.46.252 --noipv6 --hostname know-msvarnish-01.knon.dtv
network --onboot no --device eth5 --noipv4 --noipv6
rootpw  --iscrypted $6$woBbCXzYdNZUmerV$mz9mELXXNXBLL.k5MpL1S7nn7c3Dlf9i7sWUTRX7W2D0qjQY6sFBrSJA.wi2EfbL.YYz.gGf8AcwwOPEUuYgw1
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone --utc Europe/London
bootloader --location=mbr --driveorder=sdc --append=" rhgb crashkernel=auto quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
ignoredisk --drives=sda,sdb
clearpart --all --initlabel --drives=sdc
part /boot --fstype=ext4 --size=500 --ondisk=sdc
part pv.008002 --grow --size=1 --ondisk=sdc
volgroup vg_knowmsvarn --pesize=4096 pv.008002
logvol /var --fstype=ext4 --name=lv_var --vgname=vg_knowmsvarn --size=51200
logvol swap --name=lv_swap --vgname=vg_knowmsvarn --size=34288
logvol / --fstype=ext4 --name=lv_root --vgname=vg_knowmsvarn --size=100 --grow
 
#repo --name="Red Hat Enterprise Linux"  --baseurl=cdrom:sr0 --cost=100 
%packages
@base
@client-mgmt-tools
@console-internet
@core
@debugging
@directory-client
@hardware-monitoring
@java-platform
@large-systems
@network-file-system-client
@performance
@perl-runtime
@server-platform
@server-policy
pax
python-dmidecode
oddjob
sgpio
certmonger
pam_krb5
krb5-workstation
perl-DBD-SQLite
%end
Need to set the language to UK.
The --initlabel to clearpart should stop it asking for confirmation of initialising a new disk
The ignoredisk param tells installer to ignore usb sticks during partitioning
Make sure the --ondisk, --drives, --driveorder all match up with the enumeration of the internal disk
The --grow option tells that logvol to fill the rest of the disk.
Comment out the repo line as it defaults to DVD and didn't seem to work with it in.

No comments:

Post a Comment