linuxtag 2014 - ipxe - the versatile network boot loader

12
www.immobilienscout24.de Berlin | 08.05.2014 | Schlomo Schapiro Systems Architect & Open Source Evangelist http://creativecommons.org/licenses/by-sa/4.0 iPXE The Versatile Network Boot Loader @schlomoschapiro [email protected]

Upload: schlomo-schapiro

Post on 08-May-2015

1.166 views

Category:

Technology


12 download

DESCRIPTION

Everybody with more than a few servers is using PXE boot to install the servers with an Operating System. In the Open Source world, there are currently 2 active PXE boot loaders: PXELINUX (from the SYSLINUX project) and iPXE. While PXELINUX is shipped (in an outdated version) with every Linux distro, iPXE is a hidden gem. It can do most of what PXELINUX does without needing extra add ons and some more: * boot from a web server via HTTP * boot from an iSCSI SAN * boot from a Fibre Channel SAN via FCoE * boot from an AoE SAN * boot from a wireless network * boot from a wide-area network * boot from an Infiniband network * control the boot process with a scripting language iPXE is free, open-source software licensed under the GNU GPL (with some portions under GPL-compatible licences), and is included in products from several network card manufacturers and OEMs. This talk gives an introduction to iPXE, the development model of the open source project and provides insights into the network boot automation at ImmobilienScout24. iPXE homepage: http://ipxe.org Talk Video: https://www.youtube.com/watch?v=RYbv8ZYAIl4

TRANSCRIPT

Page 1: LinuxTag 2014 - iPXE - The Versatile Network Boot Loader

www.immobilienscout24.de

Berlin | 08.05.2014 | Schlomo SchapiroSystems Architect & Open Source Evangelist

http://creativecommons.org/licenses/by-sa/4.0

iPXEThe Versatile Network Boot Loader

@[email protected]

Page 2: LinuxTag 2014 - iPXE - The Versatile Network Boot Loader

Preboot eXecution Environment

RPLEtherboot

gPXE

pxelinux

iPXENetBoot

RISCobbler

FAI KickstartAutoYAST

http://en.wikipedia.org/wiki/Preboot_Execution_Environmenthttp://networkboot.org/

Page 3: LinuxTag 2014 - iPXE - The Versatile Network Boot Loader

iPXE

◉ full PXE implementation◉ boot from a web server via HTTP◉ boot from network block devices

➨ iSCSI SAN➨ Fibre Channel SAN via FCoE➨ AoE SAN

◉ boot from VLAN, WLAN, WAN◉ boot from an Infiniband network◉ control the boot process with a scripting language◉ user interaction with prompts and menus◉ display images and splash screens◉ replaces NIC boot ROM or chainload via PXE boot

ipxe.org

Michael Brown github.com/mcb30

Page 4: LinuxTag 2014 - iPXE - The Versatile Network Boot Loader

Get or Build

◉ DEB: sudo apt-get install ipxe◉ RPM: Build it yourself

➨ git clone https://github.com/ImmobilienScout24/ipxe➨ cd ipxe/src➨ make srpm or make rpm

◉ Customizing➨ Uses C Header files➨ Add customization in config/local/*.h➨ Copy stuff from config/*.h➨ Example: config/local/console.h

#undef KEYBOARD_MAP#define KEYBOARD_MAP de

Page 5: LinuxTag 2014 - iPXE - The Versatile Network Boot Loader

Usage - Loading

◉ 3 Flavours:➨ UNDI: undionly.kpxe➨ All Drivers: ipxe.dsk, ipxe.iso, ipxe.usb, ipxe.lkrn, ipxe.pxe➨ Single Driver: XXXXXXXX.rom

◉ PXE chainloading➨ dhcpd.conf:

filename "undionly.kpxe";

➨ dnsmasq.conf:

dhcp-boot=undionly.kpxe

Page 6: LinuxTag 2014 - iPXE - The Versatile Network Boot Loader

Usage - Set Boot Action

◉ Provide Boot Source (dhcpd.conf), e.g. iSCSI LUN

option root-path "iscsi:iscsi.my.com::::iqn.1992-01.com.my.iscsi:target";

◉ Provide iPXE script (dhcpd.conf)

if exists user-class and option user-class = "iPXE" { filename "http://my.web.server/real_boot_script.php";} else { filename "undionly.kpxe";}

Page 7: LinuxTag 2014 - iPXE - The Versatile Network Boot Loader

Usage - Advanced

◉ NIC flashing➨ Replace PXE firmware on your NIC➨ http://ipxe.org/howto/romburning➨ Best with embedded boot script➨ Great for creating low-cost AoE / FCoE / iSCSI HBA :-)

◉ Show login mask◉ Menus◉ Server interaction & information gathering:

chain http://my.com/collect?u=${uuid}&m=${mac}&a=${asset}◉ Use your fantasy…

Page 8: LinuxTag 2014 - iPXE - The Versatile Network Boot Loader

Testing

◉ QEMU:qemu -bootp tftp://10.0.2.2//script.ipxe -tftp ~/tftp ipxe.usb

◉ VirtualBox:➨ Boot VM from ipxe.iso➨ Set TFTP filename to iPXE script:

VBoxManage modifyvm "ipxe test" --nattftpfile1 script.ipxe➨ Set TFTP Prefix to directory of iPXE script:

VBoxManage modifyvm "ipxe test" --nattftpprefix1 ~/tftp

◉ iPXE script: ~/tftp/script.ipxe

Page 9: LinuxTag 2014 - iPXE - The Versatile Network Boot Loader

Example: DHCP or Manual Configuration

#!ipxeprompt --key 0x02 --timeout 10000 Press Ctrl-B for iPXE command line... && shell ||dhcp && goto netboot ||ifcloseecho -n Choose net0 or net1 or ...: ${} && read nicset ${nic}/dns 8.8.8.8set ${nic}/netmask 255.255.255.0config ${nic}ifopen ${nic}goto netboot

:netbootchain http://my.com/boot/main.ipxe || echo Error in iPXE chaining, try again 1chain http://my.com/boot/main.ipxe || echo Error in iPXE chaining, giving up

Page 11: LinuxTag 2014 - iPXE - The Versatile Network Boot Loader

Development

◉ Upcoming Features:➨ UEFI support➨ UNDIONLY driver as fall-back solution➨ Automated Testing published on ipxe.org

◉ Paid Support & Development➨ Author in UK➨ Available for contract work on iPXE

◉ Development & Community➨ Mostly in C➨ IRC and Mailing List

Page 12: LinuxTag 2014 - iPXE - The Versatile Network Boot Loader

Q & A / See also

go.schapiro.org/slides

blog.schlomo.schapiro.org

yadt-project.org | visit us in hall 6, booth A07