Auto install through PXE

SCO

Member
Feb 23, 2022
2
0
6
24
Since the auto install feature has been released, I was wondering if anyone has successfully deployed a PVE installation completely automatically using PXE boot?
I have tried in the past installing using PXE boot with a `preseed.cfg` file but was unable to configure ZFS this way. I also tried the USB method of auto installing using this new feature and it works perfectly but I would like to use the PXE boot way for bulk deploying physical servers.
Also big thanks to all the devs for making this auto install feature possible!
 
I haven't tried it yet, but isn't Ventoy able to boot ISOs via the network? This could be just as simple as the USB approach.
 
  • Like
Reactions: SCO
I haven't tried it myself yet, but there is this script that promises to generate a pxe boot image from a Proxmox VE ISO: https://github.com/morph027/pve-iso-2-pxe

The boot options will most likely need to be adapted as you need to pass proxmox-start-auto-installer as kernel cmdline option.
 
Last edited:
  • Like
Reactions: SCO
I was able to do the install through pxe and although it took me some time to work out all the details I got it working
Initially wanted to use proxmox-start-auto-installer but hit some roadblocks:
  1. Need to use POST for obtaining config meant running a new server just to answer with the config file, instead of my current infrastructure which is a simple file server which support HTTP/S Get, NFS, TFTP.
  2. Requirement to insert iso into initmfs
    1. Worked on bios but was giving me problems with uefi, not sure what the exact problem wasnt able to debug it that much, but was mainly due to its size and possibly the vm i was doing dev work on.
  3. Required some extra customizations as i needed to double encrypt my drives and that is not possible during the regular install
What i did was:
  1. Based on https://github.com/morph027/pve-iso-2-pxe extracted initrd and linux26 from the iso
  2. Tried to add network drivers to linux26 from the ones in squashedfs (installer/base) but for some reason couldnt load them, so ended up needing to add both squahsedfs to the initial initrd. (Wanted to create nfs mountpoint or http download instead of including them on the inital initrd)
  3. Modify init from initrd to mount the included squashedfs instead of looking for an iso, and modify the initial script that was called from init, to my own to start the install.
  4. Added one parameter to the cmdline with a kickstart script, (based on my experience with centos/rocky kickstart), which i download and execute to enable customization while keeping a common initrd/linux26 for any install.
  5. Then looked through the low level install script that is written in perl and wrote the custom kickstart script to do the same without the need to handle all options as it doesn't need to be interactive anymore.
    1. Create partitions
    2. Create FS
    3. Create chroot environment and mounts
    4. chroot into target install and install proxmox packages
    5. Install additional packages not included with proxmox that i needed (cryptsetup in my case)
    6. set config options as the original proxmox script does.
    7. make my own custom changes to fit my config
    8. generate initramfs, i dont use grub only systemd-boot to support encryption on root level, due to grub complaining with zfs encryption about not recognizing the filesystem.
    9. Leave chroot, unmount fs, set correct mountpoints for my zfs fs and export them.
    10. reboot

Upon boot i get the password prompts, system unlocks and proxmox runs. Honestly the thing that took me the longest was understanding how initrd worked and how to append to it correctly. And going through the perl script and making sure i didnt miss any steps. Grub was a pain but it was that in my cases it doesnt support zfs encryption and i didnt know that by the error it was raising.
 
Last edited:
  • Like
Reactions: SCO
I haven't tried it yet, but isn't Ventoy able to boot ISOs via the network? This could be just as simple as the USB approach.
iVentoy was the easiest method so far, however I still have to press enter in the iVentoy menu to boot the iso. Can this be bypassed somehow? I didn't find much info about bypassing this
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!