-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
option to autoinstall/autoupdate declarative vms #94
Comments
@astro Let me know if you think something like that makes sense? Would work nicely for stateless vms. |
Implements `microvm.autoupdate` boolean option. When enable it automatically commits changes to the vm. Fixes astro#94
Thank you for giving this some thought. The downside of this approach is that a host reboot will roll back a VM that was previously updated with |
Implements `microvm.autoupdate` boolean option. When enable it automatically commits changes to the vm. Fixes astro#94
When using the declarative approach it is not very pleasant to have to run |
I recently added the Actually, the I would like to add that instead of the option we could get some nice automatic behavior here if we were only able to tell which MicroVM config is newer. Everything under the store is 1970-01-01 but maybe we could export the |
Not OP, but I'd suggest
I don't think this is something that should be decided automatically. People that are not using the declarative approach could have microvms with accumulated changes, where it might not be desired to restart them just because the host is deployed with a newer version. I would even go so far as to say that opting in to the declarative approach via
I agree that a different name would've been more meaningful. Currently its description also suggests unconditional restarts on rebuild, which I believe isn't the case (not all services are affected by runner version changes). Maybe But personally I definitely wouldn't see an issue with refactoring something like that, even if it is a breaking change. Especially since it was introduced recently and you don't guarantee any backward compatibility as far as I can tell. If you don't want to add silent breakage for users, there's always |
Thank you for elaborating on the topic. What this really would do is kind of |
Depends on the context. Definitely every reboot, but otherwise not strictly on every |
Tried to implement this but not sure how we could both mark that the install-microvm service is part of microvm-%i (so that it start when microvm-%i starts) but also when it restarts make microvm-%i restart too. |
It's already |
That makes it start when microvm@name start. But it doesn't make microvm@name restart when it (install) has changed. |
Here's a very hacky idea that should get it to work:
|
Currently microvm does not install updates to a vm if the vm already exists in state dir.
To push/deploy the new configuration user would need to delete the old vm or
microvm -u
.Since by default the vms is using tmpfs and all its state is ephemeral I think it would make sense to add a
autoupdate
orautoinstall
option that does the install and overwrites the vm on change.This is prevented by
ConditionPathExists
microvm.nix/nixos-modules/host.nix
Line 117 in d578ed4
The text was updated successfully, but these errors were encountered: