4.5.2 Adding a PXE Client to be Provisioned by Spacewalk

To add a PXE client to be provisioned by Spacewalk:

  1. List the Kickstart profiles in Spacewalk that are usable by Cobbler.

    # cobbler profile list
       ol6u6-x86_64-devsys:1:SpacewalkDefaultOrganization
       ol6u6-x86_64-server:1:SpacewalkDefaultOrganization
  2. Use the cobbler system add command to define the host name, MAC address, and IP address of the target PXE client and the profile that you want to install, for example:

    # cobbler system add --name=svr1.mydom.com --hostname=svr1.mydom.com --mac=08:00:27:c6:a1:16 \
      --ip=92.168.1.253 --profile=ol6u6-x86_64-server:1:SpacewalkDefaultOrganization

    If you are provisioning a client that uses an IP address from a DHCP address pool, you might use a command such as the following:

    # cobbler system add --name=devsys2 --hostname=devsys2 \
      --profile=ol6u6-x86_64-devsys:1:SpacewalkDefaultOrganization \
      --kopts="ksdevice=eth0"

    The --kopts option allows you to specify options to be added to the kernel boot line. In this example, ksdevice=eth0 specifies the network interface that Kickstart should use for installation, which prevents the installation pausing to prompt you to choose which network interface to use.

    In this example, the ol6_desktop profile would use a Kickstart configuration that installs a set of packages to configure a development system rather than a server system.

  3. By default, GRUB displays a boot menu for UEFI-based clients and prompts you to choose an entry. To prevent GRUB from displaying this menu, edit /etc/cobbler/pxe/grubsystem.template and add default=0, hiddenmenu, and timeout=0 entries, for example:

    default=0
    hiddenmenu
    timeout=0
    
    title $profile_name
        root (nd)
        kernel $kernel_path $kernel_options
        initrd $initrd_path
  4. Run cobbler sync.

    # cobbler sync
    task started: YYYY-MM-DD_hhmmss_sync
    task started (id=Sync, time=date)
    ...
    generating PXE configuration files
    generating: /var/lib/tftpboot/pxelinux.cfg/01-08-00-27-c6-a1-16
    generating: /var/lib/tftpboot/grub/01-08-00-27-c6-a1-16
    rendering DHCP files
    generating /etc/dhcp/dhcpd.conf
    ...
    *** TASK COMPLETE ***

    Cobbler creates pxelinux and GRUB boot configuration files for the client in /var/lib/tftpboot/pxelinux.cfg and /var/lib/tftpboot/grub. These files are named for the client's MAC address prefixed by 01-, which represents the ARP hardware type for Ethernet, and use dashes to separate each byte value instead of colons. These client-specific files are based on /etc/cobbler/pxe/pxesystem.template and /etc/cobbler/pxe/grubsystem.template.

    Cobbler also creates generic pxelinux.cfg/default and grub/efidefault boot configuration files from /etc/cobbler/pxe/pxeprofile.template and /etc/cobbler/pxe/grubprofile.template.

    Cobbler adds an entry for the client to /etc/dhcp/dhcpd.conf, which is based on /etc/cobbler/dhcp.template, for example:

    # group for Cobbler DHCP tag: default
    group {
        host generic1 {
            hardware ethernet 08:00:27:c6:a1:16;
            fixed-address 192.168.1.253;
            option host-name "svr1.mydom.com";
            if substring(vendorclass, 0, 9)="PXEClient" {
              if pxetype=00:06 or pxetype=00:07 {
                  filename "/grub/grub.efi";
              } else {
                  filename "/pxelinux.0";
              }
            }
            next-server swksvr.mydom.com;
        }
    }
  5. Enter the cobbler system list command to display the PXE systems that are known to Cobbler.

    # cobbler system list
       svr1.mydom.com