154 points · by Mojah · 11y ago · 70 comments
When I just had a full VM with a full stack running on some hypervisor I could treat it just like a physical machine so management tools worked pretty much the same (with a few little exceptions). When containers came into the mix it just hit me with so much more work to admin. Unikernels seem like a lot of work too.
Am I alone in thinking this??
Heroku was the first to cross it, and they do a bang-up job with Rails apps, but ever since it came out there has been this sort of question hanging in the air of "how does this generalize?"
A VM on something like Amazon EC2 was the best we could do at that time. It certainly generalizes, but you have to do quite a lot of sysadmin work to keep an app running healthily. Docker was an improvement on that, taking away some underlying system work. But then losing the security benefits of VMs and still, in the end, requiring a bunch of systemsy stuff.
Of course Heroku kept firing with its buildpacks supporting lots of platforms and a host of infrastructure provided as a service. But that doesn't really provide all of the control application developers need. You're sort of at the mercy of what infrastructure there's a market for, at market prices.
So what's happening is both sides are sort of pressing in to the middle... On the docker side trying to build general-purpose containers that can run on a shared foundation of rock solid system images, and on the IaaS side trying to do as much as possible over a network connection.
We will eventually meet in the middle, with a set of secure, well-defined interfaces between an application and the infrastructure it relies on, which is robust enough to handle the vast majority of software.
Then again, if you squint your eyes that's kind of what we already have. We're just slowly decreasing the surface area of those interfaces and increasing their security. What you're feeling is the pain of that surface area being still pretty big and the job of surveying daunting. Luckily you don't need to map the whole thing, just know enough to make good decisions this week.
And honestly, I think for most people, focusing on how to build more human-relevant software is going to be way more helpful to your career than learning about the successor to Docker. But that's just some unsolicited career advice. :)
Right up until you discover that availability and data integrity and security are still problems, as you discover when it turns out your understanding of Amazon's AZs is faulty and your business goes offline.
I'm happy you get to work in an environment with no legacy applications that require a specific old operating system but that's not the case for a massive portion of sysadmin jobs.
There are pros and cons to each: a container lets you run other things on the same kernel, and introspect the running process (as well as do interception of things like sysdig does.) However, root-on-container generally means root-on-all-containers. So we use VMs to host containers in.
x86 is much smaller in terms of instruction set to a Linux kernel, there are historically fewer vulnerabilities, many fewer LoC, etc. The unikernel compiles your OS and libs together, meaning you can share a hypervisor - which is good for security. You lose some of the convenience of management of containers in order to get this.
Not necessarily... http://unikernel.org/blog/2015/unikernels-meet-docker/
This can be considered a security win and a usability loss.
From the point of view of a former sysadmin and current "private cloud" enthusiast that's a crucial question that likely leads to intricate discussions on security as well.
It's a fairly different philosophy—I don't think anyone really cares about the performance aspect of it (those people care more about getting zero-copy low-level IO in userland while still reaping the "control-plane" benefits of having an OS, using e.g. Snabb Switch.)
It's more like the philosophy behind Erlang releases or black-box "appliance" VMs. Which is, basically, that you don't maintain "the OS" as a thing separate from your app; you just maintain "your app", and any bits of OS are basically part of the vendored deps of each successive app release.
The language runtime and libraries built on top of it were the OS.
Seen by this lenses, POSIX could be seen as the C runtime, if one would stretch this example.
So for me, it is quite natural that when one has languages with rich runtimes, the OS is just another layer that can be taken out and we can go back to the days when runtimes were mostly targeting bare-metal.
Containers, VMs and Unikernels all have different characteristics and philosophies, if one fits all your needs there is no need to make it more complicated by introducing another type. But if you need something specific, they are there.
Quicksort and universal hash tables use randomization to avoid problems that arise with pathological sets of data, and so their performance can only be given on average.
If even simple CS primitives have such trade offs, then those are certainly going to propagate up the complexity tree as we engineer solutions on top of them.
In general, it's probably best to just know that these things exist and what their strengths and weaknesses are (they will almost certainly always have both) so that you can pick the right tools for the job at hand.
I tend to think of unikernels as having to 'front-load' more of the work. That's why you can treat the end artefact as almost disposable.
With a traditional stack, it may be easier to set up, but you're then committing to acting as caretaker for the code that runs on that machine, inc. patches, upgrades, version constraints, etc. There's probably more work there over the long term.
This is kind of where the distinction of 'cattle vs pets' comes from.
Whereas for unikernels, it's the opposite
> Unikernels leverage the advantages of virtualisation to create an operating system that's as specialised and optimised as possible.
It makes no sense to craft a hyper efficient kernel and then run Ruby on it. If your requirements are such that Linux is too slow, you are probably an HFT. Or Google.
"One hundred novel implementations of /dev/random" is a security nightmare. What you want is one implementation of /dev/random that everybody uses. Like uh, Linux.
Same goes for every other element of the kernel. A secure kernel does not come from using (I'm sorry to say) a hipster programming language, it comes from decades of abuse that is thrown at mainstream kernels.
Seperate VMs would as well, but it's not really feasible to run a full Windows Server for each customer.
One example of this general design is VAX ELN.
The following is a brochure from the V2.2 release, from 1986:
http://bitsavers.trailing-edge.com/pdf/dec/vax/vaxeln/2.0/VA...
Compile and then link the application code with the particular pieces of the toolkits that you needed and with the provided kernel into a single download image, and either embed or boot or network boot the target box using it. Remote debugging was available, as well as a relational database, etc.
I remember you always had to bundle everything together with the exception of what was already present in the firmware.
Also some books I had access in the mid-90's were all about creating your own libOS with tasks and lightweight communication primitives and then bundling everything together.
Coding since the 80's, but the most embedded stuff I did was PC (bypassing MS-DOS), Amiga and Symbian and reading also PIC programming on Elektor.
So maybe my perception might not be the correct one.
Wish modern systems were designed and implemented with even half the skill that VMS, etc were. I've never gotten to experience an OS reliable enough that I temporarily forgot reboot command. Desktop Linux will have to do. ;)
re: "those days" — FWIW, those days are still ongoing. The latest OpenVMS release shipped out in June 2015, and the native port to x86-64 is underway.
1. Has the company been more clear privately than the website on how long it will be before a Xeon port materializes?
2. Have they significantly reduced the OpenVMS licensing costs that kept many off it?
> Improved security: only the core of the OS is implemented, no video or USB drivers that aren't needed and could be a source of intrusion.
I am not aware of any video or USB driver vulnerability which led to security concerns on a typical server setup in the last decade.
> Very small footprint: imagine being able to remove 95% of the kernel size, simply because your application doesn't need it.
This may free up 1 MB of RAM or maybe two. Unrelevant unless you're doing embedded programming, which is not the environment unikernels are targeting.
> Specialised implementations: you know your application and you can tweak and run your kernel exactly the way you want it.
Too vague of a statement to even criticize, anyway my applications conform to the POSIX specification so that they are portable and run exactly the way I want them.
> Quick enough to be "Just in time" to summon a unikernel live (similar to live spawning Docker instances), with boot times less than 1 second.
This may be a fair point in a system where the deployment time of a new instance is critical.
CVE-2015-3456 was raised in April which had a privilege escalation due to a floppy driver controller, and caused widespread reboots and replacements of images in the Amazon cloud:
It has nothing to do with bytecode per se.
It allows a JVM to run bare-metal, there are plenty of them already in the embedded world.
For example J9 from IBM.
Thanks
https://en.wikipedia.org/wiki/I/O_channel
Thanks to that, the compute nodes are always computing and I/O processors are always handling the interrupts, protocol processing, whatever. This kept utilization and throughput high. Things being so expensive are why they stripped components out until the small machines DOS and UNIX were on didn't support crap, esp Channel I/O. Like most legacy effects, such fundamentally architecture was kept in there as hardware improved and got beyond cheap enough for a Channel I/O-like solution. We've seen over past decade various offloading mechanisms but the original architectures were fundamentally better for smart I/O and virtualization. They just weren't adopted, forcing people to work around the crap we have in clever ways.
Note 1: Even true for embedded as I/O coprocessors can greatly aid determinism and throughput. Upon my suggesting it, Ganssle sent me a SOC that had a mid-to-high end part for compute plus a weaker CPU for I/O handling with many supposed benefits. The old mainframes had a high-end processor for compute plus low-end one for I/O handling. Put a smile on my face to see the lesson rediscovered. :)
Note 2: A number of systems, esp kernelized architectures, tried to minimize the amount of OS for user applications or OS's starting with VM/370 I believe and KeyKOS later doing nanokernel. So, that isn't new either. Rump kernels easy integration with kernels without forks or extensive modifications are a significant innovation, though.
2) Is the specialization the important aspect? I see OSv referred to as a unikernel but it does no specialization, it supports almost the entire Linux ABI. I'd argue it is a library OS, though.
2) specialization. AFAIK the the concept of a library OS is from a time when single purpose computing was not on the agenda. We could argue a lot about the different ways of multiplexing and isolating different workloads and how maybe privilege levels were meant to solve the same problem as hardware virtualization but the spirit of unikernels (and library OSs) is to use language and program against an API that specializes to whatever ABI your target happens to be. The name unikernel is used more in the context of specialized applications in the sense of what a UNIX process is supposed to be (do one thing) but I'd say the important aspect is still the use of language technology which then enables specialized code.
I'm not too familiar with OSv but I think the goal is to provide a runtime for off the shelf java applications. It should be possible to fuse an application with just the needed parts of libc and drivers, though.
OSv is a bit unusual architecturally, it is almost a very small OS that runs applications in a single address space. It is perhaps a hybrid architecture.
The first line of the Wikipedia page is written this way - https://en.wikipedia.org/wiki/Unikernel
One mitigating factor is that all those russian-doll levels don't switch back and forth all that much (thinking in computer, not human, time). Moreover, some of those levels (like the BIOS) do their thing and then they cede control until the end of time (i.e. reset).
So yes, the multilayered cake is pretty impressive, but the situation is not that dire.
Joyent CTO Bryan Cantrill gave a great talk at Velocity NYC 2015 about the history of containers (going back to March 18, 1982 when Bill Joy added the chroot system call) and the problems of running containers on operating systems in VMs on hypervisors:
"Stop killing kittens and melthing the ice caps: Run containers on bare metal already!"
> Even core modules in the Linux kernel don't apply to every installation. Things like USB drivers are useless in a virtualised "cloud" environment, but are still included in the kernel.
You don't have to compile them in, or load them as modules, if you don't want. Or am I confused about what they're trying to say?
I've been using Linux for long enough to recall when you had to recompile your kernel in order to add device drivers...
The client application might use a library dependent on, say, a high-frequency clock. Therefor, during the build of the application, the specific capability is build into the kernel. Synchronisation and sanity checks of this high-frequency clock runs only when this specific image (or unikernel) is loaded.
It's a pretty neat idea and fits well in the global trend of dependency inversion. It also highlights the gaping architectural hole in the current container (docker) offerings: by using a base-image, you specifically ask for everything that is necessary for: networking, IPC, process management, scheduling, file system management, package management, printing, the whole POSIX interface etc. etc. This in turn creates a huge attack surface from a security perspective and makes maintenance and quality control much harder.
My sole question with unikernels is: doesn't this just move resource management (scheduling) upwards and security (access to resources) downwards? Or in other words, are we not creating two extra rings?
A very minimal linux kernel, a basic set of CLI primitives, NPM, and a few JS ports of traditional POSIX tools.
Looks like it'll be an easy path to building immutable stateless web servers. It can be run on bare metal (Raspberry Pi), Docker containers, and everything in between.
Start small and extend using the existing ecosystem.
I'm really looking forward to this project reaching full maturity.