Use hostname-safe VM names

This commit is contained in:
Thales Maciel 2026-01-30 12:13:35 -03:00
parent 306412c995
commit bbd57d8dd2
No known key found for this signature in database
GPG key ID: 33112E6833C34679
3 changed files with 110 additions and 11 deletions

View file

@ -5,6 +5,8 @@ Minimal Firecracker launcher.
## Requirements
- Linux host with KVM (`/dev/kvm` access)
- `sudo`, `ip`, `curl`, `ssh`
- `dmsetup`, `losetup`, `blockdev` (device-mapper snapshot for rootfs)
- `e2cp`, `e2rm` (writes hostname and resolv.conf into rootfs snapshot)
## Files
- `firecracker`: Firecracker binary
@ -21,17 +23,19 @@ Minimal Firecracker launcher.
```
./run.sh --name calm_otter --vcpu 4 --ram 2048 --home-size 6G
```
- `--name`: must be unique and match `[a-z0-9][a-z0-9_-]{0,63}`.
- `--name`: must be unique and match `[a-z0-9][a-z0-9-]{0,63}`.
- `--vcpu`: defaults to 2, max 16.
- `--ram`: MiB, defaults to 1024, max 32768.
- `--rootfs`: path to the base rootfs image (default: `./rootfs.ext4`).
- `--kernel`: path to the kernel image (default: `./vmlinux`).
- `--home-size`: M/G suffixes supported (default: 2G).
- `--var-size`: M/G suffixes supported (default: 2G).
## Storage Layout
- `rootfs.ext4` is mounted read-only as `/` and shared across VMs.
- Each VM gets a writable ext4 disk mounted at `/home`.
- The base image must include an `/etc/fstab` entry for `/dev/vdb``/home`.
- `rootfs.ext4` is used as the read-only origin for a per-VM device-mapper snapshot mounted as `/`.
- Each VM gets writable ext4 disks mounted at `/home` and `/var`.
- The base image must include `/etc/fstab` entries for `/dev/vdb``/home` and `/dev/vdc``/var`.
- `/run` and `/tmp` should be tmpfs via `/etc/fstab`.
## SSH
```