Skip to content
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

VM Supervisor #198

Open
4 tasks
jmickey opened this issue Nov 3, 2021 · 11 comments
Open
4 tasks

VM Supervisor #198

jmickey opened this issue Nov 3, 2021 · 11 comments
Labels
adr-required Indicates that the issue or PR contains a decision that needs to be documented in a ADR area/firecracker Indicates an issue or PR related to Firecracker area/reconciliation Indicates an issue or PR related to reconciliation Epic kind/feature New feature or request lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@jmickey
Copy link
Contributor

jmickey commented Nov 3, 2021

The Supervisor will be responsible for monitoring running MicroVMs and react to changes that drift from the desired state.

Why do we need this?

We don't currently continuously monitor the state of running VMs. If a VM drifts away from its desired state - e.g. A VM crashes and is in a failed state - we need to wait until the next time the reconciler runs for the VM to be recreated/restarted.

Additionally, we don't currently track if a VM is continuously failing. Flintlock will continue to recreate the VM every time a resync occurs. The reconciler doesn't know if a VM has already been started, as far as it is concerned it only cares about reconciling the existing state to the desired state.

What do we need

  • The VM Supervisor should exist as a background process/goroutine.
  • As firecracker does not have a background daemon or event system, the supervisor will need to have knowledge of the VMs that should/do exist and their desired state, and should continuously (on a short timer) check the status of each VM.
  • The supervisor should probably utilise the containerd state to store events (e.g. VM stopped, VM started, VM restarted X times, etc), and the event bus to notify the reconciler to take action outside the delayed reconciler resync loop.

How this looks on an implementation level is unknown, and it's likely one or more ADRs will need to be produced as a result.

Subtasks

  • Create supervisor that starts when flintlockd is started, detect and continuously list all VMs and their state directly from Firecracker.
  • Extend MicroVM model to track microvm events - started, stopped, reboots, etc.
  • Detect when VMs are in a failed state and trigger an event on the event bus to reconcile the VM state
  • Track number of failures/restarts and emit metrics.
@jmickey jmickey added Epic adr-required Indicates that the issue or PR contains a decision that needs to be documented in a ADR area/firecracker Indicates an issue or PR related to Firecracker area/reconciliation Indicates an issue or PR related to reconciliation kind/feature New feature or request labels Nov 3, 2021
@richardcase
Copy link
Member

I don't think the supervisor itself will store events......just raise them. And it probably shouldn't make any modifications to the microvm spec....so its a read-only consumer of the specs. wdyt?

@jmickey
Copy link
Contributor Author

jmickey commented Nov 4, 2021

@richardcase The usage of Events here might be a little overloaded. By "Events" I am more referring to a running kind of log I guess? Similar to the events that are shown when you kubectl describe a resource. An "event" in this case might be that the supervisor has detected that a previously running VM is no longer running, if that makes sense?

Maybe that is actually part of the reconciler, wdyt?

I don't think the supervisor should make changes to the spec, but maybe the status? Again, maybe I didn't think it through enough and it actually belongs in the reconciler.

@jmickey
Copy link
Contributor Author

jmickey commented Nov 4, 2021

Actually, maybe you're right. It should probably be the reconciler that updates if a VM has been started, how many times it's been restarted, etc. Then it can also control the back-off if we choose to implement one in the future.

e.g. It can mark the VM as CrashLoopBackOff (I couldn't think of a better name so I just went with the Kubernetes vernacular) and create a gradually increasing ticker to retry?

@richardcase
Copy link
Member

As part of the implementation, we need to revisit the sleep introduced in #255....and hopefully remove the need for it.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 60 days with no activity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 17, 2022
@richardcase
Copy link
Member

This is still required

@Callisto13 Callisto13 removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 23, 2022
@Callisto13
Copy link
Member

Would be good to have this soon. I just started flintlock on a machine which I apparently did not clean up and have rebooted a couple of times since I last did LM, and flintlock is like "woah look how many mvms I have" and I am like "bruh, there are no firecracker processes running".

@richardcase
Copy link
Member

We should also look at this again: https://github.com/asynkron/protoactor-go

@github-actions
Copy link
Contributor

This issue is stale because it has been open 60 days with no activity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 19, 2023
Copy link
Contributor

This issue was closed because it has been stalled for 365 days with no activity.

@github-actions github-actions bot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label May 18, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Closed in Liquid Metal Roadmap - Public May 18, 2024
@richardcase richardcase reopened this Jul 10, 2024
@richardcase richardcase removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Jul 10, 2024
Copy link
Contributor

github-actions bot commented Jan 8, 2025

This issue is stale because it has been open 180 days with no activity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adr-required Indicates that the issue or PR contains a decision that needs to be documented in a ADR area/firecracker Indicates an issue or PR related to Firecracker area/reconciliation Indicates an issue or PR related to reconciliation Epic kind/feature New feature or request lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
No open projects
Status: Closed
Development

No branches or pull requests

3 participants