Bhyvecon Tokyo 2014

Total Page:16

File Type:pdf, Size:1020Kb

Bhyvecon Tokyo 2014 Introduction to bhyve Takuya ASADA / @syuu1228 What is bhyve? What is bhyve? • bhyve is a hypervisor introduced in FreeBSD • Similar to Linux KVM, runs on host OS • BSD License • Developed by Peter Grehan and Neel Natu bhyve features • Required Intel VT-x and EPT (Nehalem or later) AMD support in progress • Does not support BIOS/UEFI for now UEFI support in progress • Minimal device emulation support: virtio-blk, virtio-net, COM port + α • Supported guest OS: FreeBSD/amd64, i386, Linux/x86_64, OpenBSD/amd64 How to use it? kldload vmm.ko /usr/sbin/bhyveload -m ${mem} -d ${disk} ${name} /usr/sbin/bhyve -c ${cpus} -m ${mem} \ -s 0,hostbridge -s 2,virtio-blk,${disk} \ -s 3,virtio-net,${tap} -s 31,lpc -l com1,stdio vm0 How to run Linux? • bhyve OS Loader(/usr/sbin/bhyveload) only supports FreeBSD You need another OS Loader to support other OSs • grub2-bhyve is the solution • It’s modified version grub2, runs on host OS (FreeBSD) • Can load Linux and OpenBSD • Available in ports & pkg! Virtualization in general Difference between container and hypervisor • Jail is container • It’s virtualize OS environment on kernel level • bhyve is hypervisor • It virtualizes whole machine • Totally different approach Container • Process in jail is just a normal jail1 jail2 process for the kernel • The kernel do some tricks to proc proc proc ess ess isolate environments between jails ess • Lightweight, less-overhead Kernel • Share one kernel with all jails NIC → If the kernel panics, all jails Disk will die • You cannot install another OS (No Windows, No Linux!) Hypervisor • Hypervisor virtualizes a machine vm1 vm2 proc proc • From guest OS, it looks like real ess ess hardware Kernel Kernel • Virtual machine is a normal NI NI Disk Disk process for host OS proc C C ess Hypervisor • Does not share kernel, it is Kernel completely isolated NIC • You can run Full OS inside of Disk the VM → Windows! Linux! How hypervisor virtualize machine? • To make complete virtual machine, you need to virtualize following things: • CPU • Memory (Address Space) • I/O CPU Virtualization: Emulate entire CPU? QEMU run CPU mov dx,3FBh mov al,128 virtual emula out dx,al device IO tor OS physica physic l device al CPU • Like QEMU • You can emulate the entire CPU operation on a normal process • Very slow, not a really useful choice for virtualization CPU Virtualization: Direct execution? • You want run guest instructions directly on a real CPU since you are virtualizing x86 on x86 • You need to avoid executing some instructions which modify system global state, or perform I/O (called sensitive instructions) • If you execute these instructions on a real CPU, it may break host OS state such as directly accessing a HW device Perform I/O on VM GuestOS Real Display Virtual CPU outb • You need to avoid access to real HW from VM • Need to prevent execution of the instruction Perform IO on VM Virtual Display GuestOS trap! Virtual CPU outb • You can trap them by executing in lower privileged mode • However, on x86, there are some instructions which are impossible to trap because these are nonprivileged instructions Software techniques to virtualize x86 • Binary translation (old VMware): interpret & modify guest OS’s instructions on-the-fly → Runs fast, but implementation is very complex • Paravirtualization (old Xen): Modify guest OS for the hypervisor → Runs fast, but is impossible to run unmodified OS’s • We want an easier & better solution → HW assisted virtualization! Hardware assisted virtualization(Intel VT-x) VMX VMX root mode non-root mode User User (Ring 3) VMEntry (Ring 3) Kernel VMExit Kernel (Ring 0) (Ring 0) • New CPU mode: VMX root mode (hypervisor) / VMX non-root mode (guest) • If some event needs to emulate in the hypervisor, CPU stops guest, exit to hypervisor → VMExit • You don’t need complex software techniques You don’t have to modify the guest OS Memory Virtualization Guest A Process A Guest physical memory Page table A 1 1 1 1 2 2 Host physical memory Process B Page table B 3 1 1 3 4 1 2 2 4 2 3 4 Guest B 5 Process A Guest physical memory 6 Page table A 7 1 1 1 1 8 2 2 Process B Page table B 3 4 1 1 3 2 2 4 • If you run guest OS natively, memory address translation become problematic • If GuestB loads Page table A, virtual page 1 translate to Host physical page 1 but you meant Host physical page 5 Shadow Paging Page table A' 1 5 Host physical memory 2 Page table B' 1 1 7 2 2 8 3 4 Guest A 5 Process A 6 Page table A 7 1 1 2 1 8 2 2 Process B Page table B 3 4 1 1 3 2 2 4 Guest physical memory • Trap page table loading/modifying, create “Shadow Page Table”, tell physical page number to the MMU • A software trick that works well, but is slow Nested Paging (Intel EPT) Host physical memory Guest A Process A 1 Page table A EPT A 2 1 1 2 1 1 5 3 2 2 2 6 4 Process B Page table B 3 3 7 5 4 4 8 6 1 1 3 7 2 2 4 Guest physical memory 8 • HW assisted memory virtualization! • You will have Guest physical : Host physical translation table • MMU translates address by two step (Nested) I/O Virtualization • To run unmodified OSs, you’ll need to emulate all devices what you have on the real hardware • SATA, NIC(e1000), USB(ehci), VGA(Cirrus), Interrupt controller(LAPIC, IO-APIC), Clock(HPET), COM port… • Emulating real devices is not very fast because it causes lot of VMExits, not ideal for for virtualization Paravirtual I/O • Virtual I/O device is designed for VM use • Much faster than emulating real devices • Required device driver on guest OS • De-facto standard: virtio-blk, virtio-net PCI Device passthrough Physical memory Guest A Process A 1 IOMMU Pagetable A EPT A 2 translation table 1 1 2 1 1 5 3 5 1 2 2 2 6 4 6 2 DMA! 7 3 Process B Pagetable B 3 3 7 5 PCI 4 4 8 6 8 4 Devices 1 1 3 7 2 2 4 Guest physical memory 8 • If you attach a real HW device on a VM, you will have a problem with DMA • Because the device requires physical address for DMA but the guest OS doesn’t know the Host physical address • Address translator for the devices: IOMMU(Intel VT-d) • Translates guest physical to host physical using a translation table bhyve internals How bhyve virtualize machine? • CPU: HW-assisted virtualization (Intel VT-x) • Memory: HW-assisted memory virtualization (Intel EPT) • IO: virtio, PCI passthrough, +α • Uses HW assisted features bhyve overview 2. Run VM instace • bhyveload: loads Disk image guest OS 1. Create VM instance, tap device load guest kernel stdin/stdout Guest Console bhyve: userland part of kernel N 3. Destroy VM • H I D instance Hypervisor, emulates C bhyveload bhyvectl bhyve devices libvmmapi bhyvectl: a management mmap/ioctl • tool /dev/vmm/${vm_name} (vmm.ko) FreeBSD kernel • libvmmapi: userland API • vmm.ko: kernel part of Hypervisor vmm.ko • All VT-x features only accessible in kernel mode, vmm.ko handles it • Most important work of vmm.ko is CPU mode switching between hypervisor/guest • Provides interface for userland via /dev/ vmm/${vmname} • Each vmm device file contains each VM instance state /dev/vmm/${vmname} interfaces • create/destroy Can create/destroy device file via sysctl hw.vmm.create, hw.vmm.destroy • read/write/mmap Can access guest memory area by standard syscall (Which means you even can dump guest memory by dd command) • ioctl Provides various operations to VM /dev/vmm/${vmname} ioctls • VM_MAP_MEMORY: Maps guest memory area at requested size • VM_SET/GET_REGISTER: Access registers • VM_RUN: Run guest machine, until virtual devices accessed (or some other trap happened) libvmmapi • wrapper library of /dev/vmm operations • vm_create(name)→ sysctl(“hw.vmm.create”, name) • vm_set_register(reg, val) → ioctl(VM_SET_REGISTER, reg, val) bhyveload • bhyve uses OS loader instead of BIOS/UEFI, to load guest OS • FreeBSD bootloader ported to userland: userboot • bhyveload runs host OS, to initialize guest OS • Once it called, it does following things: • Parse UFS on diskimage, find kernel • Load kernel to guest memory area • Initialize Page Table • Create GDT, IDT, LDT • Initialize special registers to get ready for 64bit mode • Guest machine can starts from kernel entry point, with 64bit mode bhyve • bhyve command is the userland part of the hypervisor • It invokes ioctl(VM_RUN) to run GuestOS • Emulates virtual devices • Provides user interface(no GUI for now) main loop in bhyve while (1) { ioctl(VM_RUN, &vmexit); switch (vmexit.exit_code) { case IOPORT_ACCESS: emulate_device(vmexit.ioport); … } } Q&A?.
Recommended publications
  • Institutionalizing Freebsd Isolated and Virtualized Hosts Using Bsdinstall(8), Zfs(8) and Nfsd(8)
    Institutionalizing FreeBSD Isolated and Virtualized Hosts Using bsdinstall(8), zfs(8) and nfsd(8) [email protected] @MichaelDexter BSDCan 2018 Jails and bhyve… FreeBSD’s had Isolation since 2000 and Virtualization since 2014 Why are they still strangers? Institutionalizing FreeBSD Isolated and Virtualized Hosts Using bsdinstall(8), zfs(8) and nfsd(8) Integrating as first-class features Institutionalizing FreeBSD Isolated and Virtualized Hosts Using bsdinstall(8), zfs(8) and nfsd(8) This example but this is not FreeBSD-exclusive Institutionalizing FreeBSD Isolated and Virtualized Hosts Using bsdinstall(8), zfs(8) and nfsd(8) jail(8) and bhyve(8) “guests” Application Binary Interface vs. Instructions Set Architecture Institutionalizing FreeBSD Isolated and Virtualized Hosts Using bsdinstall(8), zfs(8) and nfsd(8) The FreeBSD installer The best file system/volume manager available The Network File System Broad Motivations Virtualization! Containers! Docker! Zones! Droplets! More more more! My Motivations 2003: Jails to mitigate “RPM Hell” 2011: “bhyve sounds interesting...” 2017: Mitigating Regression Hell 2018: OpenZFS EVERYWHERE A Tale of Two Regressions Listen up. Regression One FreeBSD Commit r324161 “MFV r323796: fix memory leak in [ZFS] g_bio zone introduced in r320452” Bug: r320452: June 28th, 2017 Fix: r324162: October 1st, 2017 3,710 Commits and 3 Months Later June 28th through October 1st BUT July 27th, FreeNAS MFC Slips into FreeNAS 11.1 Released December 13th Fixed in FreeNAS January 18th 3 Months in FreeBSD HEAD 36 Days
    [Show full text]
  • Thread Scheduling in Multi-Core Operating Systems Redha Gouicem
    Thread Scheduling in Multi-core Operating Systems Redha Gouicem To cite this version: Redha Gouicem. Thread Scheduling in Multi-core Operating Systems. Computer Science [cs]. Sor- bonne Université, 2020. English. tel-02977242 HAL Id: tel-02977242 https://hal.archives-ouvertes.fr/tel-02977242 Submitted on 24 Oct 2020 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Ph.D thesis in Computer Science Thread Scheduling in Multi-core Operating Systems How to Understand, Improve and Fix your Scheduler Redha GOUICEM Sorbonne Université Laboratoire d’Informatique de Paris 6 Inria Whisper Team PH.D.DEFENSE: 23 October 2020, Paris, France JURYMEMBERS: Mr. Pascal Felber, Full Professor, Université de Neuchâtel Reviewer Mr. Vivien Quéma, Full Professor, Grenoble INP (ENSIMAG) Reviewer Mr. Rachid Guerraoui, Full Professor, École Polytechnique Fédérale de Lausanne Examiner Ms. Karine Heydemann, Associate Professor, Sorbonne Université Examiner Mr. Etienne Rivière, Full Professor, University of Louvain Examiner Mr. Gilles Muller, Senior Research Scientist, Inria Advisor Mr. Julien Sopena, Associate Professor, Sorbonne Université Advisor ABSTRACT In this thesis, we address the problem of schedulers for multi-core architectures from several perspectives: design (simplicity and correct- ness), performance improvement and the development of application- specific schedulers.
    [Show full text]
  • Building a Virtualisation Appliance with Freebsd/Bhyve/Openzfs Jason Tubnor ICT Senior Security Lead Introduction
    Building a virtualisation appliance with FreeBSD/bhyve/OpenZFS Jason Tubnor ICT Senior Security Lead Introduction Building an virtualisation appliance for use within a NGO/NFP Australian Health Sector About Me Latrobe Community Health Service (LCHS) Background Problem Concept Production Reiteration About Me 26 years of IT experience Introduced to Open Source in the mid 90’s Discovered OpenBSD in 2000 A user and advocate of OpenBSD and FreeBSD Life outside of computers: Ultra endurance gravel cycling Latrobe Community Health Service (LCHS) Originally a Gippsland based NFP/NGO health service ICT manages 900+ users Servicing 51 sites across Victoria, Australia Covering ~230,000km2 Roughly the size of Laos in Aisa or Minnesota in USA “Better health, Better lifestyles, Stronger communities” Background First half of 2016 awarded contract to provide NDIS services Mid 2016 – deployment of initial infrastructure MPLS connection L3 switch gear ESXi host running a Windows Server 2016 for printing services Background – cont. Staff number grew We hit capacity constraints on the managed MPLS network An offloading guest was added to the ESXi host VPN traffic could be offloaded from the main network Using cheaply available ISP internet connection Problem Taking stock of the lessons learned in the first phase We needed to come up with a reproducible device Device required to be durable in harsh conditions Budget constraints/cost savings Licensing model Phase 2 was already being negotiated so a solution was required quickly Concept bhyve [FreeBSD] was working extremely well in testing Excellent hardware support Liberally licensed OpenZFS Simplistic Small footprint for a type 2 hypervisor Hardware discovery phase FreeBSD Required virtualisation components in CPU Concept – cont.
    [Show full text]
  • Bhyve - Improvements to Virtual Machine State Save and Restore
    bhyve - Improvements to Virtual Machine State Save and Restore Darius Mihai Mihai Carabas, University POLITEHNICA of Bucharest University POLITEHNICA of Bucharest Splaiul Independent, ei 313, Bucharest, Romania, 060042 Splaiul Independent, ei 313, Bucharest, Romania, 060042 Email: [email protected] Email: [email protected] Abstract—As more complex tasks are delegated to distributed Regardless of their exact function, a periodic task is a routine servers, virtual machine hypervisors need to adapt and provide that will have to be called at (or as close as possible) a set features that allow redundancy and load balancing. One such interval. mechanism is the virtual machine save and restore through sys- sleep tem snapshots. A snapshot should allow the complete restoration For example, the basic Unix command can be used of the state that the virtual machine was in when the snapshot to perform an operation every N seconds if sleep $N is was created. Since the snapshot should encapsulate the entire called in a script loop. Since it is safe to assume that all state of the virtualized system, the guest system should not be modern processors have hardware timekeeping components able to differentiate between the moment a snapshot was created implemented, sleep will request from the operating system and the moment when the system was restored, regardless of how much real time has passed between the two events. This that a software timer (i.e., one that is implemented by the paper will present how the time management and block devices operating system as an abstraction [1]) to be set for N are saved and restored for bhyve, FreeBSD’s virtual machine seconds in the future and will yield the processor, without hypervisor.
    [Show full text]
  • In PDF Format
    Arranging Your Virtual Network on FreeBSD Michael Gmelin ([email protected]) January 2020 1 CONTENTS CONTENTS Contents Introduction 3 Document Conventions . .3 License . .3 Plain Jails 4 Plain Jails Using Inherited IP Configuration . .4 Plain Jails Using a Dedicated IP Address . .5 Plain Jails Using a VLAN IP Address . .6 Plain Jails Using a Loopback IP Address . .7 Adding Outbound NAT for Public Traffic . .7 Running a Service and Redirecting Traffic to It . .9 VNET Jails and bhyve VMs 10 VNET Jails Using sysutils/pot ............................. 10 VNET Jails Using sysutils/iocage ............................ 13 Managing Bridges . 13 Adding bhyve VMs and DHCP to the Mix . 16 Preventing Traffic Between VNET Jails/VMs . 17 Firewalling Inside VNET Jails/VMs . 20 VXLAN 22 VXLAN Example Overview . 22 Gateway Configuration . 24 Jailhost-a . 25 Network Configuration (jailhost-a) . 25 VM Configuration (jailhost-a) . 26 Jail Configuration (jailhost-a) . 27 Jailhost-b . 27 Network Configuration (jailhost-b) . 27 Plain Jail Configuration (jailhost-b) . 28 Network Switch Setup (jailhost-b) . 29 VNET Jail Configuration (jailhost-b) . 30 VM Configuration (jailhost-b) . 30 VXLAN Multicast Troubleshooting . 31 Conclusion and Further Reading 33 2020-01-08 (final) 2 CC BY 4.0 INTRODUCTION Introduction Modern FreeBSD offers a range of virtualization options, from the traditional jail environment sharing the network stack with the host operating system, over vnet jails, which allow each jail to have its own network stack, to bhyve virtual machines running their own kernels/operating systems. Depending on individual requirements, there are different ways to configure the virtual network. Jail and VM management tools can ease the process by abstracting away (at least some of) the underlying complexities.
    [Show full text]
  • Curs 8 Virtualizare Nativ˘A
    Curs 8 Virtualizare nativ˘a Servicii avansate pentru ISP 24 aprilie 2017 SAISP Curs 8, Virtualizare nativ˘a 1/37 Outline Introducere KVM KVM s, i libvirt Concluzii ^Intreb˘ari SAISP Curs 8, Virtualizare nativ˘a 2/37 Virtualizare I abstractizarea resurselor unui sistem de calcul I memorie virtual˘a I mas, ini virtuale I emulare I virtualizarea stoc˘arii I system virtual machine I process virtual machine SAISP Curs 8, Virtualizare nativ˘a 3/37 I paravirtualizare (paravirtualization) I virtualizare la nivelul sistemului de operare (operating-system level virtualization) I Cu ce difer˘avirtualizarea de emulare? I la virtualizare, cea mai mare parte a instruct, iunilor se execut˘a pe sistemul fizic I se poate emula o arhitectur˘adiferit˘ade arhitectura sistemului fizic I hypervisor I hosted virtualization (type 2 hypervisor) I bare metal virtualization (type 1 hypervisor) Tipuri de virtualizare I virtualizare complet˘a(full-virtualization) I virtualizare asistat˘ahardware (hardware-assisted virtualization) SAISP Curs 8, Virtualizare nativ˘a 4/37 I virtualizare la nivelul sistemului de operare (operating-system level virtualization) I Cu ce difer˘avirtualizarea de emulare? I la virtualizare, cea mai mare parte a instruct, iunilor se execut˘a pe sistemul fizic I se poate emula o arhitectur˘adiferit˘ade arhitectura sistemului fizic I hypervisor I hosted virtualization (type 2 hypervisor) I bare metal virtualization (type 1 hypervisor) Tipuri de virtualizare I virtualizare complet˘a(full-virtualization) I virtualizare asistat˘ahardware (hardware-assisted
    [Show full text]
  • Integration of KVM in the Openhuaca Cloud Platform
    Integration of KVM in the Openhuaca Cloud Platform A Degree Thesis Submitted to the Faculty of the Escola Tècnica d'Enginyeria de Telecomunicació de Barcelona Universitat Politècnica de Catalunya by Daniel Campos Gómez In partial fulfilment of the requirements for the degree in NETWORK ENGINEERING Advisor: Jose Luis Muñoz Tapia Barcelona, June 2018 Abstract The purpose of this project is the integration of KVM technology into a cloud platform called Openhuaca that lets the user of the software the possibility of creating and managing virtual containers and virtual machines in an easy and fast way. Besides, it can be administrated with domains. It is thought to be implemented in small or medium stages; for example, in a teaching area to help all the students’ necessities in a centralized way. Therefore, every student can connect to all virtualized facilities with their specific digital certificate. The complexity of the project has made it necessary to create a working team formed by a supervisor, ex-students and various TFG students from different universities in order to review and introduce new functionalities to the project efficiently and quicker. 1 Resum L’objectiu d’aquest projecte és integrar la tecnología KVM a una plataforma cloud anomenada Openhuaca. Aquesta plataforma permeteix a l’usuari crear i gestionar diversos contenedors i màquines virtuals d’una manera ràpida i senzilla. A més, pot ser administrada per diversos dominis. Aquest projecte està pensat per a petits o mitjans entorns, per exemple, a l’àrea docent per poder controlar els ordinadors dels laboratoris de la Universitat. Openhuaca està pensat per cobrir les necessitats dels alumnes de forma centralitzada.
    [Show full text]
  • Virtualization Costs: Benchmarking Containers and Virtual Machines Against Bare‑Metal
    SN Computer Science (2021) 2:404 https://doi.org/10.1007/s42979-021-00781-8 ORIGINAL RESEARCH Virtualization Costs: Benchmarking Containers and Virtual Machines Against Bare‑Metal Saverio Giallorenzo1,2 · Jacopo Mauro3 · Martin Gyde Poulsen4 · Filip Siroky4 Received: 16 April 2021 / Accepted: 29 June 2021 © The Author(s), under exclusive licence to Springer Nature Singapore Pte Ltd 2021 Abstract DevOps advocates the usage of Virtualization Technologies (VT), such as Virtual Machines and Containers. However, it is complex to predict how the usage of a given VT will impact on the performance of an application. In this paper, we present a collection of reference benchmarks that developers can use to orient when looking for the best-performing VT w.r.t their application profle. To gather our benchmarks in a resource-wise comprehensive and comparable way, we introduce VTmark: a semi-automatic open-source suite that assembles of-the-shelf tools for benchmarking the diferent resources used by applications (CPU, RAM, etc.). After performing a survey of VTs in the market, we use VTmark to report the benchmarks of 6 of the most widely adopted and popular ones, namely Docker, KVM, Podman, VMWare Workstation, VirtualBox, and Xen. To validate the accuracy of our reference benchmarks, we show how they correlate with the profle performance of a production-grade application ported and deployed on the considered VTs. Beyond our immediate results, VTmark let us shed light on some contradicting fndings in the related literature and, by releasing VTmark , we provide DevOps with an open-source, extendable tool to assess the (resource-wise) costs of VTs.
    [Show full text]
  • AWS Firecracker VMM 之 ⼤熱天捲起袖⼦動⼿玩
    Playing with AWS Firecracker VMM 之 ⼤熱天捲起袖⼦動⼿玩 ... Ernest Chiang @ COSCUP 2020, Track: Cloud Native Hub Give me a place to stand on, and I will move the Earth. —Archimedes 2 sli.do #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm #awsvmm 議程中有任何問題、好奇、疑問,都可以隨時丟進 sli.do US$25 AWS Credits 問券連結,也放在 sli.do 裡頭喔 3 Ernest Chiang Worked on process integration engineering in semiconductor industry @tsmc. Doing product and technology integration in fitness industry @pafers. Off Work TGO Networks Taipei. AWS Community Hero. Mozillian. AIESECer. 4 Outline Problems & Solutions Firecracker Virtualization & Containerization Lambda & Fargate Firecracker & container d Live Demo Getting started with Firecracker in 2 Minutes Creating 4,000 microVMs in 90 seconds Firecracker & Open Source Projects 8 Problems & Solutions 9 Firecracker, Part 1 10 What is Firecraker Firecracker is an open source VMM that is purpose-built for creating and managing secure, multi-tenant container and function-based services. 11 What is Firecraker Firecracker is an open source VMM that is purpose-built for creating and managing secure, multi-tenant container and function-based services. 12 What problem is AWS helping to solve? 13 What problem is AWS helping to solve? 14 What problem is AWS helping to solve? Multiple functions on multiple environments from multiple accounts . 15 What is Firecracker Open source virtualization technology (microVM) Security and isolation of traditional VMs Speed and density of containers Low resource overhead Developed at Amazon 16 Benefits of Firecracker 17 Benefits of Firecracker 18 安全隔離好 啟動時間短 產能效率⾼ #像極了愛情 -- AWS Firecracker VMM 19 Virtualization & Containerization 20 Virtualization (1/3) In computing, virtualization refers to the act of creating a virtual (rather than actual) version of something , including virtual computer hardware platforms, storage devices, and computer network resources.
    [Show full text]
  • A Survey on Shared Disk I/O Management in Virtualized Environments Under Real Time Constraints
    A survey on shared disk I/O management in virtualized environments under real time constraints Ignacio Sañudo Roberto Cavicchioli Nicola Capodieci University of Modena University of Modena University of Modena and Reggio Emilia and Reggio Emilia and Reggio Emilia ignacio.sanudoolmedo [email protected] nicola.capodieci @unimore.it @unimore.it Paolo Valente Marko Bertogna University of Modena University of Modena and Reggio Emilia and Reggio Emilia [email protected] [email protected] ABSTRACT the case of next-generation automotive architectures, where In the embedded systems domain, hypervisors are increas- cost-effective solutions ever more require sharing an on-board ingly being adopted to guarantee timing isolation and appro- computing platform among different applications with het- priate hardware resource sharing among different software erogeneous safety and criticality levels, e.g., the infotain- components. However, managing concurrent and parallel ment part on one side, and a safety-critical image processing requests to shared hardware resources in a predictable way module on the other side. These domains are independent, still represents an open issue. We argue that hypervisors with different period, deadline, safety and criticality require- can be an effective means to achieve an efficient and pre- ments. However, they need to be properly isolated with no dictable arbitration of competing requests to shared devices mutual interference, or a misbehaving module may endanger in order to satisfy real-time requirements.
    [Show full text]
  • P4A: Hands-On Bhyve, the BSD Hypervisor
    The bhyve Operator's Manual Michael Dexter AsiaBSDCon 2013 OVERVIEW bhyve is a legacy-free Type-2 hypervisor for FreeBSD that was imported into the mainline FreeBSD development repository in January of 2013 with svn revision r245652. A hypervisor allow for the operation of one or more guest operating systems within a host operating system. As a legacy-free hypervisor, a bhyve host requires the Extended Page Tables (EPT) feature found on "Nehalem" and newer generations of Intel processors. This requirement eliminates the need for memory management routines that are traditionally implemented in software and yields virtually bare metal guest performance. A bhyve guest requires VirtIO network and block devices, which were already available in FreeBSD 8-STABLE, 9-STABLE and 10-CURRENT at the time of bhyve's import. If these two requirements are satisfied, the bhyve host and guests will operate in the established FreeBSD manner. HARDWARE REQUIREMENTS The presence of the Extended Page Table (EPT) feature can be determined by examining the host's demesg(8) output for the presence of the POPCNT (POP Count) feature as the two are coupled but not related. Established dynamic memory and storage requirements apply otherwise with the caveat that there is a 1:1 relationship between the deduction of dynamic memory from the host and its allocation to guests. SOFTWARE REQUIREMENTS A FreeBSD 10-CURRENT system from svn revision r245652 onward will include all of the necessary bhyve host components: the vmm(4) kernel module, the libvmmapi library and the bhyveload(8), bhvye(8) and bhyvectl(8) utilities. A suitable FreeBSD 8-STABLE, 9-STABLE or 10-CURRENT guest can exist in a disk image or any valid storage device and only requires a modified /etc/ttys entry to work.
    [Show full text]
  • Safe Kernel Programming with Rust
    DEGREE PROJECT IN COMPUTER SCIENCE AND ENGINEERING, SECOND CYCLE, 30 CREDITS STOCKHOLM, SWEDEN 2018 Safe Kernel Programming with Rust JOHANNES LUNDBERG KTH ROYAL INSTITUTE OF TECHNOLOGY SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE Safe Kernel Programming with Rust JOHANNES LUNDBERG Master in Computer Science Date: August 14, 2018 Supervisor: Johan Montelius Examiner: Mads Dam Swedish title: Säker programmering i kärnan med Rust School of Computer Science and Communication iii Abstract Writing bug free computer code is a challenging task in a low-level language like C. While C compilers are getting better and better at de- tecting possible bugs, they still have a long way to go. For application programming we have higher level languages that abstract away de- tails in memory handling and concurrent programming. However, a lot of an operating system’s source code is still written in C and the kernel is exclusively written in C. How can we make writing kernel code safer? What are the performance penalties we have to pay for writing safe code? In this thesis, we will answer these questions using the Rust programming language. A Rust Kernel Programming Inter- face is designed and implemented, and a network device driver is then ported to Rust. The Rust code is analyzed to determine the safeness and the two implementations are benchmarked for performance and compared to each other. It is shown that a kernel device driver can be written entirely in safe Rust code, but the interface layer require some unsafe code. Measurements show unexpected minor improvements to performance with Rust. iv Sammanfattning Att skriva buggfri kod i ett lågnivåspråk som C är väldigt svårt.
    [Show full text]