-
Notifications
You must be signed in to change notification settings - Fork 126
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
Implement PauseVM, ResumeVM, and CreateSnapshot #278
Implement PauseVM, ResumeVM, and CreateSnapshot #278
Conversation
Signed-off-by: Plamen Petrov <[email protected]>
Signed-off-by: Plamen Petrov <[email protected]>
client/swagger.yaml
Outdated
@@ -398,6 +398,56 @@ paths: | |||
description: Internal server error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about copying https://github.com/firecracker-microvm/firecracker/blob/v0.23.0/src/api_server/swagger/firecracker.yaml as is? Would it bring other unneeded changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left out the parts relevant to snapshot load and tracking dirty pages. I was not going to include snapshot load support yet as per our discussion so I decided to leave the relevant API definitions altogether. That being said, copying as-is would not interfere in any way. It is perhaps best to copy as-is so that the swagger file does not need to be updated for version 0.23.0 of the SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It is hard to track what we've copied and what we've left out. Tracking tasks can be done in GitHub issues or somewhere else, rather than this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have copied over the swagger file from firecracker v0.23.0 and updated the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @plamenmpetrov for submitting this change. The changes look good with some minor nit comments. Also, these changes need integration tests. Once those are added, this can be merged.
machine.go
Outdated
return nil | ||
} | ||
|
||
// CreateSnapshot Creates a snapshot of the VM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: CreateSnapshot Creates a snapshot of the VM
-> CreateSnapshot creates a snapshot of the VM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
machine.go
Outdated
return nil | ||
} | ||
|
||
// ResumeVM Resumes the VM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Resumes
-> resumes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
machine.go
Outdated
@@ -1002,3 +1002,50 @@ func (m *Machine) setupSignals() { | |||
close(sigchan) | |||
}() | |||
} | |||
|
|||
// PauseVM Pauses the VM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Pauses
-> pauses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Signed-off-by: Plamen Petrov <[email protected]>
Signed-off-by: Plamen Petrov <[email protected]>
60efd3d
to
b86c07b
Compare
Hello @xibz , I have added preliminary tests for pause, resume and create snapshot, which seem to pass in the build. I also updated the firecracker version used in tests to 0.23.0. However, TestNetworkMachineCNIWithConfFile times out. In my understanding, this should not be related to pause, resume, or create snapshot. Perhaps it is caused by another change in firecracker 0.23.0? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, this looks great! Thank you again for this contribution and updating this to have tests. I reran the tests and they passed. Something upstream must've been broken at the time it was ran
Hello, Firecracker 0.23.0 adds new API calls for managing snapshots of a microVM and changing the microVM state. The goal of this PR is to port the PauseVM, ResumeVM, and CreateSnapshot calls to the SDK.
Issue #, if available:
#239
Description of changes
We have not added tests to the PR yet. We are open to feedback on what tests we should add and any other comments in general. We would be glad to finalize and contribute this code.
Authored by @plamenmpetrov and @ustiugov
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.