This context provides an introduction and guide to Firecracker, a virtual machine monitor (VMM) developed by AWS that uses Kernel-based Virtual Machine (KVM) to create and manage microVMs.
Abstract
Firecracker is a virtualization technology based on KVM, developed by AWS, and open-sourced using the Apache 2.0 License. It is written in Rust and has been deployed in AWS's serverless compute services, Lambda and Fargate. Firecracker offers the benefits of both virtual machines and containers, providing workload isolation similar to traditional VMs and resource efficiency and fast startup times like containers. The guide covers the basics of Firecracker, its features, and a step-by-step tutorial on how to deploy it.
Opinions
Firecracker combines the security benefits of virtualization with the resource efficiency and fast startup time of containers.
Firecracker provides a REST-based configuration API over a Linux Socket, allowing for easy management of MicroVMs.
Firecracker has a powerful security bouquet, including a simple guest model, process jail, and static linking.
Firecracker only runs on Linux and uses KVM for virtualization.
Firecracker has been integrated into container runtimes such as Kata Containers and Weaveworks Ignite.
Firecracker provides a cost-effective way to deploy cloud-native applications on-demand.
The author expresses a strong feeling that the future of Firecracker and related development technology is bright due to its powerful security features and resource efficiency.
Firecracker is a virtual machine monitor (VMM) that uses the Linux Kernel-based Virtual Machine (KVM) to create and manage microVMs!
What is VMM?
A VMM Virtual Machine Monitor also knows as Hypervisor is software that creates and runs virtual machines. There are two main types VMM , referred to as Type 1 (bare-metal) and Type 2 (hosted).
What is KVM?
Kernel-based Virtual Machine (KVM) is open sourcevirtualization technology built into Linux. Installing KVM on top of your Linux will convert your system into Hypervisor.
KVM converts Linux into a type-1 (bare-metal) hypervisor.
What is Serverless computing?
Serverless computing is a cloud computing execution model that deploys cloud-native applications on-demand in a cost-effective way. Serverless does not mean that there are no servers running, the difference is when you deploy your app, no resources you have to manage or configure, the cloud provider will do the magic on demand! It eliminates the need for server software and hardware management by the developer.
For cloud providers, the economics of serverless poses challenges in terms of selecting tech to achieve it with minimal overhead. They have a choice between using virtualization or Containers! Virtualization comes with security benefits but management overheads. Containers, on the other hand, have min overhead but lacks security aspects!
What is Firecracker?
Firecracker is virtualization tech based on KVM. It was developed at AWS and then open-sourced using Apache 2.0 Licence. Firecracker is written in Rust. AWS deployed Firecracker in two publically-available serverless compute services at Amazon Web Services (Lambda and Fargate).Using Firecracker you can launch MicroVMs in non virtualized environments. Firecracker has also been integrated into container runtimes, for example, Kata Containers and Weaveworks Ignite.
Doubt? When world is going mad on containers then why VMs?
Ans: Firecracker offers the best of both worlds: the security of workload isolation similar to hardware-virtualization-based virtual machines(traditional VMs) and the resource efficiency and fast startup time of containers.
Firecracker only runs on Linux!(It uses KVM)
Firecracker provides a REST-based configuration API over a Linux Socket. This API is used for configuring the MicroVMs. It can start and stop them too. One Firecracker process runs per MicroVM, providing a simple model for security isolation.
Firecracker is designed to be run securely, inside an execution jail, carefully set up by the jailer binary.
Firecracker Security...
In terms of security, Firecracker has a powerful bouquet. Few of them are—
Simple Guest Model
Process Jail
Static Linking
How to deploy?
We have discussed AWS Firecracker and its features. It's time for a quick demo now -
Step 1: Make sure you have access to KVM.
root@master:# sudo apt install cpu-checker
root@master:# kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
# You can check if you have access to /dev/kvm with:
Step 8: We are all set now, Let’s start the guest machine!
That’s it, Now go back to your first shell and you can see a prompt on the new machine. We have used hello-rootfs.ext4 image, so log in as root, using the password root.
While performing this demo, I must say that MicroVM did not take more than few seconds to come up. Another good feature is the Rest interface which will allow any language to communicate and work with Firecracker APIs.
I have a strong feeling that the future of Firecracker and related development tech is bright. Its powerful security features and resource efficiency gives a good head start against containers.