Skip to content

Instantly share code, notes, and snippets.

@ThinGuy
Created November 14, 2024 18:07
Show Gist options
  • Save ThinGuy/9f1e234108b85b69381eb9f2c993aede to your computer and use it in GitHub Desktop.
Save ThinGuy/9f1e234108b85b69381eb9f2c993aede to your computer and use it in GitHub Desktop.
How to Configure Microsoft DHCP for Canonical MAAS

How to Configure Microsoft DHCP for Canonical MAAS

This guide explains how to configure an external Microsoft DHCP server to work with Canonical MAAS (Metal as a Service). Configuring the right DHCP options will ensure that nodes are able to correctly PXE boot and communicate with MAAS for provisioning.

Step 1: Open the DHCP Management Console

  1. On your Windows Server, press Windows + R, type dhcpmgmt.msc, and press Enter.
  2. Alternatively, you can access it through Server Manager by selecting Tools -> DHCP.

Step 2: Select the DHCP Scope to Configure

  1. In the DHCP console, navigate to the appropriate scope that you want to configure for MAAS nodes.
  2. Expand your DHCP server, then expand IPv4, and select the specific Scope where MAAS nodes will reside.

Step 3: Configure Scope Options for PXE Boot

  1. Right-click on Scope Options and select Configure Options.

Step 4: Set the Required DHCP Options

  1. Option 66: Boot Server Host Name (next-server)

    • Check the box for Option 66.
    • In the String Value field, enter the IP address of your MAAS rack controller (typically the MAAS server providing PXE services).
  2. Option 67: Bootfile Name (filename)

    • Check the box for Option 67.
    • In the String Value field, enter the boot file name that MAAS needs to serve:
      • pxelinux.0 for BIOS boot.
      • grubx64.efi for UEFI boot (for x86_64 architecture).
      • shimx64.efi for UEFI Secure Boot.
    • Choose the appropriate filename based on your nodes’ architecture and setup.

Step 5: Set Optional DHCP Options (Recommended)

  1. Option 42: NTP Servers

    • To ensure time synchronization across nodes, configure Option 42.
    • Check the box for Option 42 and enter the IP address of your NTP server.
  2. Option 60: PXEClient

    • You may need to set Option 60 to specify the DHCP client class identifier.
    • Set Option 60 to "PXEClient" to ensure that the DHCP server provides options specifically to PXE clients.

Step 6: Confirm and Apply Settings

  1. Once all options are configured, click OK to save your changes.
  2. Make sure the settings are applied to the correct scope or at the Server Options level if you want these settings to apply to multiple scopes.

Step 7: Reserve IP Addresses for MAAS Nodes (Optional but Recommended)

  1. To prevent IP conflicts and ensure that MAAS knows which IP addresses belong to which nodes, create reservations for each node.
  2. Right-click on Reservations under the relevant scope and select New Reservation.
  3. Provide the Reservation Name, IP address, MAC address of the node, and a Description.
  4. Click Add to create the reservation.

Additional Notes

  • Scope Options vs Server Options: You can set these DHCP options at either the scope level (affecting a specific range of IP addresses) or the server level (affecting all scopes managed by the DHCP server). Setting options at the scope level is generally recommended for limiting PXE boot configuration to just the MAAS-managed nodes.
  • Boot File and Architecture: Ensure that you provide the correct boot file for BIOS or UEFI. MAAS dynamically selects the correct bootloader, but the DHCP server must serve the file requested by the node.
  • Testing: After configuring the DHCP options, test with one of the MAAS nodes to ensure that it can acquire an IP address and successfully boot using PXE.

Finished

Your Microsoft DHCP server should now be correctly configured to work with MAAS, enabling proper communication and provisioning of nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment