Generic Kickstart
Want to perform a network install of a node that won't be a ROCKS client but using the ROCKS frontend as the kickstart server.
Have tried and failed to get this to work using the ROCKS rpm distribution. It works fine using a generic SL rpm distribution. It seems that ROCKS modifications to the installer are not compatible with using a non-ROCKS kickstart file?
The frontend will provide these services for the install:
- DHCP
- TFTP of kernel and initrd (PXE boot)
- http access to distro below install/rolls
- http serving of kickstart file
- reset of PXE boot to default "os"
Get Distro
Will download a generic SL distro and place it below /home/install/rolls/SL, this is a convenient place as the ROCKS apache config allows access to it. Also made a directory /home/install/rolls/SL/ks for kickstart files.
Copy the install kernel and initrd images from this distro to /tftpboot/pxelinux, giving them unique names.
Setup host for DHCP and DNS
Add a new appliance type to the ROCKS db that doesn't have the "compute" property.
# rocks add appliance kickstart compute=0 membership=kickstart
# rocks list appliance
APPLIANCE SHORTNAME GRAPH NODE
kickstart: NULL default ----------------------
# rocks list membership
MEMBERSHIP APPLIANCE
kickstart: kickstart
Now add a host (should be able to use insert-ethers here if desired):
# rocks add host test-0 cpus=2 membership=kickstart rack=100 rank=2
# rocks list host test-0
MEMBERSHIP CPUS RACK RANK COMMENT
kickstart 2 100 2 -------
Add some network config for the node:
# rocks add host interface test-0 eth0
# rocks set host interface ip test-0 eth0 10.10.2.42
# rocks set host interface mac test-0 eth0 00:0c:29:51:5d:47
# rocks set host interface name test-0 eth0 test-0
# rocks set host interface subnet test-0 eth0 private
Do "rocks sync config", the node should now be in DNS. The node won't be included in list of nodes for "cluster-fork" since the appliance does not have the compute property set.
Add PXE stuff. A new "kickslx4" action is added, since we don't specify a hostname, this action will be "global" and available to any host. Then the node is setup to use it. (Note that the node had no PXE action configured, ROCKS didn't do it after the above actions were done.)
# rocks list host pxeboot test-0
ACTION
------
# rocks add host pxeaction action="kicksl4x" command="kernel vmlinuz.sl4x" args="append initrd=initrd.img.sl4x"
# rocks set host pxeboot test-0 action=kicksl4x
# rocks list host pxeboot test-0
ACTION
kicksl4x
# cat /tftpboot/pxelinux/pxelinux.cfg/0A0A022A
default rocks
prompt 0
label rocks
kernel vmlinuz.sl4x
append initrd=initrd.img.sl4x
Error Trying ROCKS Dist
Hum... Get installer going, enter info for partitioning etc. When installer tries to get RPM info, get error "Unable to read header list. This may be due to a missing file or bad media. Press
to try again." Oddly, don't see any http access at this point. Maybe this is something that has been altered in the ROCKS version of the installer?
Doing a Kickstart SL Install
Have a kickstart file in /home/install/rolls/SL/ks, will setup a PXE boot that supplies the kickstart file to client node for an automated install.
# rocks add host pxeaction test-0 action="kicksl4x-test-0" command="kernel vmlinuz.sl4x" args="append initrd=initrd.img.sl4x ks=http://10.10.2.15/install/rolls/SL/ks/test-0.ks ksdevice=eth0"
# rocks list host pxeaction test-0
ACTION COMMAND ARGS
kicksl4x-test-0 kernel vmlinuz.sl4x append initrd=initrd.img.sl4x ks=http://10.10.2.15/install/rolls/SL/ks/test-0.ks ksdevice=eth0
Use ROCKS to Change PXE Action in Kickstart
At the end of a normal ROCKS client install, the client makes a request to a cgi app causing the frontend to change the PXE action of the client. The PXE action is set to "os" so that the client will boot the local os instead of just re-running the installer on next boot. We can use this manually.
%post%
# ask frontend to set us to boot OS (default behavior of this cgi script)
wget --no-check-certificate https://10.10.2.15//install/sbin/public/setPxeboot.cgi
Not sure if wget is installed by default, might need to have the @ text-internet group in packages. Also in the main kickstart commands, you can add reboot, so the machine automatically comes up when rebooted.
YUM for local repo
Want the machine to refer to the local mirror of SL for yum updates.
On sl4x have these repos:
[root@test-0 ~]# grep enab /etc/yum.repos.d/*
/etc/yum.repos.d/adobe.repo:enabled=0
/etc/yum.repos.d/atrpms.repo:enabled=0
/etc/yum.repos.d/dag.repo:enabled=0
/etc/yum.repos.d/dries.repo:enabled=0
/etc/yum.repos.d/sl-contrib.repo:enabled=0
/etc/yum.repos.d/sl-errata.repo:enabled=1
/etc/yum.repos.d/sl-fastbugs.repo:enabled=0
/etc/yum.repos.d/sl.repo:enabled=1
/etc/yum.repos.d/sl-testing.repo:enabled=0
Want to disable sl-errata.repo and sl.repo and add replacements pointing to local source.
[root@test-0 ~]# perl -pi -e 's/enabled=1/enabled=0/' /etc/yum.repos.d/sl-errata.repo
[root@test-0 ~]# perl -pi -e 's/enabled=1/enabled=0/' /etc/yum.repos.d/sl.repo
[root@test-0 ~]# wget -O /etc/yum.repos.d/local-sl-errata.repo http://10.10.2.15/install/rolls/SL/ks/extras/local-sl-errata.repo
[root@test-0 ~]# wget -O /etc/yum.repos.d/local-sl.repo http://10.10.2.15/install/rolls/SL/ks/extras/local-sl.repo
[local-sl-base]
name=Local SL 4 base
baseurl=http://10.10.2.15/install/rolls/SL/4x/$basearch/SL/RPMS/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-csieh file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson file:///etc/pki/rpm-gpg/RPM-GPG-KEY-jpolok file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern
[root@test-0 ~]# cat /etc/yum.repos.d/local-sl-errata.repo
[local-sl-errata]
name=Local SL 4 errata
baseurl=http://10.10.2.15/install/rolls/SL/4x/$basearch/errata/SL/RPMS/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-csieh file:///etc/pki/rpm-gpg/RPM-GPG-KEY-dawson file:///etc/pki/rpm-gpg/RPM-GPG-KEY-jpolok file:///etc/pki/rpm-gpg/RPM-GPG-KEY-cern
-- TomRockwell - 24 Mar 2009