Ask HN: Is Vagrant Dead?

17 points by ingvul ↗ HN
As a solo developer of a tiny Saas, I find Vagrant indispensable in my day-to-day tasks. I use it mainly as a tool to reproduce cloud infrastructure locally. As you can imagine, my cloud infrastructure is really tiny and so it's feasible to reproduce it locally on my laptop. I also use Docker extensively, but I don't think Docker replaces Vagrant at all (at least for my use cases).

While I could use a separate private cloud just for development purposes (and effectively use my laptop as a "dumb" terminal), I find it irritating because:

- It's not free. I have to pay for it

- My laptop is powerful enough to emulate my production infra

- It just feels wrong to me. I like the idea of using my own machine to develop my application and my infrastructure, and spin up/tear down VMs as many times as needed without having to worry about price

Do you still use Vagrant or similar tools to spin up VMs locally?

14 comments

[ 4.7 ms ] story [ 13.7 ms ] thread
IMHO Vagrant is "stable". Possibly boring. (A good thing for tools, generally.) But it works well.

Why would you ask if it's dead?

> Why would you ask if it's dead?

Mainly because developers around me use Docker instead, and infrastructure engineers do not reproduce cloud infrastructure locally anymore (they have dev environments on the cloud as well). In my experience, at least, Vagrant was heavily used like 4 years ago, but nowadays not so much.

I remember when we used to reproduce our cloud infra locally with vagrant. It was very useful for me as a developer. It just so turned out that on those cases we were also in charge of maintaining the system updates etc . Our shift away from managing servers has made adopting tools like docker more natural as we deploy to Kubernetes where you never touch the system (it’s managed).

Maybe the better question is whether using straight EC2’s without any other layer on top for deployment is going the way of the dodo. It’s still happening is probably the answer , are the people doing that replicating their development in production though ?

Docker
Could you elaborate? I rely heavily on systemd (I don't always run applications on containers), so my usually server on the cloud looks like: a go binary running under systemd. I can't easily reproduce that with Docker. Sure, for other kind of applications it works quite well, and as I said before I do make use of Docker as well, although I don't think it can satisfy my needs as "infra" engineer.
Docker (specifically docker-compose) using containers is an implementation detail. It even used to use VMs on Windows.

You can replicate your prod environment locally with Docker Compose, but then deploy however you want (with or without containers, with or without Kubernetes).

I never use containers in production, but exclusively use them for local dev.

With Docker you have the binary running inside something like Alpine Linux. Services (like Database) are connected through a DNS-discovery agent (like Consul) and this whole shebang is managed through something like Nomad.

They are all Hashicorp products, by the way, and kind of the evolution from Vagrant. (Ps: It's also quite of a heavy learning curve to move to such setups).

Yes, I still use vagrant, on pretty much every project I work on - both my own/my companies, and client projects.

I'll give two examples of how I use it:

I (or technically, my company) produce a number of tools for managing various common aspects of a Linux web application stack.

For each tool, there's a regular Vagrant VM setup from the root of the repo, which is used for basic testing, building, running tests etc - essentially this is just to achieve a known state, and to abstract the environment from whatever OS it's running on. Some of the tools either specifically require, or support, 'cluster' mode, where some kind of state or configuration is managed across multiple machines. For these tools, there's an additional multi-machine Vagrantfile (generally just in a subdir) which sets up a mini cluster of 2 or 3 nodes, and allows testing of the sync/replication/what have you.

For a client I work with right now, we again, use it in two ways, achieving two separate goals:

The primary, day to day use, is providing a completely self-contained local dev environment for the webapp. This setup is used for anyone doing dev on the app - backend, frontend, whatever.

The less common, but still very necessary use, is similar to what you mentioned, multi-machine infra testing. The infra for this client is all provisioned using a shell script that works on a system of roles and environments. To test this, the repo with the setup has a vagrant config that matches the production environment.

Additionally, this repo also has a packer config, which builds a custom base box, for the aforementioned "day to day dev" Vagrant env, using the same setup script.

As mentioned by @ocdtrekkie, Vagrant is relatively stable. It'll be interesting to see where 3.0 takes things, but right now it's a pretty reliable tool, that just gets the job done.

Edit: typo (anything -> anyone)

Is this something people use Nix for?
About the point of using a dumb terminal: I tried it with a cheap DO VM, and came to the conclusion that they're woefully underpowered for any serious work compared to the laptop's processor.

The cost to performance wasn't there: just using my laptop for development was cheaper and more performant than renting a VM monthly for cloud development.

For local development I used to use Vagrant, but now I use Docker almost exclusively, primarily because of how fast it starts and stops containers. Also I find the config format easier to work with.

I still use Vagrant in those rare instances when Docker is not viable. Sometimes I really do need full OS instance, or need to run something other than Linux, or I just want normal bridged network interfaces.

I prefer Docker. I believe it’s a better and more convenient abstraction model.

But not all systems are a good fit for Docker. When I need an actual VM, then Vagrant is a godsend.

Addendum: I wouldn’t say that Vagrant is dead. Like paper isn’t dead. Or rulers. Even typewriters aren’t dead.