Store VM metadata as JSON
This commit is contained in:
parent
bbd57d8dd2
commit
7af04b7535
11 changed files with 188 additions and 178 deletions
21
README.md
21
README.md
|
|
@ -4,7 +4,7 @@ Minimal Firecracker launcher.
|
|||
|
||||
## Requirements
|
||||
- Linux host with KVM (`/dev/kvm` access)
|
||||
- `sudo`, `ip`, `curl`, `ssh`
|
||||
- `sudo`, `ip`, `curl`, `ssh`, `jq`
|
||||
- `dmsetup`, `losetup`, `blockdev` (device-mapper snapshot for rootfs)
|
||||
- `e2cp`, `e2rm` (writes hostname and resolv.conf into rootfs snapshot)
|
||||
|
||||
|
|
@ -63,22 +63,9 @@ reboot
|
|||
```
|
||||
|
||||
## VM Info File
|
||||
Each VM writes a metadata file at `state/vms/<id>/info` with the following fields:
|
||||
- `id`: unique identifier for the VM instance.
|
||||
- `name`: VM name.
|
||||
- `pid`: Firecracker process ID.
|
||||
- `created_at`: timestamp when the VM was launched.
|
||||
- `rootfs`: root filesystem image path used to launch the VM.
|
||||
- `kernel`: kernel image path used to launch the VM.
|
||||
- `guest_ip`: IP address assigned to the guest.
|
||||
- `tap`: host TAP interface name attached to the bridge.
|
||||
- `api_sock`: path to the Firecracker API socket (stored under `$XDG_RUNTIME_DIR/banger/` when available).
|
||||
- `log`: path to the Firecracker log file.
|
||||
- `base_loop`: loop device backing the base rootfs (if present).
|
||||
- `cow_file`: copy-on-write image file (if present).
|
||||
- `cow_loop`: loop device for the COW image (if present).
|
||||
- `dm_name`: device-mapper name for the merged rootfs (if present).
|
||||
- `dm_dev`: device-mapper device path for the merged rootfs (if present).
|
||||
Each VM writes `state/vms/<id>/vm.json` with:
|
||||
- `meta`: local metadata (id, name, pid, created_at, guest_ip, tap, api_sock, log, rootfs, kernel, snapshot info).
|
||||
- `config`: full `/vm/config` response from Firecracker.
|
||||
|
||||
## Log Notes
|
||||
- `PCI: Fatal: No config space access function found` and `MissingAddressRange` lines are expected with `pci=off` in `run.sh`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue