On Ditching Vagrant
24 points by raymii
24 points by raymii
Wow, I haven't heard about Vagrant in a long time. But I'm happy it served you so well so long.
I think Vagrant is very long in the tooth (and has been for a long time), but this blog post is a really good example of why I created Vagrant in the first place and why there's still space for a tool so high level and relatively simple: look at all steps to move to libvirt+kvm!!
The idea behind Vagrant was always: (1) install hypervisor (one package) (2) install Vagrant (3) vagrant up for everyone but the person who sets up the Vagrantfile. I mean, I originally created Vagrant partially so that designers and non-technical managers could use it, and they did! A lot! VirtualBox/VMware was a packaged installer on almost all systems, Vagrant was a packaged installer, and then they just had to learn the bare minimum terminal stuff to run vagrant up. I saw this work in practice time and time and time again. I couldn't imagine trying to explain to them how to setup libvirt and kvm haha (although, on their own excellent tech ofc).
There's a reason the original domain for the project was "vagrantup.com". I wanted the domain to basically match the only thing most people ever needed to know about Vagrant. The rest didn't matter. The number of people deeply aware of and writing Vagrantfiles or boxes is nothing compared to the number of people that just ran up.
There's a lot of reasons I think Vagrant doesn't make sense in mainstream contemporary tech stacks today. But, I also believe that there's never been a true replacement that encapsulates the simplicity that Vagrant brought to a large cross-section of people.
Docker got really close. But I firmly believe that "nouns" matter and the problem with Docker to me is there a ton of stuff that is focused on deployment/runtime aspects and it meddles with the human flow. The fact that Vagrant was focused directly, exclusively on development was by design: the configuration, the CLI, etc. revolved around development-focused nouns, and I think that was a good thing.
(My top request over the years and years of Vagrant was always "I want to use Vagrant to deploy!" and I tried and failed a bunch of different ways but ultimately kind of came around to: nouns matter, and Vagrant can't deploy without sacrificing dev.)
If it isn't obvious, I started Vagrant. :)
I actually think we're coming full circle, actually.
Even with Podman, which I think is miles better than Docker, container-based setups increasingly annoy me. Containers are easy, not simple. You end up fighting ton of the things that Docker does to make things easy.
For our current project at work, we've gone heavy on Nix but we've decided to use VMs; we are using Lima instead of Vagrant, but developers can start a VM with all the service dependencies we need. So far it's working very smoothly. Because the VM is NixOS, with proper caching building the VM is quite fast, so we don't even need base images.
Nowadays, I think we're much closer to being able to ditch the VM or the containers and run everything isolated directly as raw processes. Most things have portable binaries, there's nixpkgs for Linux and macOS... we're just missing a few pieces to make it friendlier. For example, for PostgreSQL, there are projects like embedded-postgres-binaries that make it easy to create a library in your favorite language that will spawn a PostgreSQL database in isolation directly.
(devenv comes quite close to this also, but we decided against it so that our services VM could be basically exactly the same code as production. I wish we would have explored it further.)
I see how younger developers who have not lived through the pre-Vagrant era and the Vagrant era have only known a Docker world. It's weird. When Vagrant came out, everyone jumped it into it quickly... for Docker to appear briefly and everyone jump to that instead. I feel Docker is still the default, but I believe it's on its way out.
I firmly believe Docker exists as it is today because of Vagrant. I remember Docker when it very first came out and there was no registry and it was more of a weird Virtuozzo/OpenVZ kind of thing. Whereas with Vagrant you could vagrant up from a Vagrantfile or you could go grab the latest bento box and have a great local dev experience. When Docker became more “pull/run” is when it kind of exploded in popularity.
I’m trying to think of what “replaced” Vagrant and I think you’re right in that it wasn’t really replaced, development just changed a bit. Local tooling got better, WSL is a thing, and languages in general are much better at running across OSes and architectures today.
Anyway, thanks for Vagrant. I really enjoyed it and got a lot of value and fun out of it. Also the plugin ecosystem was insane and impossible to debug but I loved it anyway.
I mean, I originally created Vagrant partially so that designers and non-technical managers could use it, and they did!
Indeed. I remember at my first ever dev job I tried to figure out how to use this new fangled Vagrant thing so I could get our designers to spin up a (beastly) Magento install. After some stumbling which included getting an SO answer from the creator himself(!), our designers were able to work on the same things we were. Thanks years later :)
Since you're here, I have actually wondered why the packaging step for Vagrant (even back when it was MIT) is closed source?
I readily admit that I did not check every single tag all the way back, but I have spot checked quite a few and it seemed like the gem part was always open but the "and here is a fully running copy of Vagrant" was always "for employees only"
I'm sorry I honestly don't know/remember. I obviously don't have access to any of that anymore but I also just can't recall any of this. Looking at all this, it looks like it was done past when I was maintaining Vagrant anymore but I also don't remember just in general. Sorry!
From the title I thought this was a list of disaffections, but it's something much cooler: a guide on managing VMs using libvirt.
Now that's a name I've not heard in a long time. A long time...
I mean, I was like "wow, a Vagrant holdout"... and... I'm the founder of the first Vagrant usergroup ever, if I surveyed right. Certainly invested in the thing :).
It was a cool tool, but definitely a first attempt.
libvirt, on the other hand, is a library and network daemon (pronounced as demon, not “daymon”)
So cute when people think they can dictate pronunciation. It does kind of call into question the knowledge of the author, however.
I personally love Incus! Simpler than proxmox, and has rock stable performance and upgrades.
As someone who uses Vagrant literally every day I work, and creates both public, and private (client) base boxes, I honestly wouldn't have been surprised if the last line of the article was a list of tags that include #sarcasm or #tech-masochism or what have you.
Why have another software layer, another abstraction, to create something that Linux can do natively?
Because it's a relatively[1] instant, repeatably reproducible environment for everyone who needs to use it, across basically any host platform you can imagine.
There's zero ongoing overhead to running a vagrant VM, so I don't really see what practical benefit the author gained by abandoning vagrant in favour of virsh. You've still got just as many layers of abstraction to KVM, but now it's not portable, and slower any time you need to start with a fresh virtual environment.
1: No it's not literally instant. A Vagrant VM will need to re-copy the base box and boot up to create the environment initially or after a vagrant destroy. But if your solution to replace that is to run a pressed to install the OS, and then rely on cloudinit to configure the environment every single time you need to recreate the guest environment, I'm honestly not sure whether I should cry for you or laugh in your face.