[arch-releng] PXEboot + unattended install
Hi all, Apologies if this has been covered before - I've been Googling for the few days, and found a lot of info on both of these topics - but not both together. As far as I can see, it's possible to boot an ArchLinux install instance over PXE (using the archboot project). I've managed to get that working just fine. I also understand that it's possible to pass a prewritten script to AIF to handle the actual install (and potentially the post-install steps?). I've not actually tried to write one of these yet, but it's next on my todo list. It seems the last tiny link to integrate the two is missing - I cannot find any documentation on how to get the installer to automatically execute an AIF script. I did find a slideshow (http://goo.gl/6I8QP) which on Slide 13 states this integration is a "Missing Feature" - is that still the case? As a bit of background (since this is my first post to the list) - I'm working heavily with Foreman (www.theforeman.org) which is a provisioning system for automatically deploying and installing machines. Since I'm a keen Arch user, I'm trying to add Arch support to Foreman. I have now added the PXE side of things (which works great), and I'm more than happy to help write/test any solutions to the above problem, since I can now re-image (via PXE) my Arch hosts with about 4 clicks in Foreman's interface :) Looking forward to learning more about this :) Cheers, Greg
On Sun, 20 Nov 2011 17:26:49 +0000 Greg Sutcliffe <greg.sutcliffe@gmail.com> wrote:
Hi all,
Apologies if this has been covered before - I've been Googling for the few days, and found a lot of info on both of these topics - but not both together.
As far as I can see, it's possible to boot an ArchLinux install instance over PXE (using the archboot project). I've managed to get that working just fine. I also understand that it's possible to pass a prewritten script to AIF to handle the actual install (and potentially the post-install steps?). I've not actually tried to write one of these yet, but it's next on my todo list.
It seems the last tiny link to integrate the two is missing - I cannot find any documentation on how to get the installer to automatically execute an AIF script. I did find a slideshow (http://goo.gl/6I8QP) which on Slide 13 states this integration is a "Missing Feature" - is that still the case?
As a bit of background (since this is my first post to the list) - I'm working heavily with Foreman (www.theforeman.org) which is a provisioning system for automatically deploying and installing machines. Since I'm a keen Arch user, I'm trying to add Arch support to Foreman. I have now added the PXE side of things (which works great), and I'm more than happy to help write/test any solutions to the above problem, since I can now re-image (via PXE) my Arch hosts with about 4 clicks in Foreman's interface :)
Looking forward to learning more about this :)
Cheers, Greg
AFAIK archiso images boot fine over pxe. (archboot is not official) archboot doesn't even use aif, but archiso does, and it accepts a 'script' boot parameter, which can do whatever you want, such as starting an aif automatic install. at least, that's how I remember things are. I didn't ever try this myself but IIRC other people have. Dieter
On 20 November 2011 18:28, Dieter Plaetinck <dieter@plaetinck.be> wrote:
AFAIK archiso images boot fine over pxe. (archboot is not official) archboot doesn't even use aif, but archiso does, and it accepts a 'script' boot parameter, which can do whatever you want, such as starting an aif automatic install. at least, that's how I remember things are. I didn't ever try this myself but IIRC other people have.
Dieter
Thanks for the fast reply Dieter. I was trying to avoid passing an entire iso over TFTP - my internal virtual network takes long enough just to pass the 80Mb initrd from archboot. I'll test it anyway (the netinst iso is only double that, not too bad), just so I've got a handle on how it works - thanks for the tip. Are there plans to integrate archboot and the main iso images (or aif) in some way? It feels odd that Arch is such a great minimalist distro once installed, but a 150Mb iso is needed to pxeboot it - when other, less clean, distros can pxeboot from the order of a 10-20Mb initrd. In all honesty though, I have no idea how much work that would be - it's been a few years since I last had to build my own initrds for pxebooting, and that was for RedHat 7.3 :) Thanks again for the heads up, Greg
On Sun, 20 Nov 2011 18:57:54 +0000 Greg Sutcliffe <greg.sutcliffe@gmail.com> wrote:
On 20 November 2011 18:28, Dieter Plaetinck <dieter@plaetinck.be> wrote:
AFAIK archiso images boot fine over pxe. (archboot is not official) archboot doesn't even use aif, but archiso does, and it accepts a 'script' boot parameter, which can do whatever you want, such as starting an aif automatic install. at least, that's how I remember things are. I didn't ever try this myself but IIRC other people have.
Dieter
Thanks for the fast reply Dieter. I was trying to avoid passing an entire iso over TFTP - my internal virtual network takes long enough just to pass the 80Mb initrd from archboot. I'll test it anyway (the netinst iso is only double that, not too bad), just so I've got a handle on how it works - thanks for the tip.
maybe there's a better way (like transmit something minimal, mount / over nfs or whatever), but i'm not familiar enough with archiso.
Are there plans to integrate archboot and the main iso images (or aif) in some way?
nope
On 20 November 2011 19:08, Dieter Plaetinck <dieter@plaetinck.be> wrote:
maybe there's a better way (like transmit something minimal, mount / over nfs or whatever), but i'm not familiar enough with archiso.
Indeed, I'm looking into gPXE to boot from an http-served iso. Hopefully that will scale better...
Are there plans to integrate archboot and the main iso images (or aif) in some way?
nope
Fair enough. Thanks again for info.
On Sun, 20 Nov 2011 19:22:15 +0000 Greg Sutcliffe <greg.sutcliffe@gmail.com> wrote:
On 20 November 2011 19:08, Dieter Plaetinck <dieter@plaetinck.be> wrote:
maybe there's a better way (like transmit something minimal, mount / over nfs or whatever), but i'm not familiar enough with archiso.
Indeed, I'm looking into gPXE to boot from an http-served iso. Hopefully that will scale better...
I don't know what you intend to achieve but you cannot do random seeks over http, so it will still download the entire iso file. Have a good look at archiso, maybe it has some optimizations for pxe. Dieter
On Sun, 20 Nov 2011 20:25:42 +0100 Dieter Plaetinck <dieter@plaetinck.be> wrote:
On Sun, 20 Nov 2011 19:22:15 +0000 Greg Sutcliffe <greg.sutcliffe@gmail.com> wrote:
On 20 November 2011 19:08, Dieter Plaetinck <dieter@plaetinck.be> wrote:
maybe there's a better way (like transmit something minimal, mount / over nfs or whatever), but i'm not familiar enough with archiso.
Indeed, I'm looking into gPXE to boot from an http-served iso. Hopefully that will scale better...
I don't know what you intend to achieve but you cannot do random seeks over http, so it will still download the entire iso file. Have a good look at archiso, maybe it has some optimizations for pxe.
Dieter
well, apparently you can: https://en.wikipedia.org/wiki/Byte_serving still, i wonder how you would actually go about it in practice. and what kind of latencies to expect. Dieter
On 20 November 2011 19:35, Dieter Plaetinck <dieter@plaetinck.be> wrote:
Greg Sutcliffe <greg.sutcliffe@gmail.com> wrote:
Indeed, I'm looking into gPXE to boot from an http-served iso. Hopefully that will scale better...
I don't know what you intend to achieve but you cannot do random seeks over http, so it will still download the entire iso file. Have a good look at archiso, maybe it has some optimizations for pxe.
Indeed, but tftp has limitations that http does not, and is (from what I've read) generally faster than tftp - so even though it downloads the entire file, it should be faster.
well, apparently you can: https://en.wikipedia.org/wiki/Byte_serving still, i wonder how you would actually go about it in practice. and what kind of latencies to expect.
Oh, that's interesting. Not what I was trying to achieve, but I might have a play once I've got something basic working. I'll definitely take a closer look at archiso once I've understood the basics. If a simple tftp- or http-served iso, plus aif script, works then I'll have a baseline to compare with.
There is also archiso-pxe something ... script in aur wich will set up pxe and uses nbd to mount the ISO over lan
On 20 November 2011 19:38, Jesse Jaara <jesse.jaara@gmail.com> wrote:
There is also archiso-pxe something ... script in aur wich will set up pxe and uses nbd to mount the ISO over lan
Yeah I saw that. Foreman can't manage nbd (yet), so it would be a manual process to get an Arch installation server set up using Foreman (which is my ultimate goal). Might look at adding nbd support to Foreman later, though :)
On Sun, 20 Nov 2011 21:38:25 +0200 Jesse Jaara <jesse.jaara@gmail.com> wrote:
There is also archiso-pxe something ... script in aur wich will set up pxe and uses nbd to mount the ISO over lan
Right, archiso-pxe-server, that's the thing Greg should be looking at. https://wiki.archlinux.org/index.php/Archiso_as_pxe_server It's written by Gerardo, who did also most or even all of the related work in archiso. it uses NBD (which is surprisingly simple to set up). I believe I once set this up and was very easy and worked nicely. (unless you already have a dnsmasq that should stay up, last time i checked this script invoked a new dnsmasq instance with some custom settings, which could give issues if you already use dnsmasq) Dieter
On 20 November 2011 19:46, Dieter Plaetinck <dieter@plaetinck.be> wrote:
On Sun, 20 Nov 2011 21:38:25 +0200 Jesse Jaara <jesse.jaara@gmail.com> wrote:
There is also archiso-pxe something ... script in aur wich will set up pxe and uses nbd to mount the ISO over lan
Right, archiso-pxe-server, that's the thing Greg should be looking at. https://wiki.archlinux.org/index.php/Archiso_as_pxe_server It's written by Gerardo, who did also most or even all of the related work in archiso. it uses NBD (which is surprisingly simple to set up). I believe I once set this up and was very easy and worked nicely. (unless you already have a dnsmasq that should stay up, last time i checked this script invoked a new dnsmasq instance with some custom settings, which could give issues if you already use dnsmasq)
Indeed, I already have dhcpd and bind9 running on the installation server, as custom pxe config files are written per mac address (one of the best features of pxelinux). I suppose the best way forward is to look at setting nbd - I agree it looks very easy. Looking at the linked page, the archiso dnsmasq config is not specifying anything special (just the location of the pxelinux.0 file) which is already in my dhcpd configuration, so I probably just need to copy over the pxelinux.cfg file and see what happens. Thanks again guys - much material for me to work on :)
On Sun, 20 Nov 2011 19:53:59 +0000 Greg Sutcliffe <greg.sutcliffe@gmail.com> wrote:
Indeed, I already have dhcpd and bind9 running on the installation server, as custom pxe config files are written per mac address (one of the best features of pxelinux).
are you sure that's a pxelinux feature? Dieter
On 20 November 2011 20:03, Dieter Plaetinck <dieter@plaetinck.be> wrote:
On Sun, 20 Nov 2011 19:53:59 +0000 Greg Sutcliffe <greg.sutcliffe@gmail.com> wrote:
Indeed, I already have dhcpd and bind9 running on the installation server, as custom pxe config files are written per mac address (one of the best features of pxelinux).
are you sure that's a pxelinux feature?
I'm pretty sure it's the file pxelinux.0 which instructs the client to attempt to download a file based on it's mac address, and failing that, files based on it's network address (in hex), and failing that, the file default.cfg. If you have a machine with MAC of aa:bb:cc:dd:ee:ff and you create a file $tftproot/pxelinux.cfg/01-aa-bb-cc-dd-ee-ff it will use that file in preference to default.cfg. If you don't have that file, you'll probably see something like this on the output of the client as it boots: pxelinux.cfg/01-aa-bb-cc-dd-ee-ff pxelinux.cfg/C0A800FE pxelinux.cfg/C0A800F pxelinux.cfg/C0A800 pxelinux.cfg/C0A80 pxelinux.cfg/C0A8 pxelinux.cfg/C0A pxelinux.cfg/C0 pxelinux.cfg/C pxelinux.cfg/default I'm fairly sure that's a pxelinux feature, but I could be wrong, and it could be supported by other protocols too.
On 20 November 2011 19:46, Dieter Plaetinck <dieter@plaetinck.be> wrote:> it uses NBD (which is surprisingly simple to set up). You were right, it was very simple to set up. I've got my Arch vm booted up now, and it booted very quickly indeed. I tried adding script='touch /tmp/foo' to the kernel parameters, but that didn't seem to work. Are you the right people to help me on using that parameter, or do I need to ask another mailing list?
On 20 November 2011 20:31, Greg Sutcliffe <greg.sutcliffe@gmail.com> wrote:
I tried adding script='touch /tmp/foo' to the kernel parameters, but that didn't seem to work. Are you the right people to help me on using that parameter, or do I need to ask another mailing list?
Never mind, I should grep before I open my mouth - I found it in /etc/rc.d/functions.d/automated_script - looks like a straightforward wget which is *exactly* what I wanted :)
participants (3)
-
Dieter Plaetinck
-
Greg Sutcliffe
-
Jesse Jaara