Wednesday, October 22, 2014

RHEL6 UEFI kickstart installation on an HP HDL580 G8 server

the DL580G8 that was delivered to our Datacenters are configured with UEFI boot mode enabled. This requires at least RHEL6.4. I'm using RHEL6 Update 6. if you need to install RHEL5, you neeed to boot into legacy mode.
DHCP SERVER CONFIG

cat /etc/dhcp/dhcpd.conf
option space PXE;
option PXE.mtftp-ip    code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option arch code 93 = unsigned integer 16; # RFC4578

subnet 192.168.11.0 netmask 255.255.255.0 {
        option routers 192.168.11.1;
        option domain-name              "mylocaldomain";
        option domain-name-servers      192.168.11.13, 192.168.11.14;

        class "pxeclients" {
        match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
        next-server 192.168.11.246;
        if option arch = 00:06 {
                filename "pxelinux/bootia32.efi";
                } else if option arch = 00:07 {
                filename "pxelinux/bootx64.efi";
                } else {
                filename "pxelinux/pxelinux.0";
                }
        }
        host lxsrv00700 {
                hardware ethernet 40:a8:f0:21:40:98;
                fixed-address 192.168.11.221;
        }

        host lxsrv00720 {
                hardware ethernet 40:a8:f0:21:40:88;
                fixed-address 192.168.11.228;
        }
}

TFTP SERVER CONFIG
in /var/lib/tftpboot
pxelinux/
|-- C0A80BE4
|-- bootx64.efi
|-- efidefault
|-- pxelinux.0
`-- rhel6u6x86_64
    |-- TRANS.TBL
    |-- initrd.img
    `-- vmlinuz
THE PXE BOOT MENU this is /var/lib/tftpboot/pxelinux. i was using this to test some bootup. you can modify the timeout value if you want it to boot directly to the desired entry.
default=0
timeout 60
# hiddenmenu
title Install RHEL with kickstart
    root (nd)
    kernel /rhel6u6x86_64/vmlinuz ks=http://192.168.11.156/ks/RHEL6U6/LXISAP0XX0_ks.cfg  ksdevice=eth0 vnc vncpassword=p0knat
    initrd /rhel6u6x86_64/initrd.img
title Install Standard Red Hat Enterprise Linux OS
    root (nd)
    kernel /rhel6u6x86_64/vmlinuz repo=http://uxisap0027.isap.asia.cib/redhat/repo/rhel6u6/x86_64/
    initrd /rhel6u6x86_64/initrd.img
title Install system with basic video driver
    root (nd)
    kernel /rhel6u6x86_64/vmlinuz xdriver=vesa nomodeset askmethod
    initrd /rhel6u6x86_64/initrd.img
title rescue
    root (nd)
    kernel /rhel6u6x86_64/vmlinuz rescue askmethod
    initrd /rhel6u6x86_64/initrd.img
THE KICKSTART FILE

this is for an oracle 11gR2 installation.
the DL580G8 machine is configured for a RAID0 setup. the
logical disk is seen as sda.
install
text
url --url=http://mywebserver.localdomain/redhat/repo/rhel6u6/x86_64/
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --mtu=1500 --bootproto static --ip 192.168.11.228 --netmask 255.255.255.0 --gateway 192.168.11.1 --nameserver 10.129.8.13,10.129.8.14 --hostname lxsrv00720
network --onboot yes --device eth1 --bootproto static --hostname lxsrv00720
network --onboot no --device eth2 --bootproto dhcp --noipv6
network --onboot no --device eth3 --bootproto dhcp --noipv6
network --onboot no --device eth4 --bootproto dhcp --noipv6
network --onboot no --device eth5 --bootproto dhcp --noipv6
network --onboot no --device eth6 --bootproto dhcp --noipv6
network --onboot no --device eth7 --bootproto dhcp --noipv6

rootpw  --iscrypted $6$T.ljQPoRyxdfdSWZbti$r4fz68RA41aeGHCj6xE2CPR.el1lf/1.yy6idfdfF47LkdeTFnCNOIsdGuM0CB49wj0dsNsYfmEK41VbpkHes0
# System services
services --disabled="auditd,cups,smartd,nfslock"
# Reboot after installation
reboot
firewall --service=ssh  --enabled --port=22:tcp,443:tcp,1521:tcp,1158:tcp
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone --utc Asia/Singapore

bootloader --location=partition --driveorder=sda --append="crashkernel=auto rhgb quiet" --password=$6$z/0Yuz.BQRlOoLMB$E.p8LT0S5evjXdfdfAzVQcFLtYDX4Nan6jACKkYAt5HwgH7ZWIn.XfLdOKqneOFZx/dFoMi.ieUmaK1cNSKwzZ0

zerombr
clearpart --all --drives=sda --initlabel
ignoredisk --only-use=sda

#this is the main requirement for the UEFI setup.
%pre
/usr/sbin/parted -s /dev/sda mklabel gpt
%end

#note the /boot/efi line - it is required

part      /boot/efi  --fstype=efi    --grow          --maxsize=200  --size=50
part      /boot      --fstype=ext4   --size=500
part      pv.008066  --grow          --size=1
volgroup  vg00       --pesize=4096   pv.008066
logvol    /          --fstype=ext4   --name=lvsys00  --vgname=vg00  --size=5120
logvol    swap       --name=lvsys01  --vgname=vg00   --size=16384
logvol    /usr       --fstype=ext4   --name=lvsys02  --vgname=vg00  --size=3072
logvol    /opt       --fstype=ext4   --name=lvsys03  --vgname=vg00  --size=1024
logvol    /home      --fstype=ext4   --name=lvsys04  --vgname=vg00  --size=256
logvol    /tmp       --fstype=ext4   --name=lvsys05  --vgname=vg00  --size=4096
logvol    /local     --fstype=ext4   --name=lvsys06  --vgname=vg00  --size=256
logvol    /Home      --fstype=ext4   --name=lvsys07  --vgname=vg00  --size=512
logvol    /dump      --fstype=ext4   --name=lvdump   --vgname=vg00  --size=10240
logvol    /u01       --fstype=ext4   --name=lvu01   --vgname=vg00  --size=51200  --fsoptions=noatime


%packages --ignoremissing
@compat-libraries
@core
@legacy-software-support
binutils
compat-db gcc
compat-gcc-34-c++
compat-glibc
compat-glibc-headers
compat-glibc.i386
compat-libgcc-296
compat-libstdc++-296
compat-libstdc++-33
dejavu-lgc-fonts
device-mapper
device-mapper-event
device-mapper-multipath
e2fsprogs
elfutils-libelf
elfutils-libelf-devel
libtool-ltdl.i686
libtool-ltdl..x86_64
gcc
gcc-c++
glibc
glibc-common
glibc-devel
glibc-headers
kernel
libX11-devel
libXext
libXp
libXt
libXtst
libXxf86dga
libXxf86misc
libaio
libaio-devel
libdmx
libgcc
libgcc.i386
libstdc++
libstdc++-devel
make
ncompress
ncurses
ncurses.i386
readline.i686
ntp
openmotif
openssh-clients
openssh-server
ksh
postfix
pyOpenSSL
sg3_utils
strace
sysstat
xinetd
screen
unixODBC
unixODBC-devel
vnc-server
xorg-x11-deprecated-libs
xorg-x11-deprecated-libs-devel
xorg-x11-utils
xterm
yum
policycoreutils-python
tuned.noarch
tuned-utils
-bluez-gnome
-bluez-utils
-firstboot-tui
-ftp
-irda-utils
-nano
-notification-daemon
-openswan
-pango
-ppp
-rdist
-rp-pppoe
-rsh
-setserial
-talk
-usbutils
-wireless-tools
-wpa_supplicant

%post --log=/root/ks-post.log
echo "nHOSTNAME=lxsrv00720" >> /opt/ksopts.info
echo "ENABLE_BONDING=YES" >> /opt/ksopts.info
echo "MAIN_INTERFACE=eth0" >> /opt/ksopts.info
echo "SECOND_INTERFACE=eth1" >> /opt/ksopts.info
echo "EBSUSERS=YES" >> /opt/ksopts.info
export ksSERVER=192.168.11.156

{
wget  http://${ksSERVER}/ks/ksfiles/ks-post-secure.sh
sh ks-post-secure.sh
rm -f ks-post-secure.sh
} 1>/root/post_secure.log 2>&1

{
wget  http://${ksSERVER}/ks/ksfiles/ks-post-oracle.sh
sh ks-post-oracle.sh
rm -f ks-post-oracle.sh
} 1>/root/post_oracle.log 2>&1
sample log entries from the pxe server
Oct 17 17:00:38 LXSRV00410 in.tftpd[4693]: RRQ from 192.168.11.228 filename pxelinux/bootx64.efi
Oct 17 17:00:38 LXSRV00410 in.tftpd[4694]: RRQ from 192.168.11.228 filename pxelinux/37323835-0011-5347-4834-3430575957                                        31
Oct 17 17:00:38 LXSRV00410 in.tftpd[4694]: sending NAK (1, File not found) to 192.168.11.228
Oct 17 17:00:38 LXSRV00410 in.tftpd[4695]: RRQ from 192.168.11.228 filename pxelinux/01-40-A8-F0-21-40-88
Oct 17 17:00:38 LXSRV00410 in.tftpd[4695]: sending NAK (1, File not found) to 192.168.11.228
Oct 17 17:00:38 LXSRV00410 in.tftpd[4696]: RRQ from 192.168.11.228 filename pxelinux/C0A80BE4
Oct 17 17:00:38 LXSRV00410 in.tftpd[4696]: tftp: client does not accept options
Oct 17 17:00:38 LXSRV00410 in.tftpd[4697]: RRQ from 192.168.11.228 filename pxelinux//C0A80BE4
Oct 17 17:00:38 LXSRV00410 in.tftpd[4697]: tftp: client does not accept options
Oct 17 17:00:38 LXSRV00410 in.tftpd[4698]: RRQ from 192.168.11.228 filename pxelinux//C0A80BE4
Oct 17 17:00:38 LXSRV00410 in.tftpd[4699]: RRQ from 192.168.11.228 filename pxelinux//C0A80BE4
Oct 17 17:00:38 LXSRV00410 in.tftpd[4700]: RRQ from 192.168.11.228 filename pxelinux//rhel6u6x86_64/vmlinuz
Oct 17 17:00:38 LXSRV00410 in.tftpd[4700]: tftp: client does not accept options
Oct 17 17:00:38 LXSRV00410 in.tftpd[4701]: RRQ from 192.168.11.228 filename pxelinux//rhel6u6x86_64/vmlinuz
Oct 17 17:00:40 LXSRV00410 dhcpd: DHCPDISCOVER from ac:16:2d:6e:3c:21 via bond0: network 192.168.11.0/24: no free lease                                        s
Oct 17 17:00:46 LXSRV00410 in.tftpd[4703]: RRQ from 192.168.11.228 filename pxelinux//rhel6u6x86_64/vmlinuz
Oct 17 17:00:54 LXSRV00410 in.tftpd[4704]: RRQ from 192.168.11.228 filename pxelinux//rhel6u6x86_64/initrd.img
Oct 17 17:00:54 LXSRV00410 in.tftpd[4704]: tftp: client does not accept options
Oct 17 17:00:54 LXSRV00410 in.tftpd[4705]: RRQ from 192.168.11.228 filename pxelinux//rhel6u6x86_64/initrd.img
for more info, search for the "HP DL580 G8 best practices guide".