Open jeromegn opened 4 days ago
Those virtio block errors appear to be unrelated to snapshotting, and are caused by Deno trying to write to the filesystem while the underlying drive is marked as read-only (by the "is_read_only": true
option in your config file). Even though your app may not be accessing the filesystem directly, Deno tries to create its internal cache (at /root/.cache/deno/) and write files in there.
If you want to prevent Deno from trying to write to the filesystem, you can mark the filesystem as read-only at the guest level, e.g. by adding readonly_rootfs=t
(which is a Nanos-specific option) to the kernel command line (i.e. the boot_args
string in the Firecracker config).
I don't know if these logs are important because my app appears to be working properly (though it isn't accessing the filesystem post-snapshot-load).
I haven't seen anybody else report these errors to the firecracker repository so I am assuming it is something specific to
nanos
. I'm happy to make a firecracker issue as well if I am misguided.To reproduce, I believe:
ops
) + start anydeno
app in a firecracker microvmI see these logs before seeing any logs from my app:
Some artifacts:
Firecracker config
```json { "boot-source": { "kernel_image_path": "/home/jerome/.ops/0.1.52/kernel.img", "boot_args": "console=ttyS0 reboot=k panic=1 pci=off random.trust_cpu=on" }, "drives": [ { "drive_id": "rootfs", "path_on_host": "/home/jerome/.ops/images/app", "is_root_device": true, "is_read_only": true } ], "network-interfaces": [ { "iface_id": "eth0", "guest_mac": "AA:FC:00:00:00:01", "host_dev_name": "tap0" } ], "machine-config": { "vcpu_count": 1, "mem_size_mib": 512 }, "balloon": { "amount_mib": 0, "deflate_on_oom": false, "stats_polling_interval_s": 1 }, "logger": { "log_path": "logs.fifo", "level": "Debug" }, "metrics": { "metrics_path": "metrics.fifo" }, "vsock": { "guest_cid": 3, "uds_path": "./v.sock" } } ```Deno
```typescript Deno.serve((_req) => { let mem = Deno.memoryUsage(); console.log(`rss: ${mem.rss}, heap total: ${mem.heapTotal}, heap used: ${mem.heapUsed}, external: ${mem.external}`); return fetch("https://debug.fly.dev") }); ```main.ts
Snapshotting + load
``` sudo curl --unix-socket app/fc.sock -i \ -X PATCH 'http://localhost/vm' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "state": "Paused" }' sudo curl --unix-socket app/fc.sock -i \ -X PUT 'http://localhost/snapshot/create' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "snapshot_type": "Full", "snapshot_path": "./snapshot_file", "mem_file_path": "./mem_file" }' ``` ``` sudo rm fc.sock v.sock; sudo firecracker-v1.10.1-x86_64 --api-sock fc.sock ``` ``` sudo curl --unix-socket app/fc.sock -i \ -X PUT 'http://localhost/snapshot/load' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "snapshot_path": "./snapshot_file", "mem_backend": { "backend_path": "./mem_file", "backend_type": "File" }, "enable_diff_snapshots": true, "resume_vm": true }' ```