kickstart and post-install templated for simplified GPFS-based NAS cluster.
authorMartin Schwenke <martin@meltin.net>
Mon, 6 Dec 2010 03:43:32 +0000 (14:43 +1100)
committerMartin Schwenke <martin@meltin.net>
Mon, 6 Dec 2010 03:43:32 +0000 (14:43 +1100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
base/all/root/scripts/gpfs-nas-postinstall.sh [new file with mode: 0755]
templates/gpfs-nas-kickstart.cfg [new file with mode: 0644]

diff --git a/base/all/root/scripts/gpfs-nas-postinstall.sh b/base/all/root/scripts/gpfs-nas-postinstall.sh
new file mode 100755 (executable)
index 0000000..42995a8
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# Make this explicit so we only get RHEL updates to make things nice
+# and clear.  This duplicates what happens in basic-postinstall.sh but
+# we may have just rewound the cluster, so we might be running this on
+# the node install of from kickstart.
+echo "Updating from YUM repositories"
+yum -y update
+
+# we have to force the base GPFS package first, due to the way gpfs updates work
+echo "Installing GPFS base"
+yum -y install gpfs.base-@@GPFS_BASE_VERSION@@.@@RHEL_ARCH@@
+
+# then update it
+
+echo "Updating GPFS base"
+yum -y update
+
+echo "Installing ctdb packages"
+yum -y install ctdb ctdb-debuginfo 
+
+echo "Installing samba packages"
+yum -y install samba samba-debuginfo samba-client samba-doc samba-winbind-32bit
+
+echo "Installing remaining GPFS packages"
+yum -y install gpfs.src gpfs.msg gpfs.docs gpfs.gpl gpfs.msg.en_US
+
+echo "Installing ipvsadm"
+yum -y install ipvsadm
+
+echo "Rebuilding the GPFS modules"
+(cd /usr/lpp/mmfs/src && make Autoconfig World InstallImages)
+
+echo "Enabling NFS locking"
+chkconfig nfslock on
+service nfslock start
+
+# For some reason only the x86_64 version gets installed and we need
+# this to build the 32-bit version of the winbind libraries.
+echo "Installing keyutils-libs-devel.i386"
+yum -y install keyutils-libs-devel.i386
diff --git a/templates/gpfs-nas-kickstart.cfg b/templates/gpfs-nas-kickstart.cfg
new file mode 100644 (file)
index 0000000..7e1d4c1
--- /dev/null
@@ -0,0 +1,292 @@
+# Merged kickstart.  Minor bugfixes come for free bug features should
+# be configured for the correct version.
+install
+cdrom
+#ignoredisk --drives=[sdb,sdc,sdd,sde,sdf,sdg,sdh,sdi,sdj,sdk,sdl,sdm,sdn,sdo,sdp,sdq,sdr,sds,sdt,sdu,sdv,sdw,sdx,sdy,sdz,sdaa]
+key @@INSTALLKEY@@
+lang @@KS_LANGUAGE@@
+keyboard @@KEYBOARD@@
+skipx
+text
+network --device eth0 --bootproto dhcp
+network --device eth1 --onboot no --bootproto static
+rootpw @@ROOTPASSWORD@@
+firewall --disabled
+selinux --disabled
+authconfig --enableshadow --enablemd5
+timezone --utc @@TIMEZONE@@
+halt
+# if you want to have quiet boots add option 'quiet' to the next line
+# For debugging purposes or in case of trouble boot messages are very helpful
+bootloader --location=mbr --driveorder=@@SYSTEM_DISK_PREFIX@@a --append="@@KS_KERNEL_OPTS@@"
+
+# 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 --drives=@@SYSTEM_DISK_PREFIX@@a --initlabel
+part / --ondisk=@@SYSTEM_DISK_PREFIX@@a --fstype ext3 --size=@@ROOTSIZE@@
+part swap --ondisk=@@SYSTEM_DISK_PREFIX@@a --size=@@SWAPSIZE@@
+
+
+
+#The following Part lists all the packages that are needed for the Installation
+%packages --resolvedeps
+
+
+@base
+@admin-tools
+@base-x
+@core
+@development-libs
+@development-tools
+@editors
+@java
+@x-software-development
+@development-libs
+@development-tools
+@ X Window System
+# There seemed to be a Comapat Package in RHEL 4, but this is lost. 
+# So the Packages are installed manually
+compat-db
+compat-db
+compat-gcc-34
+compat-gcc-34-c++
+compat-gcc-34-g77
+compat-glibc
+compat-glibc
+compat-glibc-headers
+compat-libf2c-34
+compat-libf2c-34
+compat-libgcc-296
+compat-libstdc++-296
+compat-libstdc++-33
+compat-libstdc++-33
+compat-openldap
+compat-openldap
+compat-readline43
+compat-slang
+openldap-devel
+cups-devel
+firefox
+kernel
+kernel-devel
+kernel-doc
+e2fsprogs
+# All kinds of X-Fonts for the STAT-Gui
+xorg-x11-font-utils
+xorg-x11-fonts-100dpi
+xorg-x11-fonts-75dpi
+xorg-x11-fonts-ISO8859-1-100dpi
+xorg-x11-fonts-ISO8859-1-75dpi
+xorg-x11-fonts-ISO8859-14-100dpi
+xorg-x11-fonts-ISO8859-14-75dpi
+xorg-x11-fonts-ISO8859-15-100dpi
+xorg-x11-fonts-ISO8859-15-75dpi
+xorg-x11-fonts-ISO8859-2-100dpi
+xorg-x11-fonts-ISO8859-2-75dpi
+xorg-x11-fonts-ISO8859-9-100dpi
+xorg-x11-fonts-ISO8859-9-75dpi
+xorg-x11-fonts-Type1
+xorg-x11-fonts-base
+xorg-x11-fonts-misc
+xorg-x11-fonts-truetype
+device-mapper-multipath
+httpd
+vsftpd
+xinetd
+screen
+mod_authz_ldap
+libXp.i386
+openldap-clients
+sysstat
+mod_ssl
+distcache
+lsscsi
+# scsi-target-utils does require a suited RHEL license key; required for iSCSI usage
+#scsi-target-utils
+# ipvsadm required for LVS configuration
+#ipvsadm
+nss-devel
+nspr-devel
+
+#The Following Packages shall not be installed!!!
+-xen
+-samba
+-office
+-libicu
+-boost
+-boost-devel
+-autofs
+-compat-openldap
+-libXfont-devel
+-libxml2-devel
+-libxslt-devel
+-xmlsec1-devel
+-anacron
+-pcsc
+-pcsc-lite
+-pcsc-lite-devel
+-coolkey
+-coolkey-devel
+-ccid
+-ifd-egate
+-xulrunner-devel
+
+@@_EXTRA_RHEL_PACKAGES@@
+
+@@EXTRA_PACKAGES@@
+
+%post
+
+(
+set -x
+
+echo "Turn off some services..."
+chkconfig atd off
+chkconfig avahi-daemon off
+chkconfig avahi-dnsconfd off
+chkconfig bluetooth off
+chkconfig cpuspeed off
+chkconfig cups off
+chkconfig dhcdbd off
+chkconfig dund off
+chkconfig firstboot off
+chkconfig haldaemon off
+chkconfig hidd off
+chkconfig ip6tables off
+chkconfig ipmi off
+chkconfig iptables off
+chkconfig irda off
+chkconfig kudzu off
+chkconfig nfslock off
+chkconfig nscd off
+chkconfig pand off
+chkconfig pcscd off
+chkconfig restorecond off
+chkconfig rhnsd off
+chkconfig sendmail off
+chkconfig setroubleshoot off
+chkconfig smartd off
+chkconfig xfs off
+chkconfig yum-updatesd off
+chkconfig gpm off
+
+echo "Turn on some services..."
+chkconfig multipathd on
+
+for i in @@EXTRA_CHKCONFIGS@@ ; do
+    chkconfig ${i%:*} ${i#*:}
+done
+
+###
+f="/etc/sysconfig/network"
+echo "Switching off IPv6 in ${f}..."
+sed -i.orig -e 's/NETWORKING_IPV6=yes/NETWORKING_IPV6=no/g' "$f"
+
+###
+echo "Changing device scanning filter settings in lvm.conf to reduce boot time..."
+x1='filter = \[ "a/\.\*/" \]'
+y1='filter = \[ "a|\^/dev/mapper/\.\*|", "a|\^/dev/sda\.\*|", "r|\.\*|" ]'
+x2='# By default we accept every block device:'
+y2='# Exclude some block devices:'
+sed -i.orig -e "s@${x1}@${y1}@" -e "s@${x2}@${y2}@" /etc/lvm/lvm.conf
+
+###
+echo "Changing settings so sysstat also reports disk I/O..."
+/etc/init.d/sysstat stop
+rm -f /var/log/sa/*
+for i in "/etc/init.d/sysstat" "/usr/lib64/sa/sa1" ; do
+    sed -i.orig -e 's/sadc -F -L/sadc -d -F -L/g' "$i"
+done
+
+###
+echo "Setting the value of max opened files..."
+cat >/etc/security/limits.d/autocluster.cfg <<EOF
+# Added by autocluster
+*      soft    nofile  50000
+*      hard    nofile  50000
+*      soft    core    unlimited
+EOF
+
+###
+echo "Set sshd_config to allow more connections..."
+cat >>/etc/ssh/sshd_config <<EOF
+# Added by autocluster
+MaxStartups 1024
+EOF
+
+###
+echo "Disabling prelinking in /etc/sysconfig/prelink ..."
+sed -i.orig -e 's/PRELINKING=yes/# Modified by autocluster\n#&\nPRELINKING=no/' /etc/sysconfig/prelink
+
+###
+echo "Disabling some modules..."
+cat >>/etc/modprobe.conf <<EOF
+
+# Added by autocluster
+alias pcspkr off
+alias lp off
+alias parport off
+alias parport_pc off
+alias joydev off
+alias bluetooth off
+alias l2cap off
+alias rfcomm off
+alias video off
+alias backlight off
+alias button off
+alias battery off
+alias net-pf-10 off
+alias ipv6 off
+EOF
+
+###
+echo "Creating new multipath.conf..."
+f="/etc/multipath.conf"
+mv -f "$f" "${f}.orig"
+
+cat >"$f" <<EOF
+# Added by autocluster
+defaults {
+udev_dir               /dev
+getuid_callout         "/sbin/scsi_id -g -u -s /block/%n"
+user_friendly_names    yes
+}
+
+blacklist {
+devnode                        "^@@SYSTEM_DISK_PREFIX@@a[0-9]*$"
+}
+EOF
+
+###
+echo "Enabling core dumps logging for multipathd..."
+cat >>/etc/sysconfig/multipathd <<EOF
+# Added by autocluster
+DAEMON_COREFILE_LIMIT="unlimited"
+EOF
+
+###
+echo "Adding GPFS's bin to PATH..."
+cat >/etc/profile.d/gpfs-autocluster.sh <<EOF
+# Added by autocluster
+pathmunge /usr/lpp/mmfs/bin
+EOF
+
+###
+echo "Excluding RHEL's samba packages via YUM config..."
+cat  >>/etc/yum.conf <<EOF
+# Added by autocluster
+exclude=samba*el[56]*
+EOF
+
+@@@STANDARD_POSTINSTALL@@@
+
+@@@POSTINSTALL_TEMPLATE@@@
+
+sync
+
+) 2>&1 | tee /var/log/ks-postinstall.log > /dev/console
+
+%end
+