Setting a VLAN for PXEboot for Ubuntu installer?

We need to use a VLAN to PXEboot some bare-metal systems. Right now I’m using DHCP+TFTP, but I may switch to HTTPBoot if I can get that working.

The problem is that this LAN requires VLAN tags to work. I can configure the NICs to use a VLAN, but that VLAN is lost as soon as the PXElinux boot image is loaded.

Is there a way to force the VLAN for the Ubuntu installer, or can I pass a VLAN via the Kernel Commandline?

For bonus points, it would be great if I could get the Discovery Image to know about the VLAN so that it can talk to the Foreman Discovery service.

I’ve tried the setting Kernel commandline options, using this vlan tag, but that’s not working. I’m not even sure if this is the right syntax:

APPEND initrd=boot/ubuntu-mirror-WKCIULkETfqj-initrd.gz interface=auto url= ramdisk_size=10800 root=/dev/rd/0 rw auto console-setup/ask_detect=false console-setup/layout=USA console-setup/variant=USA keyboard-configuration/layoutcode=us localechooser/translation/warn-light=true localechooser/translation/warn-severe=true locale=en_US ksdevice=bootif vlan=999

Any ideas?

HTTP UEFI boot is known to work on VLANs as well as PXE. We tested this on Red Hats, all we needed to do was to add a vlan option to kernel command line so Anaconda installer picks it up and configures network appropriately. Recent Foreman version does this automatically as long as you put VLANID into Foreman database for the provisioning NIC.

This is probably not implemented for Debian systems in Foreman tho, feel free to test this and then update our template.

In Ubuntu this has been a long-standing issue but last year it was finally resolved:

Thanks again for the detailed response. I’ll take another look at the Debian template-- in part, I’m just not sure where to make the change.

Thanks to the pointer to the Ubuntu initramfs bug. That’s very helpful to understand what will and what won’t work in Ubuntu 18.04.

PXELinux Preseed template.

Will do. I added a PR to Bug #30737: Allow Ubuntu 18.04 to netboot with a VLAN tag - Foreman