firecracker-microvm / firecracker-microvm/firecracker
[Snaps] Drive mounts for block device disk paths during snapshot loading
- Dominant language
- Rust
- Stars
- 36.7k
- Forks
- 2.6k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 53
Description
# Feature Request
I am hacking on firecracker-containerd to support firecracker snapshots, and I am facing the following problems:
Firstly, the addVsocksHandler expectedly fails with the following error:
```console
WARN[2023-08-08T06:28:05.886174648-04:00] Failed handler "fcinit.AddVsocks": [PUT /vsock][400] putGuestVsockBadRequest &{FaultMessage:The requested operation is not supported after starting the microVM.} runtime=aws.firecracker
```
If I comment this handler out, everything works okay and firecracker-containerd is able to connect to the agent. Seems like this handler is redundant, and should be simply removed (I can bring a patch to firecracker-go-sdk).
Secondly, I am trying to figure out a way to restore the disk backing files. The problem I am facing is that container image snapshot device paths are not deterministic (their assignment depend on the containerd snapshotter implementation). To overcome this, I tried to use the [drive mounts](https://github.com/firecracker-microvm/firecracker-containerd/blob/main/docs/drive-mounts-proposal.md) feature of firecracker-containerd and mount the container snapshot device for the the snapshot reloaded VM to the path that the original device had, but it doesn’t work, since drives cannot be configured[^1] for snapshot booted VMs.
## Describe the desired solution
Do you have any ideas as to how it would be possible to develop the approach with drive mounts?
## Describe possible alternatives
Right now I am manually patching the block device path corresponding to container snapshot during micro VM state to a path provided from the LoadSnapshot request (which is obviously unfavorable).
## Checks
- [x] Have you searched the Firecracker Issues database for similar requests?
- [x] Have you read all the existing relevant Firecracker documentation?
- [x] Have you read and understood Firecracker's core tenets?
[^1]: https://github.com/firecracker-microvm/firecracker/blob/807bd5a3ce949121f06234bf6308de33c14eb9ce/src/api_server/swagger/firecracker.yaml#L598-L599
Contributor guide
Assessment
This issue has not been assessed yet.