Discussion:
[Ltsp-discuss] LTSP, NBD, and iPXE
Short, Kermit
2015-03-10 22:04:08 UTC
Permalink
Greetings!
I am unable to utilize the typical tftp/pxe boot systems due to various organization mandated policies. To get around this, I'm using ipxe. This works great to boot to an NFS file system (kernel parameters point to the NFS server and path). I'd like to play around with NBD, though, and I was wondering if anyone knew how to tell the kernel about the NBD server, port, and path to the image using kernel parameters, rather than the traditional DHCP option of 'root-path'.

As mentioned, I cannot utilize PXE/DHCP options. I have to be able to do all of this via kernel parameters, similar to the following NFS related kernel parameters to implement the NFS file system:
root=/dev/nfs nfsroot=nfs.file.host:/opt/ltsp/i386 boot=nfs

Thanks in advance for your time and assistance!
--
Kermit Short
Los Alamos National Laboratory
Graham Innes
2015-03-10 23:41:37 UTC
Permalink
> On Wednesday, 11 March, 2015 06:04 AM, Short, Kermit wrote:
> I am unable to utilize the typical tftp/pxe boot systems due to
various organization mandated policies. To get around this, I'm using ipxe.

We use ipxe from a server, but using it from a local USB flash drive
would work the same way. With NBD:

:server1tftp
imgfree
echo Booting from LTSP 1 (TFTP)
kernel tftp://192.168.1.12/ltsp/amd64/vmlinuz root=/dev/nbd0
init=/sbin/init-ltsp vt.handoff=7 nbdroot=192.168.1.12:/opt/ltsp/amd64
|| goto server2
initrd tftp://192.168.1.12/ltsp/amd64/initrd.img || goto server2
boot || goto server2

(in this case, if it fails along the way, it tries from server2... ||
goto server2 )

If you want to speed up image loading, you can also use HTTP to load the
image with ipxe (this helped us enormously when booting clients
connected to the main network via a wireless bridge; for reasons beyond
me TFTP was impossibly slow, HTTP works as fast as the bridge):

:server1
imgfree
echo Booting from LTSP 1 (HTTP)
kernel http://192.168.1.12/vmlinuz root=/dev/nbd0 init=/sbin/init-ltsp
vt.handoff=7 nbdroot=192.168.1.12:/opt/ltsp/amd64 || goto server1tftp
initrd http://192.168.1.12/initrd.img || goto server1atftp
boot || goto server1tftp

Obviously this requires setting up a simple webserver to host the
images. We use lighttpd.

We also like to have some clients boot from one server, and some from
another server, based on MAC address. This is also possible with ipxe:

iseq ${netX/mac} ac:22:0b:c5:9f:b5 && goto server1 || #PC01



Graham

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_____________________________________________________________________
Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto:
https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help, try #ltsp channel on irc.freenode.net
Short, Kermit
2015-03-11 01:41:12 UTC
Permalink
This is fantastic information! Thank you, Graham! We currently send kernels and initrd images from a web server... I.E. Replace your tftpd with http in your kernel lines. Were these the images you refer to, or are you talking about the actual nbd images? I thought those had to come from an nbd daemon?

Thank you for the help!

-Kermit



--
Kermit Short
DCS-ISS

________________________________
From: Graham Innes
Sent: Tuesday, March 10, 2015 5:41:37 PM
To: ltsp-***@lists.sourceforge.net
Subject: Re: [Ltsp-discuss] LTSP, NBD, and iPXE

> On Wednesday, 11 March, 2015 06:04 AM, Short, Kermit wrote:
> I am unable to utilize the typical tftp/pxe boot systems due to
various organization mandated policies. To get around this, I'm using ipxe.

We use ipxe from a server, but using it from a local USB flash drive
would work the same way. With NBD:

:server1tftp
imgfree
echo Booting from LTSP 1 (TFTP)
kernel tftp://192.168.1.12/ltsp/amd64/vmlinuz root=/dev/nbd0
init=/sbin/init-ltsp vt.handoff=7 nbdroot=192.168.1.12:/opt/ltsp/amd64
|| goto server2
initrd tftp://192.168.1.12/ltsp/amd64/initrd.img || goto server2
boot || goto server2

(in this case, if it fails along the way, it tries from server2... ||
goto server2 )

If you want to speed up image loading, you can also use HTTP to load the
image with ipxe (this helped us enormously when booting clients
connected to the main network via a wireless bridge; for reasons beyond
me TFTP was impossibly slow, HTTP works as fast as the bridge):

:server1
imgfree
echo Booting from LTSP 1 (HTTP)
kernel http://192.168.1.12/vmlinuz root=/dev/nbd0 init=/sbin/init-ltsp
vt.handoff=7 nbdroot=192.168.1.12:/opt/ltsp/amd64 || goto server1tftp
initrd http://192.168.1.12/initrd.img || goto server1atftp
boot || goto server1tftp

Obviously this requires setting up a simple webserver to host the
images. We use lighttpd.

We also like to have some clients boot from one server, and some from
another server, based on MAC address. This is also possible with ipxe:

iseq ${netX/mac} ac:22:0b:c5:9f:b5 && goto server1 || #PC01



Graham

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_____________________________________________________________________
Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto:
https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help, try #ltsp channel on irc.freenode.net
Graham Innes
2015-03-11 07:43:03 UTC
Permalink
Kermit,

NBD has its own protocol, so there's nothing to be gained there. But
ipxe gives us the option to fetch the vmlinuz image via HTTP rather than
TFTP. In normal situations this won't make any difference, but in our
network (with a wireless bridge between two buildings) TFTP took 7 mins
to download that 5.6M image, resulting in super slow booting clients.
Using HTTP resolved this.

In ipxe it looks like this:
kernel tftp://192.168.1.12/ltsp/amd64/vmlinuz ##TFTP
kernel http://192.168.1.12/vmlinuz ##HTTTP

But yes you're right, not the NBD images - they are just accessed as
needed via the NBD daemon, never downloaded fully.


On Wednesday, 11 March, 2015 09:41 AM, Short, Kermit wrote:
> This is fantastic information! Thank you, Graham! We currently send
> kernels and initrd images from a web server... I.E. Replace your tftpd
> with http in your kernel lines. Were these the images you refer to,
> or are you talking about the actual nbd images? I thought those had
> to come from an nbd daemon?
>
> Thank you for the help!
>
> -Kermit
>
>
>
> --
> Kermit Short
> DCS-ISS
> *
> *
> ------------------------------------------------------------------------
> *From:* Graham Innes
> *Sent:* Tuesday, March 10, 2015 5:41:37 PM
> *To:* ltsp-***@lists.sourceforge.net
> *Subject:* Re: [Ltsp-discuss] LTSP, NBD, and iPXE
>
> > On Wednesday, 11 March, 2015 06:04 AM, Short, Kermit wrote:
> > I am unable to utilize the typical tftp/pxe boot systems due to
> various organization mandated policies. To get around this, I'm using
> ipxe.
>
> We use ipxe from a server, but using it from a local USB flash drive
> would work the same way. With NBD:
>
> :server1tftp
> imgfree
> echo Booting from LTSP 1 (TFTP)
> kernel tftp://192.168.1.12/ltsp/amd64/vmlinuz root=/dev/nbd0
> init=/sbin/init-ltsp vt.handoff=7 nbdroot=192.168.1.12:/opt/ltsp/amd64
> || goto server2
> initrd tftp://192.168.1.12/ltsp/amd64/initrd.img || goto server2
> boot || goto server2
>
> (in this case, if it fails along the way, it tries from server2... ||
> goto server2 )
>
> If you want to speed up image loading, you can also use HTTP to load the
> image with ipxe (this helped us enormously when booting clients
> connected to the main network via a wireless bridge; for reasons beyond
> me TFTP was impossibly slow, HTTP works as fast as the bridge):
>
> :server1
> imgfree
> echo Booting from LTSP 1 (HTTP)
> kernel http://192.168.1.12/vmlinuz root=/dev/nbd0 init=/sbin/init-ltsp
> vt.handoff=7 nbdroot=192.168.1.12:/opt/ltsp/amd64 || goto server1tftp
> initrd http://192.168.1.12/initrd.img || goto server1atftp
> boot || goto server1tftp
>
> Obviously this requires setting up a simple webserver to host the
> images. We use lighttpd.
>
> We also like to have some clients boot from one server, and some from
> another server, based on MAC address. This is also possible with ipxe:
>
> iseq ${netX/mac} ac:22:0b:c5:9f:b5 && goto server1 || #PC01
>
>
>
> Graham
Loading...