Give Your PXE Wings! It’S Not Magic! How Booting Actually Works

Total Page:16

File Type:pdf, Size:1020Kb

Give Your PXE Wings! It’S Not Magic! How Booting Actually Works Give Your PXE Wings! It’s not magic! How booting actually works. Presentation for virtual SREcon 2020 By Rob Hirschfeld, RackN Rob Hirschfeld @zehicle Co-Founder of RackN We created Digital Rebar Bare Metal Provisioning ++ @L8istSh9y Podcast on PXE: http://bit.ly/pxewings In concept, O/SO/S Provisioning is Easy! We’re just installing an operating system on a server or switch! Why is that so hard?! ● Bootstrapping ● Firmware Limitations ● Variation ● Networking ● Security ● Performance Computer ● Post configuration In concept, Pre- & Provisioning is Easy! Post- Config We’re just installing an operating system on a server or switch! Why is that so hard?! ● Bootstrapping ● Firmware Limitations And that’s not even including: ● Variation ● Networking ● System Inventory ● Security ● System Validation ● Performance ● Hardware Configuration ● Post configuration ● Naming & Addressing ● Credentials Injection Exploring Provisioning Approaches Netboot (25 min) Image Deploy (10 min) Esoteric Flavors (5 min) ● PXE ● Packer ● kexec ● iPXE ● Write Boot Part ● Secure Boot ● ONIE ● Cloud Init ● BMC Boot ● Kickstart ● Preseed Exploring Provisioning Approaches Netboot (25 min) Image Deploy (10 min) Esoteric Flavors (5 min) ● PXE ● Packer ● kexec ● iPXE ● Write Boot Part ● Secure Boot ● ONIE ● Cloud Init ● BMC Boot ● Kickstart ● Preseed All roads lead to a kernel init process PXE PXE Let’s PXE! Bootstrapping is a multi-stage process Server DHCP Firmware PXE NextServer & Options TFTP Bootloader Stage 1 lpxelinux.0 Provisioning Service(s) HTTP(S) Bootloader Stage 2 ipxe.efi HTTP(S) O/S Kernel O/S ISO First: Get on the network Server DHCP Firmware PXE NextServer & Options Provisioning Service(s) Then: Download a Bootloader Server TFTP Bootloader Stage 1 lpxelinux.0 Provisioning Service(s) Then get a BETTER Bootloader Server Provisioning Service(s) HTTP(S) Bootloader Stage 2 ipxe.efi Finally load a “real” operating system Server Provisioning Service(s) HTTP(S) O/S Kernel O/S ISO Each stage is actually a NEW O/S Load Server DHCP Firmware DHCP PXE NextServer & Options TFTP Bootloader DHCP Stage 1 lpxelinux.0 Provisioning Service(s) HTTP(S) Bootloader Stage 2 ipxe.efi DHCP HTTP(S) DHCP O/S Kernel O/S ISO And modern servers can skip TFTP! So… technically, no longer PXE Server DHCP Firmware PXE NextServer & Options Provisioning Service(s) HTTP(S) Bootloader Stage 2 ipxe.efi HTTP(S) O/S Kernel O/S ISO Yay! We’re done, right? Provisioning is more than PXE Server iPXE O/S Kernel Bootloader O/S ISO Config Kickstart Templates Provisioning Service(s) Download Installation Packages Access & Post-Config Apps Hardware varies, so Install must be guided by templates Server O/S Kernel Config Kickstart Templates Provisioning Service(s) ISOs are minimal and stale So they must be updated Server O/S Kernel Kickstart Provisioning Service(s) Download Repo Installation Packages Mirrors And then you can actually connect to start configuring the system! Server O/S Kernel Kickstart Provisioning Service(s) Installation Access & Post-Config Apps Automating Provisioning means Connecting all these steps together Server iPXE O/S Kernel Bootloader O/S ISO Config Kickstart Templates Provisioning Service(s) Download Installation Packages Access & Post-Config Apps But wait…. There’s more to consider! Server iPXE Out of Band Management (BMC, IPMI, Redfish, etc) O/S Kernel Bootloader O/S ISO Infrastrastructure Config Kickstart as Code Templates Provisioning Service(s) Download Installation Packages Access & Post-Config Apps IaC? Show us some templates! Typical PXE Questions Why is this so fragile? What about PXE over Wifi? What about using a VLAN? Can I dockerize this? What about setting BIOS & RAID? How can I make this faster? How can we Server PXE/iPXE PXE simplify that?!! Small RAM only Footprint Provisioning O/S Inventory At RackN, we’ve been using an in Service(s) reboot memory operating system, “sledgehammer,” based on CentOS. Informed Guided Installation Installation It’s highly optimized to ● Run on nearly any hardware ● Load very quickly ● Collect deep inventory ● Have built-in tools for system tasks like hardware config Image Based Deployment (10x faster!) Server PXE/iPXE PXE RAM only Small O/S Footprint Provisioning Write O/S O/S Image Service(s) To Drive(s) as Archive reboot Informed Machine Installation Init Immutable Provisioning Server PXE PXE/iPXE Highly RAM only Minimal Available O/S Footprint Provisioning Service(s) Config & Machine Attach Disks Initialize Load Apps Container & Containers Registries And now… Advanced Provisioning! ESXi Provisioning Server iPXE O/S Kernel Bootloader O/S ISO Provisioning Config weasel Service(s) Templates restricted Access & CLI/python Apps Control via VMware ESXi VMw APIs Tooling ONIE: Open Network Install Environment Switch Current DHCP Firmware Provisioning Service(s) New HTTP(S) Firmware O/S Image Designed for Embedded Systems where we’re replacing the O/S as a complete image. Does have DHCP options for a startup script. kexec (kernel execute) Server Normal Running O/S Provision Download New Kernel New Kernel kexec Starts Provisioning Without New O/S Service(s) Rebooting kexec (kernel execute) Server Normal Running O/S Provision Download New Kernel New Kernel kexec Provisioning New O/S Service(s) Start kexec iPXE New Normal Installation Provision Without Rebooting Secure Boot Required SIGNED Bootloaders Server DHCP Secured Firmware NextServer & Options Enabled TPM HTTP(S) Trusted Provisioning Bootloader Signed ipxe.efi Service(s) Verified HTTP(S) Trusted O/S Kernel Signed O/S ISO Verified BMC Boot option 1 Server Install BMC Firmware Media Attached O/S Install Provisioning Service(s) Kickstart Download Installation Packages Post-Config Access & Apps BMC Boot option 2 Server Install BMC Firmware Media Bootloader DHCP Provisioning Config Service(s) Kickstart Templates Download Installation Packages Post-Config Access & Apps Thanks! Contact us: Rob Hirschfeld, RackN.com Digital Rebar Behind the Firewall, Self-Service Infrastructure as Code Self-Trials: rebar.digital .
Recommended publications
  • Bootstrapping Complexity
    BOOTSTRAPPING COMPLEXITY learning from self-organizing systems in nature and technology - a remix of Kevin Kellyʼs book “Out of Control” (1994) by Andreas Lloyd 2009 Distributed with permission under a Creative Commons license Introduction 3 Hive mind 6 Machines with an attitude 23 Assembling complexity 38 Co-evolution 47 The natural flux 63 The emergence of control 78 Closed systems 91 Artificial evolution 107 An open universe 128 The butterfly sleeps 142 Epilogue: Nine Laws of God 153 Text rights: Kevin Kelly: “Out of Control”, 1994, all rights reserved - used with kind permission. Full text available at http://www.kk.org/outofcontrol/ Wikipedia: “Cybernetics”, as of september 2009 - some rights reserved (BY-SA) Full text available at http://en.wikipedia.org/wiki/Cybernetics Photo rights: The Blue Marble, NASA Goddard Space Flight Center. Image by Reto Stöckli (land surface, shallow water, clouds). Enhancements by Robert Simmon (ocean color, compositing, 3D globes, animation). Data and technical support: MODIS Land Group; MODIS Science Data Support Team; MODIS Atmosphere Group; MODIS Ocean Group Additional data: USGS EROS Data Center (topography); USGS Terrestrial Remote Sensing Flagstaff Field Center (Antarctica); Defense Meteorological Satellite Program (city lights). http://visibleearth.nasa.gov/ Ecosphere, Statico - some rights reserved (BY-NC-SA). http://www.flickr.com/photos/ statico/143803777/ 2 Introduction “Good morning, self-organizing systems!” The cheerful speaker smiled with a polished ease and adjusted his tie. "I am indeed very happy to find the Office of Naval Research joining with the Armour Research Foundation in organizing this conference on what I personally consider an exceedingly important topic, and at such a well-chosen time." It was a spring day in early May, 1959.
    [Show full text]
  • Bootstrapping a Compiler for Fun and Profit
    Starting From Scratch Bootstrapping a Compiler for Fun and Profit Disclaimer: Profit not guaranteed Neither is fun. A background in compilers is neither assumed, implied, nor expected. Questions are welcome; and will be answered, possibly correctly. What’s a Compiler? A program that translates from one programming language into another programming language. To create a compiler, we need at least three things: A source language(e.g. C, Java, LLVM byte code) A target language (e.g. C, Java ByteCode, LLVM byte code, or the machine code for a specific CPU) to translate it to Rules to explain how to do the translation. How do we make a great compiler? There are two approaches to this problem. A) Write the perfect compiler on your very first try. (Good luck!) B) Start out with a not-so-great compiler. Use it to write a better one. Repeat. That’s great, but… What if I don’t have a not-so-great compiler to start out with? What if I don’t have a compiler at all? The Modern Answer: Just Google it. Someone will have written one for you by now. If they haven’t, you can start with an existing compiler for an existing source language (such as C), and change the target language that it generates. Starting from Scratch… What did we do before we had the Internet? What would we do if we didn’t have a compiler to start from? We’d make one! There are many possible ways to go about doing this. Here’s my approach… What are we trying to Do? We want to write a program that can translate from the language we HAVE to the language we WANT.
    [Show full text]
  • Trapper: an Operating System Bootstrapping Package for IBM PC Compatible Computer Systems
    Программные продукты и системы /Software&Systems 2 (33) 2020 Software &Systems Received 26.09.19 DOI: 10.15827/0236-235X.130.210-217 2020, vol. 33, no. 2, pp. 210–217 Trapper: an operating system bootstrapping package for IBM PC compatible computer systems Y.I. Klimiankou 1, Postgraduate Student, [email protected] 1 Belarusian State University of Informatics and Radioelectronics, Minsk, 220013, Belarus The paper presents an overview of the bootstrapping process on the IBM PC-compatible computer systems and proposes an architecture of the operating system bootstrapping package. The proposed package implements a framework for constructing boot images targeted at non-traditional operating systems like microkernel, an exokernel, unikernel, and multikernel. The bootstrapping package consists of three sets of independent boot modules and a Boot Image Builder application, which creates OS boot images. This application integrates and chains boot modules with one another to organize a complete bootloader chain. They are necessary to bring the operating system to a working state. The bootstrapping package architecture reflects the principal stages of the computer system boot process. Each set of boot modules is connected to the particular boot stage and forms a layer that is responsible for performing its own clearly defined set of functions and relies on clearly defined inter-layer interfaces to strictly isolate dependencies on the boot device, firmware and the specifics of the boot- loaded operating system. The paper presents the implementation of the described architecture for boot image generation designed and implemented for a research multikernel operating system and explains how it boots up. Additionally, the paper proposes the full separation idea of initialization code out of the operating system kernel and its movement into the independent OS loader module.
    [Show full text]
  • 3 Compiler Construction and Bootstrapping
    Compilers and Compiler Generators © P.D. Terry, 2000 3 COMPILER CONSTRUCTION AND BOOTSTRAPPING By now the reader may have realized that developing translators is a decidedly non-trivial exercise. If one is faced with the task of writing a full-blown translator for a fairly complex source language, or an emulator for a new virtual machine, or an interpreter for a low-level intermediate language, one would probably prefer not to implement it all in machine code. Fortunately one rarely has to contemplate such a radical step. Translator systems are now widely available and well understood. A fairly obvious strategy when a translator is required for an old language on a new machine, or a new language on an old machine (or even a new language on a new machine), is to make use of existing compilers on either machine, and to do the development in a high level language. This chapter provides a few examples that should make this clearer. 3.1 Using a high-level host language If, as is increasingly common, one’s dream machine M is supplied with the machine coded version of a compiler for a well-established language like C, then the production of a compiler for one’s dream language X is achievable by writing the new compiler, say XtoM, in C and compiling the source (XtoM.C) with the C compiler (CtoM.M) running directly on M (see Figure 3.1). This produces the object version (XtoM.M) which can then be executed on M. Even though development in C is much easier than development in machine code, the process is still complex.
    [Show full text]
  • A Minimalistic Verified Bootstrapped Compiler (Proof Pearl)
    A Minimalistic Verified Bootstrapped Compiler (Proof Pearl) Magnus O. Myreen Chalmers University of Technology Gothenburg, Sweden Abstract compiler on itself within the ITP (i.e. bootstrapping it), one This paper shows how a small verified bootstrapped compiler can arrive at an implementation of the compiler inside the can be developed inside an interactive theorem prover (ITP). ITP and get a proof about the correctness of each step [13]. Throughout, emphasis is put on clarity and minimalism. From there, one can export the low-level implementation of the compiler for use outside the ITP, without involving any CCS Concepts: • Theory of computation ! Program ver- complicated unverified code generation path. ification; Higher order logic; Automated reasoning. The concept of applying a compiler to itself inside an ITP Keywords: compiler verification, compiler bootstrapping, can be baffling at first, but don’t worry: the point of this paper interactive theorem proving is to clearly explain the ideas of compiler bootstrapping on a simple and minimalistic example. ACM Reference Format: To the best of our knowledge, compiler bootstrapping Magnus O. Myreen. 2021. A Minimalistic Verified Bootstrapped inside an ITP has previously only been done as part of the Proceedings of the 10th ACM SIGPLAN Compiler (Proof Pearl). In CakeML project [29]. The CakeML project has as one of International Conference on Certified Programs and Proofs (CPP ’21), its aims to produce a realistic verified ML compiler and, January 18–19, 2021, Virtual, Denmark. ACM, New York, NY, USA, 14 pages. https://doi.org/10.1145/3437992.3439915 as a result, some of its contributions, including compiler bootstrapping, are not as clearly explained as they ought to 1 Introduction be: important theorems are cluttered with real-world details that obscure some key ideas.
    [Show full text]
  • A Brief History of Unix
    A Brief History of Unix Tom Ryder [email protected] https://sanctum.geek.nz/ I Love Unix ∴ I Love Linux ● When I started using Linux, I was impressed because of the ethics behind it. ● I loved the idea that an operating system could be both free to customise, and free of charge. – Being a cash-strapped student helped a lot, too. ● As my experience grew, I came to appreciate the design behind it. ● And the design is UNIX. ● Linux isn’t a perfect Unix, but it has all the really important bits. What do we actually mean? ● We’re referring to the Unix family of operating systems. – Unix from Bell Labs (Research Unix) – GNU/Linux – Berkeley Software Distribution (BSD) Unix – Mac OS X – Minix (Intel loves it) – ...and many more Warning signs: 1/2 If your operating system shows many of the following symptoms, it may be a Unix: – Multi-user, multi-tasking – Hierarchical filesystem, with a single root – Devices represented as files – Streams of text everywhere as a user interface – “Formatless” files ● Data is just data: streams of bytes saved in sequence ● There isn’t a “text file” attribute, for example Warning signs: 2/2 – Bourne-style shell with a “pipe”: ● $ program1 | program2 – “Shebangs” specifying file interpreters: ● #!/bin/sh – C programming language baked in everywhere – Classic programs: sh(1), awk(1), grep(1), sed(1) – Users with beards, long hair, glasses, and very strong opinions... Nobody saw it coming! “The number of Unix installations has grown to 10, with more expected.” — Ken Thompson and Dennis Ritchie (1972) ● Unix in some flavour is in servers, desktops, embedded software (including Intel’s management engine), mobile phones, network equipment, single-board computers..
    [Show full text]
  • The UNIX Time- Sharing System
    1. Introduction There have been three versions of UNIX. The earliest version (circa 1969–70) ran on the Digital Equipment Cor- poration PDP-7 and -9 computers. The second version ran on the unprotected PDP-11/20 computer. This paper describes only the PDP-11/40 and /45 [l] system since it is The UNIX Time- more modern and many of the differences between it and older UNIX systems result from redesign of features found Sharing System to be deficient or lacking. Since PDP-11 UNIX became operational in February Dennis M. Ritchie and Ken Thompson 1971, about 40 installations have been put into service; they Bell Laboratories are generally smaller than the system described here. Most of them are engaged in applications such as the preparation and formatting of patent applications and other textual material, the collection and processing of trouble data from various switching machines within the Bell System, and recording and checking telephone service orders. Our own installation is used mainly for research in operating sys- tems, languages, computer networks, and other topics in computer science, and also for document preparation. UNIX is a general-purpose, multi-user, interactive Perhaps the most important achievement of UNIX is to operating system for the Digital Equipment Corpora- demonstrate that a powerful operating system for interac- tion PDP-11/40 and 11/45 computers. It offers a number tive use need not be expensive either in equipment or in of features seldom found even in larger operating sys- human effort: UNIX can run on hardware costing as little as tems, including: (1) a hierarchical file system incorpo- $40,000, and less than two man years were spent on the rating demountable volumes; (2) compatible file, device, main system software.
    [Show full text]
  • Bootstrap Program
    BOOTSTRAP PROGRAM A bootstrap program is the first code that is executed when the computer system is started. The entire operating system depends on the bootstrap program to work correctly as it loads the operating system. A figure that demonstrates the use of the bootstrap program is as follows: In the above image, the bootstrap program is a part of ROM which is the non-volatile memory. The operating system is loaded into the RAM by the bootstrap program after the start of the computer system. Then the operating system starts the device drivers. Bootstrapping Process The bootstrapping process does not require any outside input to start. Any software can be loaded as required by the operating system rather than loading all the software automatically. The bootstrapping process is performed as a chain i.e. at each stage, it is the responsibility of the simpler and smaller program to load and execute the much more complicated and larger program. This means that the computer system improves in increments by itself. The booting procedure starts with the hardware procedures and then continues onto the software procedures that are stored in the main memory. The bootstrapping process involves self-tests, loading BIOS, configuration settings, hypervisor, operating system etc. Benefits of Bootstrapping Without bootstrapping, the computer user would have to download all the software components, including the ones not frequently required. With bootstrapping, only those software components need to be downloaded that are legitimately required and all extraneous components are not required. This process frees up a lot of space in the memory and consequently saves a lot of time.
    [Show full text]
  • System Boot and Startup Bootstrapping
    System Boot and Startup Bootstrapping The first step in starting the operating system is that the • When a PC computer is powered up control is kernel is loaded into memory by a boot loader. transferred to a startup routine in the BIOS (Basic When the FreeBSD kernel is loaded into memory, the Input/Output System), stored in nonvolatile storage. kernel goes through several stages of hardware and → The BIOS runs some hardware diagnostics. software initialization. → A short boot program is loaded from the boot sector • Initialize CPU state including run-time stack and (sector 0) of the boot disk. → virtual-memory mapping. Which disk to use as boot disk is selectable in the BIOS setup menu. • Machine-dependent initializations. • If the standard PC boot loader is used, it will load → Setting up mutexes and page tables. another boot loader from the boot block in the partition → Configuring I/O devices. marked as boot partition in the MBR (Master Boot • Machine-independent initializations. Record). → Mounting root filesystem. • This second level boot loader may be the FreeBSD boot → Initializing system data structures. loader or a general purpose boot loader such as GRUB. • Create the first user-mode process. • The FreeBSD boot loader loads the kernel into memory • Start user-mode system processes from a standard location in the root file system (or it can be given commands to load from a nonstandard location). 1 2 Boot Programs Kernel Initialization • A boot program is a standalone program that operates • Ultimately the FreeBSD kernel is loaded into memory by without assistance of an operating system.
    [Show full text]
  • Predicting Academic Performance: a Bootstrapping Approach for Learning Dynamic Bayesian Networks
    Predicting Academic Performance: A Bootstrapping Approach for Learning Dynamic Bayesian Networks B Mashael Al-Luhaybi( ), Leila Yousefi, Stephen Swift, Steve Counsell, and Allan Tucker Intelligent Data Analysis Laboratory, Brunel University London, London, UK {Mashael.Al-luhaybi,Leila.yousefi,stephen.swift,steve.counsell, Allan.Tucker}@brunel.ac.uk Abstract. Predicting academic performance requires utilization of stu- dent related data and the accurate identification of the key issues regard- ing such data can enhance the prediction process. In this paper, we pro- posed a bootstrapped resampling approach for predicting the academic performance of university students using probabilistic modeling taking into consideration the bias issue of educational datasets. We include in this investigation students’ data at admission level, Year 1 and Year 2, respectively. For the purpose of modeling academic performance, we first address the imbalanced time series of educational datasets with a resampling method using bootstrap aggregating (bagging). We then ascertain the Bayesian network structure from the resampled dataset to compare the efficiency of our proposed approach with the original data approach. Hence, one interesting outcome was that of learning and testing the Bayesian model from the bootstrapped time series data. The prediction results were improved dramatically, especially for the minority class, which was for identifying the high risk of failing students. Keywords: Performance prediction · Bayesian networks · Resampling · Bootstrapping · EDM 1 Introduction According to the Higher Education Statistics Agency (HESA) in the UK [1], the drop-out rate among undergraduate students has increased in the last three years. The statistics published by the HESA reveal that a total of 26,000 stu- dents in England in 2015 dropped out from their enrolled academic programmes after their first year.
    [Show full text]
  • Bootstrapping Trust in Commodity Computers
    Bootstrapping Trust in Commodity Computers Bryan Parno Jonathan M. McCune Adrian Perrig CyLab, Carnegie Mellon University Abstract ultimately involves human users, which creates a host of ad- Trusting a computer for a security-sensitive task (such as checking ditional challenges (§9). Finally, all of the work we survey email or banking online) requires the user to know something about has certain fundamental limitations (§10), which leaves many the computer’s state. We examine research on securely capturing a interesting questions open for future work in this area (§11). computer’s state, and consider the utility of this information both for Much of this research falls under the heading of “Trusted improving security on the local computer (e.g., to convince the user Computing”, the most visible aspect of which is the Trusted that her computer is not infected with malware) and for communi- cating a remote computer’s state (e.g., to enable the user to check Platform Module (TPM), which has already been deployed that a web server will adequately protect her data). Although the on over 200 million computers [45]. In many ways, this is recent “Trusted Computing” initiative has drawn both positive and one of the most significant changes in hardware-supported negative attention to this area, we consider the older and broader security in commodity systems since the development of seg- topic of bootstrapping trust in a computer. We cover issues rang- mentation and process rings in the 1960s, and yet it has been ing from the wide collection of secure hardware that can serve as a met with muted interest in the security research community, foundation for trust, to the usability issues that arise when trying to perhaps due to its perceived association with Digital Rights convey computer state information to humans.
    [Show full text]
  • Redfish Host Interface Specification
    Document Identifier: DSP0270 Date: 2020-08-04 Version: 1.3.0 Redfish Host Interface Specification Supersedes: 1.2.0 Document Class: Normative Document Status: Published Document Language: en-US Redfish Host Interface Specification DSP0270 Copyright Notice Copyright © 2014-2020 DMTF. All rights reserved. DMTF is a not-for-profit association of industry members dedicated to promoting enterprise and systems management and interoperability. Members and non-members may reproduce DMTF specifications and documents, provided that correct attribution is given. As DMTF specifications may be revised from time to time, the particular version and release date should always be noted. Implementation of certain elements of this standard or proposed standard may be subject to third party patent rights, including provisional patent rights (herein "patent rights"). DMTF makes no representations to users of the standard as to the existence of such rights, and is not responsible to recognize, disclose, or identify any or all such third party patent right, owners or claimants, nor for any incomplete or inaccurate identification or disclosure of such rights, owners or claimants. DMTF shall have no liability to any party, in any manner or circumstance, under any legal theory whatsoever, for failure to recognize, disclose, or identify any such third party patent rights, or for such party's reliance on the standard or incorporation thereof in its product, protocols or testing procedures. DMTF shall have no liability to any party implementing such standard, whether such implementation is foreseeable or not, nor to any patent owner or claimant, and shall have no liability or responsibility for costs or losses incurred if a standard is withdrawn or modified after publication, and shall be indemnified and held harmless by any party implementing the standard from any and all claims of infringement by a patent owner for such implementations.
    [Show full text]