netbootxyz / netboot.xyz

Your favorite operating systems in one place. A network-based bootable operating system installer based on iPXE.
https://netboot.xyz
Apache License 2.0
8.47k stars 651 forks source link

Add support for official xcp-ng installer #1475

Open lordtangent opened 3 weeks ago

lordtangent commented 3 weeks ago

Is your feature request related to a problem? Please describe. xcp-ng installer isn't currently supported. It's based on Centos and has a netinstaller ISO and documentation for netbooting so it should be possible to get it working in netboot.xyz

Describe the solution you'd like It would be great if the netinstaller could be PXE booted with the option to use an answerfile for fully automated installs pulling from a local mirror. I'd use it to provision bare metal servers with hypervisors.

Describe alternatives you've considered I tested getting the xcp-ng installer ISO to boot via memdisk as per the FAQ with no luck. I even tried increasing vmalloc but I'm not sure I did it correctly. (still got the error MEMDISK: boostrap too large to load )

Additional context I'd be happy to help maintain the xcp-ng stuff once it's in but I don't think I have the skills to add xcp-ng myself. Between not being very familiar with iPXE and being rusty in Ansible the menu templates are pretty overwhelming to me.

lordtangent commented 3 weeks ago

Update I did some homework and a proof of concept to help validate if this is possible.

The xen kernel xcp-ng uses needs the mboot.c32 module from syslinux to boot. I haven't tried chain loading it from iPXE but I assume it would be possible. I used lpxelinux.0 as my NBP since that's very close to the example in the xcp-ng docs. The reason for going with lpxelinux.0 is I wanted to test getting stuff loading over HTTP also. HTTP worked a treat and was substantially faster than TFTP.

# here is the pxelinux.cfg/default for a purely tftp boot. It seems to be faster for some reason (even though tftp is supposed to be slow... or so they say)
DEFAULT xcp-ng
LABEL xcp-ng
    KERNEL mboot.c32
    APPEND xcp-ng/xen.gz dom0_max_vcpus=2 dom0_mem=2048M,max:2048M com1=115200,8n1 console=com1,vga --- xcp-ng/vmlinuz xencons=hvc console=hvc0 console=tty0 --- xcp-ng/install.img

# here is the pxelinux.cfg/default for a hybrid tftp / http boot. It was substantially faster than straight TFTP for loading everything.
DEFAULT xcp-ng
LABEL xcp-ng
    KERNEL http://XXX.XXX.XXX.XXX/xcp-ng/8.2.1/boot/pxelinux/mboot.c32
    APPEND http://XXX.XXX.XXX.XXX/xcp-ng/8.2.1/boot/xen.gz dom0_max_vcpus=2 dom0_mem=2048M,max:2048M com1=115200,8n1 console=com1,vga --- http://XXX.XXX.XXX.XXX/xcp-ng/8.2.1/boot/vmlinuz xencons=hvc console=hvc0 console=tty0 --- http://XXX.XXX.XXX.XXX/xcp-ng/8.2.1/install.img