oxidecomputer / propolis

VMM userspace for illumos bhyve
Mozilla Public License 2.0
180 stars 22 forks source link

Propolis panics with requests for VMs with small amounts of guest memory #109

Open bnaecker opened 2 years ago

bnaecker commented 2 years ago

I've been running some experiments using the new Oxide CLI, mostly to test behaviors in Nexus. At some point, I got lazy and started creating requests with small amounts of guest memory. If one requests a VM with 1MiB of memory, Propolis panics. Below is the server's log file:

bnaecker@feldspar : ~/omicron $ pfexec tail -f $(pfexec svcs -z oxz_propolis-server_1254f5f1-7ed6-449f-8ab3-b1ee3a006c6d -L propolis-server)
Mar 30 17:23:12.283 INFO Starting server...
Mar 30 17:23:12.454 INFO accepted connection, remote_addr: 192.168.1.145:62667, local_addr: 192.168.1.216:12400
Mar 30 17:23:12.454 INFO request completed, error_message_external: Internal Server Error, error_message_internal: Server not initialized (no instance), response_code: 500, uri: /instances/00000000-0000-0000-0000-000000000000, method: GET, req_id: a47f8763-7025-48f8-9322-72436d3d0462, remote_addr: 192.168.1.145:62667, local_addr: 192.168.1.216:12400
thread 'tokio-runtime-worker' panicked at 'assertion failed: lowmem >= MEM_BASE', propolis/src/hw/bhyve/rtc.rs:49:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It seems like Propolis should provide some minimal amount of verification of the requested guest memory sizes, and return a 400-level error where those expectations are violated. Currently, this returns a 500, with no further details. I have in fact never seen any error other than a 500 from Propolis server, which makes sense I think looking at how the client handles errors.

smklein commented 2 years ago

Followed-up on this a bit in the Hypervisor sync:

So, although Propolis should definitely consider imposing minimum sizes, the "byte granularity" responsibility is now up to Omicron to propagate.