-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add 'InstanceForceStop' action to forcefully stop all VCPUs #1534
Conversation
In the case that the guest kernel is either non-cooperative (i.e. does not shut down when Ctrl-Alt-Delete is sent), or hangs and does not respond, it's convenient to be able to forcefully stop a microVM. The newly-added 'InstanceForceStop' action accomplishes this by telling all VCPUs in the microVM to exit, building off the work done in firecracker-microvm#1414. Signed-off-by: Andrew Dunham <[email protected]>
Signed-off-by: Andrew Dunham <[email protected]>
Signed-off-by: Andrew Dunham <[email protected]>
Signed-off-by: Andrew Dunham <[email protected]>
Signed-off-by: Andrew Dunham <[email protected]>
It looks like the integration tests are failing with a code coverage error:
I would appreciate advice on how to test the new code - do the python-based integration tests not count towards code coverage? |
@andrew-d the code you added looks good, but I don't see a clear usecase for it. The idea for the From a use-case point of view, the functionality added by this PR is no different than simply |
@acatangiu - Hello, and thank you for taking a look! I asked #1370 a while back about how to force-stop a Firecracker VM, and was told that I'm happy to look into the KVM side further, if you have any pointers? The other minor use-case is that it's possible to grant access to an unprivileged client to call |
Killing the Firecracker process will not leak any host resources, kvm or otherwise. The problem with
Looking into KVM further regarding what exactly? |
Good to know - thank you!
Yep, I would expect this to be true if I ever had to kill a Firecracker VM.
Does Firecracker guarantee that buffers are written to disk in the same order as the guest submits them? Ignoring Firecracker's buffers for a second: if the guest is using a journaling filesystem, then killing the VM while it's running is the same as a power loss event, and as long as the guest code properly uses However, if Firecracker does not guarantee that it writes its' internal buffers to disk in order, then using
Ah, sorry - I meant "if you didn't know off the top of your head whether there'd be a leak". |
I think the API you propose would help in such a case. Let us think on it for a couple of days. |
@andrew-d We've had a quick look at the code and our findings are that For the For For now, the extra API proposed in this PR doesn't bring any value. We should revisit this if/when we start looking at |
Thank you very much for investigating this - it's greatly appreciated! Given the results, agreed that this change is unnecessary; thank you for your time. |
Reason for This PR
In the case that the guest kernel is either non-cooperative (i.e. does not shut down when Ctrl-Alt-Delete is sent), or hangs and does not respond, it's convenient to be able to forcefully stop a microVM.
Description of Changes
Building off the work done in #1414, I simply wired through use of
VcpuEvent::Exit
.Feedback is appreciated - this is my first time contributing to Firecracker!
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.
PR Checklist
[Reviewer TODO: Verify that these criteria are met. Request changes if not]
git commit -s
).clearly provided.
doc changes are included in this PR. Docs in scope are all
*.md
fileslocated either in the repository root, or in the
docs/
directory.code is included in this PR.
reflected in
firecracker/swagger.yaml
.this PR have user impact and have been added to the
CHANGELOG.md
file.unsafe
code has been added, or, the newly addedunsafe
code is unavoidable and properly documented.