morph027 / pve-iso-2-pxe

Create PXE bootable Proxmox installation
MIT License
407 stars 90 forks source link

Proxmox 8.2 auto install with answer file. #47

Open exc414 opened 1 week ago

exc414 commented 1 week ago

Hello,

I used pve-sio-2-pxe script and ipxe example to get proxmox booted using ipxe. That worked without issues. However, I notice that this removes the ability to automatically install proxmox with an answer file.

If I use my custom iso that I made as per proxmox instructions, using a USB the automated installation works. However, when I run the custom iso through the pve-iso-2-pxe.sh. I then copy the initrd and linux26, automation is no longer possible.

Command to create custom iso with answer :

proxmox-auto-install-assistant prepare-iso /path/to/source.iso --fetch-from http --url "https://10.0.0.100/get_answer/"

Docs : https://pve.proxmox.com/wiki/Automated_Installation (Answer Fetched via HTTP)

I found a thread : https://forum.proxmox.com/threads/auto-install-through-pxe.146270/

There is a suggestion that adding : proxmox-start-auto-installer to kernel cmdline might required. My ipxe script looks like

set opts ?vga=791&video=vesafb:ywrap,mtrr&ramdisk_size=16777216&rw&quiet&initrd=initrd
set kernel ${webserver}/linux26${opts}&splash=verbose&proxdebug
initrd ${webserver}/initrd
chain ${kernel}

I tried adding proxmox-start-auto-installer at the end of the set kernel line with &proxmox-start-auto-installer, however that did not work.

I am wondering if anyone has run into this issue or has any guidance on how to proceed.

Thank you.

morph027 commented 1 week ago

Haven't tested this feature yet, but will try later.

Is there a reason you're using the question marks within the opts and kernel?

Can you try

set opts "vga=791 video=vesafb:ywrap,mtrr ramdisk_size=16777216 rw quiet initrd=initrd"
set kernel "${webserver}/linux26 ${opts} splash=verbose proxdebug proxmox-start-auto-installer"
initrd ${webserver}/initrd
chain ${kernel}
exc414 commented 6 days ago

Hello,

Thank you for your response. So I tried the above. I get the following error :

set opts "vga=791 video=vesafb:ywrap,mtrr ramdisk_size=16777216 rw quiet initrd=initrd"
set kernel "${webserver}/linux26 ${opts} splash=verbose proxdebug proxmox-start-auto-installer"
initrd ${webserver}/initrd
chain ${kernel}

ipxeboot

It seems it puts %20 into the spaces, which then makes the boot fail. I found the way I did it from this issue here : https://github.com/morph027/pve-iso-2-pxe/issues/32

Quoting the above issue :

The iPXE client loaded initrd OK but then returned file-not-found errors when trying to load linux26 with options. I think the syntax, with spaces, is an issue. My workaround was to change the "opts" value into the form of a PHP query, starting with a "?" and then delimiting each key/value pair with an "&" character:

set opts "?vga=791&video=vesafb:ywrap,mtrr&ramdisk_size=16777216&rw&quiet&initrd=initrd" .. set kernel "${webserver}/proxmox/${pveversion}/linux26${opts}&splash=silent

Note the lack of spaces in the "set kernel" line.

Also I am using iPXE 1.2.1, don't know if that matters. Thank you.