Proxmox Automated Installation DHCP issue

willifehler

New Member
Jul 17, 2023
10
0
1
Hi there,

I'm trying to use https://pve.proxmox.com/wiki/Automated_Installation to deploy Proxmox on my servers.

I have an DHCP server to assign ip addresses to my servers. During the deployment sometimes my server does not get an ip address to be able to fetch the answer.toml from my webserver. If I execute dhclient a few seconds after the installation routine has failed I do get an ip address. Is there any option include a dhcp timeout in my iso or another way to solve this issue?

Regards - Willi
 
Last edited:
As of now, there is no way to increase the timeout for the DHCP client in the installer. So your only chance right now is to figure out why the DHCP leases aren't provided quickly all the time. Is the DHCP server too slow? Does it have some other dependencies that it needs to query before it gives out a lease that might take too long?
 
Hi aaron,

I don't see any reason why it takes too long. The server has 8 NICs.

I will try to debug this or include the answer.toml in my iso.

Cheers - Willi
 
Last edited:
Hi There,

I am struggling with similar problem. I am working on automated provisioning of Supermicro network appliance (SYS-510D series)
The server has an internal/virtual interface connected to BMC and it provides "dummy" APIPA address over DHCP before the MGMT interface gets the IP from the DHCP Server.
I thought initially that the dhcp server was responding too slowly but I captured packets and the DHCP Discover msgs are not showing up on the wire during the boot up. I can see them only after I manually run dhclient

Any suggestions will be highly appreciated.

Edit:
I have disabled the RNDIS interface (the virtual ethernet connection to BMC) and now the installer will go through the DHCP discover stage twice before timing out. However there are no DHCP discover sent.
Only after I execute the dhclient command, I am getting DHCP discover message.
Something is broken during the creation of the automated ISO.
 
Last edited:
Hello friends,

had the exact same issue, no DHCP Requests were sent and it just failed. Guess it's because the link needs time to come up. I found a dirty solution which is working for me:

Code:
## make tmp folder and mount iso to it
mkdir tmp; mount -o loop proxmox-ve_8.3-1-auto-from-http-url.iso tmp

## create mnt folder and mount the pve-installer.squashfs file to it
mkdir mnt; mount --type="squashfs" --options="loop" tmp/pve-installer.squashfs mnt

## create another tmp folder and copy the contents of squashfs to it
mkdir tmp2; cp -aR mnt/* tmp2/

## modify the file "usr/sbin/unconfigured.sh", in line 227 it has "dhclient -v".
## Just add two more lines of "dhclient -v" after it, so the command will be executed three times
## the resulting part of the file will look like this:

Code:
echo -n "Attempting to get DHCP leases... "
dhclient -v
dhclient -v
dhclient -v
echo "done"

Code:
## repack the modified files into squashfs file
mksquashfs tmp2/ test.squashfs -comp zstd -Xcompression-level 22 -b 256k

## copy all iso contents into a new folder and also copy newly created squashfs file into it
mkdir iso_repacked; cp -a tmp/ iso_repacked; cp test.squashfs iso_repacked/pve-installer.squashfs

## extract mbr from original iso file
dd if=proxmox-ve_8.3-1.iso bs=512 count=1 of=proxmox.mbr

## create new iso
xorriso -as mkisofs -o repacked.iso -r -V 'PVE' --modification-date=2024112811311000 -isohybrid-mbr proxmox.mbr -partition_offset 16 --protective-msdos-label -appended_part_as_gpt -efi-boot-part --efi-boot-image -c '/boot/boot.cat' -b '/boot/grub/i386-pc/eltorito.img' -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info -eltorito-alt-boot -e '/efi.img' -no-emul-boot iso_extracted

## re-create initrd with iso inside, to make it pxe bootable (using pve-iso-2-pxe.sh) and enjoy
 
Last edited:
Thank you @LM1117 for your instructions on iso repacking. Using that, I was able to come up with a suggested patch to add dhclient timing options as recognized kernel commandline args. Fingers crossed it gets accepted. There may be quite a bit of trial and error to find the right combination that works for a particular environment, but this is a good start I think.
 
I have the same Problem as @Roman.Roman. I'll try the fix @LM1117 suggested. And report back. What i dont get, when i was playing with this feature last year arround oktober/nov, it worked just fine?
 
I'm seeing the same issue. Failure to get DHCP lease within timeout initially, but running "dhclient" once the installer falls back to the root shell, I get a lease immediately.
 
I worked aroud this Problem: