Xen kickstart for CentOS 5

From Wiki
Jump to: navigation, search
# Kickstart file automatically generated by anaconda.
# Edited by Mike Watters

install
nfs --server 192.168.0.1 --dir /home/kickstart/centos/5/CentOS
lang en_US.UTF-8
keyboard us
#mouse none
#skipx
#text
network --device=eth0 --bootproto=dhcp --hostname=xentemp1.example.com
#network --device eth0 --bootproto static --ip 72.52.206.75 --netmask 255.255.254.0 --hostname xentest8.example.com
#network --device eth1 --bootproto dhcp --hostname xentest8.example.com
rootpw --iscrypted adfadfffs
firewall --enabled --port=22:tcp
authconfig --enableshadow --enablemd5
selinux --enforcing

timezone --utc America/New_York
bootloader --location=mbr --driveorder=sda

# 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
clearpart --all --drives=sda --initlabel
part / --fstype ext3 --size=4096 --asprimary
part /usr --fstype ext3 --size=12000 --asprimary
part swap --size=4096 --asprimary
part pv.5 --size=100 --grow --asprimary

# Set up default volume group and logical volumes
volgroup my_volume_group pv.5
logvol /xen/swap --vgname=my_volume_group --size=4096 --name=swap 

%packages --resolvedeps
@virtualization
screen
vnc
sendmail
httpd
ntp

%pre

%post

cat << EOF > /etc/resolv.conf
domain example.com
search example.com
nameserver 69.16.234.69
nameserver 209.59.139.5
nameserver 209.59.139.6
EOF

mkdir -p /xen/swap
mkdir -p /scripts/xen
mkdir /etc/backup
touch /etc/backup/backup.list
mkdir /etc/xen/disabled
mkdir /xen/iso

# Turn needed stuff on
/sbin/chkconfig ntpd --level 345 on
/sbin/chkconfig httpd --level 345 on
/sbin/chkconfig xend --level 345 on
/sbin/chkconfig xendomains --level 345 on
/sbin/chkconfig crond --level 345 on
/sbin/chkconfig sendmail --level 345 on

rm -fv /root/anaconda-ks.cfg

# Run updates
/usr/bin/yum -y update

# Fix ntp config
sed -i -e "s/0.pool.ntp.org/time.example.com/" /etc/ntp.conf

# Add stats job
echo -e "*/5\t0\t0\t0\t/scripts/xen/report-stats.py > /var/www/htdocs/test.xml\n" >> /var/spool/cron/root

# Enable TCP Syncookies 
echo "net.ipv4.tcp_syncookies = 1" >> /etc/sysctl.conf 
echo "1" > /proc/sys/net/ipv4/tcp_syncookies