Product SiteDocumentation Site

5.8. Kickstarting a Machine

5.8.1. Bare Metal

Satellite provides three mechanisms by which you can provision bare metal machines — machines that have no operating system or that have the wrong operating system installed:
  1. Boot Anaconda-style operating system installation disk
  2. PXE boot
  3. Boot Cobbler boot disk

5.8.1.1. Booting from an Anaconda Style Installation Disk

Simply boot the selected system using an installation disc that matches your kickstart. For example, if your kickstart was configured to use the ks-rhel-i386-server-5-u2 kickstart tree, you must boot with the Red Hat Enterprise Linux 5.2 i386 installation disc. When the boot prompt comes up, simply type:
linux ks=http://satellite.example.com/path/to/kickstart
The system will boot, download the kickstart, and re-install itself.

5.8.1.2. PXE Booting

PXE booting is a very convenient method of installing and reinstalling your physical systems, but does come with a few requirements:
  • You must have a DHCP server, even if your systems are to be configured statically after installation.
  • As DHCP does not normally cross network (router) boundaries, you will need to make special provision to ensure that all of your machines can connect to your DHCP server in the event your machines reside on multiple networks. Options here include multi-homing your DHCP server (either real or trunked vlan) and configuring your routers or switches to pass DHCP across network boundaries.
  • You must be able to configure your DHCP server to point to the PXE server (the Satellite server), by setting the next-server address for the systems you want to be managed by Satellite.
  • Each system you have must support PXE booting at the BIOS level. Nearly all recent hardware should be able to do this.
  • You must have the TFTP service on and running.
5.8.1.2.1. Configuring an Existing DHCP Server
If you have a DHCP server deployed on another system on the network, you will need administrative access to the DHCP server in order to to edit the DHCP configuration file so that it points to the Cobbler server and PXE boot image.
As root on the DHCP server, edit the /etc/dhcpd.conf file and append a new class with options for performing PXE boot installation. For example:
allow booting;
allow bootp;
class "PXE" {
  match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
  next-server 192.168.2.1;
  filename "pxelinux.0";
}
Following each action step-by-step in the above example:
  1. The administrator enables network booting with the bootp protocol.
  2. Then, the administrator creates a class called PXE, which, if a system that is configured to have PXE first in its boot priority, identifies itself as PXEClient.
  3. Then DHCP server then directs the system to the Cobbler server at 192.168.2.1.
  4. Finally, the DHCP server refers to the boot image file (in this case, at /var/lib/tftpboot/pxelinux.0.
5.8.1.2.2. Xinetd and TFTP
Xinetd is a daemon that manages a suite of services, including TFTP, the FTP server used for transferring the boot image to a PXE client.
To configure TFTP, you must first enable the service via Xinetd. To do this, edit the /etc/xinetd.d/tftp as root and change the disable = yes line to disable = no.
Alternatively, you can use the following command:
chkconfig xinetd on
Before TFTP can start serving the pxelinux.0 boot image, you must start the Xinetd service.
chkconfig --level 345 xinetd on
/sbin/service xinetd start
The chkconfig command turns on the xinetd service for all user runlevels, while the /sbin/service command turns on xinetd immediately.
5.8.1.2.3. Configuring SELinux and IPTables for Cobbler Support
Red Hat Enterprise Linux is installed with SELinux support in addition to secure firewall enabled by default. To properly configure a Red Hat Enterprise Linux server to use Cobbler, you must first configure these system and network safeguards to allow connections to and from the Cobbler Server.
5.8.1.2.3.1. SELinux Configuration
To enable SELinux for Cobbler support, you must set the SELinux boolean to allow HTTPD web service components. Run the following command as root on the Cobbler server:
setsebool -P httpd_can_network_connect true
The -P switch is essential, as it enables HTTPD connection persistently across all system reboots.
You must also set SELinux file context rules to ensure Cobbler properly functions in an SELinux system.
Run the following as root on the Cobbler server:
semanage fcontext -a -t public_content_t "var/lib/tftpboot/.*"
The command sets file context for TFTP to serve the boot image file.
5.8.1.2.3.2. IPTables Configuration
Once you have configured SELinux, you must then configure IPTables to allow incoming and outgoing network traffic on the Cobbler server.
If you have an existing firewall ruleset using IPTables, you need to add the following rules to open the requisite Cobbler-related ports. The following lists each of the requisite rules with their associated service.
  • For TFTP:
    /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 69 -j ACCEPT
    /sbin/iptables -A INPUT -m state --state NEW -m udp -p udp --dport 69 -j ACCEPT
    
  • For HTTPD:
    /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
    /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
    
  • For Cobbler:
    /sbin/iptables -A INPUT -m state --state NEW -m tcp -p udp --dport 25150 -j ACCEPT
    
  • For Koan:
    /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 25151 -j ACCEPT
    
Once those firewall rules are entered, be sure to save the firewall configuration:
/sbin/iptables-save
5.8.1.2.4. Syncing and Starting the Cobbler Service
Once all the prerequisites specified in cobbler check are met, you can now start the Cobbler service.
First, ensure that the configuration files are all synchronized by running the following command:
cobbler sync
Then, start the Satellite server:
/usr/sbin/rhn-satellite start

Warning

Do not start or stop the cobblerd service independent of the Satellite service, as doing so may cause errors and other issues.
Always use /usr/sbin/rhn-satellite to start or stop RHN Satellite.
5.8.1.2.5. Cobbler configuration
Cobbler is already set up to generate PXE configurations, but you may want to adjust the pxe_just_once configuration option depending on how your machines BIOSes are configured, for the best possible PXE workflow.
A common setup has PXE occur first in the BIOS order, effectively not booting off the local disk unless the PXE server instructs the system to do so remotely. By having pxe_just_once: 1 (enabled) in /etc/cobbler/settings, it will prevent "boot loops" where the system continually reinstalls. What happens is that the $kickstart_done macro in the kickstart templates will expand into a directive that indicates to the cobbler server that the system will then boot locally, instead of booting from the network. Then, to reinstall the system, the netboot-enabled flag on the system can be toggled back on via the Satellite GUI or Cobbler. Once enabled, the next time the system power cycles it will PXE install instead of booting locally. At the end of each install, the server will trip the netboot-enabled flag back to off again to tell the system to boot to the local hard drive the next time it powers up. Note that if your kickstart is missing the $kickstart_done line in %post, this will not work, and boot loops will occur.
With pxe_just_once set to 0, the netboot enabled flag will not be disabled after an install, so if PXE is first in your BIOS boot order, the system will loop indefinitely. If you have the BIOS of the system set up to boot to local hard drives first, though, there is no need to set pxe_just_once enabled, but to re-PXE a system it is then neccessary to zero out the MBR of that system.
5.8.1.2.6. Cobbler System Record
Cobbler system records are objects within cobbler that keep track of a system and its associated kickstart profile. To do PXE kickstarting you'll need to ensure that a Satellite kickstart profile is tied to Cobbler system records corresponding to the machines you intend to PXE kickstart to that profile. To make this association:
  1. Visit the System details page of each system in question and click on the Provisioning link
  2. Select the kickstart profile you want to associate it with
  3. Click the Create Cobbler System Record button.
Once you've made this association, it will remain in place forever unless you have set pxe_just_once to true in cobbler for any given machine. In that case the association will be broken after a successful kickstart.
Without this association, a machine that PXE bootstraps to a Satellite server will be presented with a menu of kickstart profiles which requires manual interaction.

5.8.1.3. Cobbler Boot ISO

The Cobbler boot ISO is a disk image that can be built on your Satellite server and burned to a CD or DVD. You can then boot any system with it. When you do you will see a menu of available kickstarts similar to the one you would see if you PXE boot a machine off a Cobbler server without a system record. Simply select the kickstart you want, and the system will start to install itself. Any time you add a kickstart within Satellite, you will need to recreate the ISO and re-burn it to an optical disc.
To create a boot ISO, log in to your Satellite server as root and run cobbler buildiso. The ISO will contain all kernel/initrd images stored in your Satellite along with all associated kernel argument settings. Kickstart files will be sourced remotely. This means that changes to the kickstart templates can be made without having to re-burn the CD. If you create a new kickstart profile and want to use it via the cobbler boot ISO, you will need to recreate a fresh disc.

Note

Due to issues with the version of syslinux shipped with Red Hat Enterprise Linux 4, this command will not work unless the Satellite is running on Red Hat Enterprise Linux 5. Also since syslinux is not available for s390x, it is not possible to use this on a satellite running on s390x.

5.8.2. Re-Provisioning

Re-provisioning is the act of reinstalling an existing system. It could be reinstalled to the same version and release, or to a completely new version. When you re-provision through the Satellite web interface your system will use the same system profile that it had before it was re-provisioned. This can be useful as much of the information and settings about the system such as its history will be preserved.
You can schedule a re-provision from the provisioning tab while viewing a system. If you would like to configure additional options click on the Advanced Options page. On this page you can configure details such as kernel options, networking information, and package profile synchronizations. The Kernel Options section pertains to kernel options used during kickstart. Post Kernel Options are the kernel options that will be used after the kickstart is complete and the system is booting for the first time.
For example:
  • If you want to establish a VNC connection so you can monitor the kickstart remotely, include vnc vncpassword=PASSWORD in the Kernel Options line
  • If you want the kernel of the resulting system to boot with the noapic kernel option, add noapic to the Post Kernel Options line
Note that this requires a system that is accessible over your network and already registered to Satellite. If you are reinstalling a system that is not registered to Satellite, there are several options:
  • PXE
  • Use cobbler buildiso
  • Install koan and spacewalk-koan on the system and use the koan command line tool, pointing at the Satellite server, to install a named profile
Koan is covered in a later section.

5.8.2.1. File Preservation

If you would like to keep some files across a re-provision you can use Satellite's File Preservation mechanism. This mechanism stores files temporarily during the kickstart and restores them at the end. To create a file preservation list:
  • Go to Systems => Kickstart => File Preservation Lists and create a list of files to preserve
  • After creation, associate your list with a kickstart:
    • Go to Systems => Kickstart => Profiles
    • Select on the desired profile
    • Select System Details => File Preservation
    • Select your file preservation list

Note

File preservation lists are only available on Wizard-style kickstarts and are only available during re-provisioning.

5.8.3. Virtualized Guest Provisioning

The following forms of Virtual Guest Provisioning is supported in Satellite 5.3:
  • KVM Virtualized Guest
  • Xen Fully-Virtualized Guest
  • Xen Para-Virtualized Guest
Virtualization Type is set when when creating your kickstart profile. To provision a guest regardless of its type, follow the following steps:
  1. Ensure the host system has a Virutalization or Virtualization Platform system entitlement
  2. Go to the Guest Provisioning page at Systems => click on the desired virtual host => Virtualization => Provisioning
  3. Select the kickstart profile you would like and enter a guest name
  4. Select Schedule Kickstart and Finish
If you would like to configure additional parameters such as guest memory and cpu usage, simply click on the Advanced Configuration button. The following can be configured:
  • Network (static/DHCP)
  • Kernel Options
  • Package profile sync (When the kickstart finishes the system will sync its package profile to that of another system or stored profile)
  • Memory Allocation (RAM, Default of 512MB)
  • Virtual Disk Size
  • Virtual CPUs (Default of 1)
  • Virtual Bridge (The networking bridge used for the install. xenbr0 is the default for Xen provisioning and virbr0 is the default for KVM. Note that virbr0 is not an actual bridge, so in that case it is best to configure host networking to create an actual bridge if outside networking is desired — and it almost always is — xenbr0 is an actual bridge, and usage is recommended if it exists).
  • Virtual Storage Path (Path to either a file, LVM Logical Volume, directory, or block device with which to store the guest's disk information, such as /dev/sdb, /dev/LogVol00/mydisk, VolGroup00, or /var/lib/xen/images/myDisk)

5.8.4. Provisioning Through an RHN Proxy

If you have an RHN Proxy installed and registered to your satellite you can easily provision through it. When provisioning a virtual guest or doing a re-provisioning of a system, simply select the desired Proxy from the Select Satellite Proxy drop down box. If you are doing a bare metal installation, you can replace the Satellite's FQDN with that of the Proxy's. For example if the URL to your kickstart file is:
http://satellite.example.com/ks/cfg/org/1/label/myprofile
Then to kickstart through the proxy, use:
http://proxy.example.com/ks/cfg/org/1/label/myprofile