Hacker News new | ask | show | jobs
by edwintorok 4732 days ago
It has some features to deploy to a cluster as well: http://nixos.org/disnix/

And I find its 'nixos-rebuild build-vm' command quite handy to test changes.

On the other hand immutability of the OS image doesn't mean you can easily roll-back after an upgrade, especially if you've been running the new version for a while, because you might still have mutable state (see below).

Sure if you store all your configuration in Nix, then it is possible to rebuild the old configuration as it was, but your mutable state is not managed by Nix.

One such example is database files. You've upgraded to the new configuration, and perhaps even had a script to auto-upgrade from your old schema. Now you want to go back: what should happen to the database? Should it be entirely rolled back (from backups) to an old snapshot? But then you loose all the new data. Should you roll-back the schema change? Again what happens to the new data that doesn't fit the old schema?

Another example of mutable state is remote nodes that you depend on for a particular service. You can roll back your local machine to an old version, but will it still be able to talk to your new remote nodes?

It seems that the only way to handle this is to make sure you are always at least 1 major version backwards compatible, so you can freely upgrade/roll-back machine that are part of a cluster.

1 comments

Apparently there is also NixOps for network/cluster deployment: http://hydra.nixos.org/build/5426864/download/1/manual/manua...