Commit ed9bc32
fix: resolve CPIO initrd migration issues for ephemeral MicroVMs
This commit fixes multiple critical issues that prevented ephemeral
MicroVMs from working after migrating from block device rootfs to
CPIO initrd:
1. **Firecracker Config Schema Compliance**
- Added empty `drives` array to VM config (ephemeral_microvm.rs:303)
- Firecracker v1.6.0 requires this field even for initrd-only boot
- Fixes: "missing field `drives`" JSON parse error
2. **Logger Configuration**
- Disabled logger for ephemeral VMs (ephemeral_microvm.rs:314)
- Prevents "Failed to open target file" errors
- Ephemeral VMs don't need persistent logs
3. **Build Script Path Resolution**
- Fixed PROJECT_ROOT calculation in build-guest-rootfs.sh:8
- Changed from `$SCRIPT_DIR/..` to `$SCRIPT_DIR/../..`
- Allows script to correctly locate guest/mcp_vsock_wrapper
- Fixes: "No such file or directory" build errors
4. **Vsock Port Mismatch**
- Changed VSOCK_TOOL_PORT from 5353 to 5252 (ephemeral_microvm.rs:33)
- Now matches the port used by guest/mcp_vsock_wrapper
- Fixes connection timeout between host and guest
5. **VM Boot Timeouts**
- Increased VM ready timeout: 10s → 30s (ephemeral_microvm.rs:322)
- Increased vsock connection timeout: 5s → 15s (ephemeral_microvm.rs:358)
- Gives CPIO initrd more time to extract and start services
**Testing:**
- Guest rootfs builds successfully (199MB CPIO archive)
- Firecracker VM starts without JSON config errors
- VM boots and loads initrd correctly
- Port numbers aligned between host and guest
**Known Issue:**
Vsock connection still times out, likely due to kernel vsock driver
not being available in the pre-built kernel. This requires further
investigation with VM console access.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 4e9855b commit ed9bc32
File tree
2 files changed
+7
-13
lines changed- scripts/build
- src/services
2 files changed
+7
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| 303 | + | |
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
| |||
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 314 | + | |
321 | 315 | | |
322 | 316 | | |
323 | 317 | | |
324 | 318 | | |
325 | 319 | | |
326 | 320 | | |
327 | 321 | | |
328 | | - | |
| 322 | + | |
329 | 323 | | |
330 | 324 | | |
331 | 325 | | |
| |||
361 | 355 | | |
362 | 356 | | |
363 | 357 | | |
364 | | - | |
| 358 | + | |
365 | 359 | | |
366 | 360 | | |
367 | 361 | | |
| |||
0 commit comments