liquidmetal-dev / flintlock

Lock, Stock, and Two Smoking MicroVMs. Create and manage the lifecycle of MicroVMs backed by containerd.
Mozilla Public License 2.0
485 stars 30 forks source link

Resource cleanup ADR #90

Open richardcase opened 2 years ago

richardcase commented 2 years ago

We need to decide how we handle unused images, network interfaces.

When a microvm is deleted the snapshots will be deleted. This may leave a container image unused. What should we do with these unused images? A couple of options:

  1. Do nothing
  2. Delete them after X days
  3. Delete them as soon as they become unused.
richardcase commented 2 years ago

With the delete being implemented in #144 having unused images is more likely.

yitsushi commented 2 years ago

I think creating a command like flintlock cleanup, we can add flags --no-images, --no-snapshots, and --no-something-else and let Ops set up how and when the command is executed. That way they can hook up in a cronjob, or ansible/puppet run,or basically anything they want. The main benefit from the ops side, they can easily enable, disable, or change when and what to clean up. Like do cleanup on x1, y1, and z1 daily, do x2 and y2 right after backup is done, and run x3 on every Monday midnight.

richardcase commented 2 years ago

I like the idea of providing the command as well and leaving it up to the user to schedule its execution.

richardcase commented 2 years ago

Another option is a maintenance api

github-actions[bot] commented 2 years ago

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

LutzLange commented 2 years ago

How about an option in the capi object that selects how cleanup as handled? This could end up in the miroVM details and thus mark how quickly cleanup should happen.

yitsushi commented 2 years ago

I think the issue with the cleanup in the microvm detail, we need cleanup from leftovers, things we couldn't/didn't delete after vm was deleted, like a snapshot. At that point, we don't have the vmspec anymore only leftover garbage on the system. So it's more like a "garbage collector" rather than a "clean up".

(or i misunderstood the microvm details part)

github-actions[bot] commented 1 year ago

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

yitsushi commented 1 year ago

Still valid.

github-actions[bot] commented 2 months ago

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