a

MicroVMs

Lean Mean Virtual Machines

Subhi Dweik. Chapter Eindhoven '22 X Cloud & Devops tribe
a

Index

  • What's a MicroVM
  • Why VMs aren't legacy
  • VMs and Docker
  • Use cases and downsides
  • In practice: Firecracker
  • Demo
  • Questions
a

What's a MicroVM

  • It's a VM, but small
  • Very limited emulated hardware
  • Include only what you need to run your software
  • Startup time within a second
a

But, VMs are legacy

  • Pets are legacy, "The docker way" isn't tied to docker
  • 12 Factor can be applied to more than just containers
  • Something has to run K8s/Nomad/Docker engine
a

VMs vs Docker

From: www.backblaze.com/blog/vm-vs-containers/
a

Use cases

  • Anything that runs user code (AWS Lambda, Screeps)
  • Building images
    • No more passing through docker.sock
  • Local cluster emulation
    • Especially useful for things that need custom networking
  • Init systems like Systemd/OpenRC can be used
a

Downsides

  • Building VMs is a bit cumbersome
  • No "established" orchestration tools like K8s for Docker images
  • More overhead than a docker image
  • Networking requires more work
a

Getting started: Firecracker

Firecracker is built by AWS

  • 125ms launch time @ 5Mb memory overhead
  • Supports overprovisioning
  • Metadata service support
  • API driven
a

Building a MicroVM

  • Firecracker QuickStart
  • You need a kernel image, and a root file system
  • You could compile the linux kernel
    • Or you could get the one from the quickstart
  • Get a RootFS
    • Can be created by copying a Docker file system
  • You can replace /sbin/init by your app to bypass the full system boot
a

DEMO

a

Questions?

Docker is essentially CGroups and a chroot

vms give far more isolation