1

The environment I'm working in has dozens of different servers, and several times per year new ones get added. We use PXE booting (Legacy/BIOS and EFI) for provisioning these new machines. I'm in the process of changing our network install process from the previous debian-installer mechanism to the new autoinstall / cloud-init mechanism.

A limitation that I've noticed is that the syslinux (BIOS) or grub.cfg entry (EFI) points to a specific user-data url, e.g. http://example.org/ks/user-data. But what if you have many different machines that you'd like provisioned? The user-data file mandates things like a hostname be set in the identity block, making these files only really suited to provision a single specific machine.

So, my first inclination was to generate a separate user-data file for each host, to serve up. But, since that URL is hard-coded in your syslinux/grub config, how is this possible?

tl;dr Is there some mechanism in the new autoinstall/cloud-init system that facilitates providing different configurations depending on the host that is being PXE booted?

Kira
  • 11

1 Answers1

0

There are two approaches I have seen used.

  1. Create a very basic user-data file that is used for all machines. Within that user-data file, use early-commands to create a machine specific configuration at /autoinstall.yaml.

  2. Serve a custom user-data file to each device. What you can do depends on the capabilities of your DHCP server and PXE image. A simple solution is to serve different static files based on an attribute like MAC address. A more complex solution could generate files dynamically. Both Syslinux and Grub can change configuration based on MAC address, although I find Grub to be much more flexible.

Other discussions

These have more details and examples of the two approaches.