This presentation is a part of Kubernetes meetup vol3 @ Athens.
At the very beggining we explain how we manage until now to come closer to the virtual hardware, removing possible duplication layers, that appear between the hypervisor and the Virtual Machine. An alternative solution removing duplication layers is Unikernels. Having small sized VM including only hypervisor libraries and our application in the same level (kernel), we build a Custom Virtual Machine targeting smaller footprint, reduced latency and better security. Next we explain very fast the OSv unikernel that allow us to compose a linux service built as shared object within the unikernel. Finnally we see a benchmark of a Redis Cluster that is running on OSv unikernels.
6. Server Model
# Story
Hardware
HYPERVISOR XEN, KVM etc.
Nikos Virtual Machine Virtual Machine Virtual Machine
Nikos now rent portions of the resources
Users
Application
Kernel
7. Hypervisor
# Story
responsible for managing and distributing hardware
resources to virtual machines and they offer
hardware virtualization.
Supervisor of Virtual Machines
8. Server Model
# Story
Hardware
HYPERVISOR is an OS e.g. Linux
Nikos Virtual Machine Virtual Machine Virtual Machine
Nikos now rent portions of the resources
Users
Application
KernelOS
Duplication
10. Containers
# Story
Stand-Alone, executable package
Includes only what our service need
Isolated environment between containers
e.g. development, staging, production
Shared kernel e.g. Linux
Source: http://docker.com
12. Conclusion
# Story
removing things that we don’t need e.g. libs
we make sure we use shared resources
e.g. containers, one Linux installation with multiple isolated
services.
there is a tendency to
get closer to the hardware and manage it efficient
13. # Unikernel
is an operating system which includes basic
hypervisor libraries + our service libraries
e.g. KVM libraries + Seastar framework.
15. What is?
# Unikernels
Virtual Machine
Runs only one process
fork() will not work
No Users
=> eliminate context switch
No Shell (better security)
Service has instant access to the virtual hardware
Usually supports one language e.g. OCaml
Fast Boot time.
We don’t need to manage the hardware resources
Small size (depends on design)
19. Appliances
# Unikernels
IoT / Embedded
W
Usages
Web services
Network Functions Virtualization
(NFV)
High-performance computing
(HPC)
20. # OSv Written with C++
POSIX support
pThreads experimental
TCP/IP Stack
Network: Net Channels by Van Jacobson
Linux Virtual File system
Runs on XEN, KVM, VΒox, VMWare & ARM 64 bit
22. Composing an application with OSv
Clone and Compile the
OSv base image
Compile as shared object
Use Capstan for
the composition
Our .qemu
Image
23. Composing an application with OSv
Clone and Compile the
OSv base image
git clone https://github.com/cloudius-systems/osv.git &&
cd osv &&
sh ./scripts/build image=empty
24. Composing an application with OSv
Clone and Compile the
OSv base image
Compile as shared object
gcc –c –fPIC –o foo.o foo.c &&
gcc –c –fPIC –o bar.o bar.c &&
gcc -shared –fPIC –Wl, -soname,libqux.so.1 – o libqux.so.1.5.0 foo.o bar.o -lc
25. Composing an application with OSv
Clone and Compile the
OSv base image
Compile as shared object
Use Capstan for
the composition
capstan build –i fooImage –base=$OSV_IMG_LOCATION
&&
capstan run fooImage –e ./libqux.so
26. Composing an application with OSv
Clone and Compile
the OSv base image
Compile as shared
object
Use Capstan
for the
composition
Our .qemu
Image
27. Composing an application with OSv
Clone and
Compile the OSv
base image
Compile as
shared object
Use
Capstan for
the
composition
Our .qemu
Image
Source: www.mikelangelo-project.eu.
28. Composing an application with OSv
Clone and
Compile the OSv
base image
Compile as
shared object
Use
Capstan
for the
compositio
n
Our .qemu
Image
Source: www.mikelangelo-project.eu.
35. Conclusion
Tricky parts when we are in a POSIX-able unikernel
Don’t assign many vCPUs
NUMA is not well supported
Notice the synchronous mmap() on a single process environment
Usage of 0-copy feature when we can apply it
OSv looks great as FAAS "container"
Small size
Small boot time
Immutable potentially better security
We need more mature ecosystem for the Unikernels
Remote debugging
Monitoring
Orchestration tools
37. Learn more about Unikernels
An Infrastructure with unikernels (Mikelangelo EU)
OSv – Unikernel (Run Linux Services)
http://osv.io/
OSv - Examples:
https://github.com/cloudius-systems/osv-apps
Running OSv on Kubernetes (e.g. with Apache Spark)
Dive into
38. UNIK
The Unikernel Compilation and Deployment Platform
Supported Unikernels
OSv (Almost everything)
Rumprun (Python Node.js, GOlang)
IncludeOS (C++)
MirageOS (OCaml)
Run your first Java unikernel
on Virtualbox with UniK
Dive into
39. Dive into
UNIK
The Unikernel Compilation and Deployment Platform
Supported Provides
Google Cloud
Amazon Web Services
Openstack
Virtualbox
vSphere
QEMU
UKVM
XEN
Photon Controller