Skip to content

[FAQ] need help on virtio-blk talk to spdk vhost #5580

@gaowayne

Description

@gaowayne

hello dear expert.

I suffer below error when I try start VM with spdk vhost to service virtio-blk

root@smc-hs219-01-salab:/mnt/nvme7n1/wayne/firecracker/firecracker/build/cargo_target/release/images# sh start-with-vhost.sh 
net.ipv4.ip_forward = 1
2025-12-12T06:25:31.546104303 [anonymous-instance:main] Running Firecracker v1.15.0-dev
2025-12-12T06:25:31.546442126 [anonymous-instance:main] Listening on API socket ("/tmp/firecracker.socket").
2025-12-12T06:25:31.547421624 [anonymous-instance:fc_api] API server started.
2025-12-12T06:25:33.561517587 [anonymous-instance:fc_api] The API server received a Put request on "/boot-source" with body "{\n  \"kernel_image_path\": \"./vmlinux-6.1.141\",\n  \"boot_args\": \"console=ttyS0 reboot=k panic=1 pci=off ip=172.16.0.2::172.16.0.1:255.255.255.252::eth0:none nameserver=8.8.8.8\"\n}".
2025-12-12T06:25:33.561777963 [anonymous-instance:fc_api] The request was executed successfully. Status code: 204 No Content.
2025-12-12T06:25:33.578004937 [anonymous-instance:fc_api] The API server received a Put request on "/drives/rootfs" with body "{\n  \"drive_id\": \"rootfs\",\n  \"path_on_host\": \"./ubuntu-24.04.ext4\",\n  \"is_root_device\": true,\n  \"is_read_only\": false\n}".
2025-12-12T06:25:33.578632494 [anonymous-instance:fc_api] The request was executed successfully. Status code: 204 No Content.
2025-12-12T06:25:33.594963186 [anonymous-instance:fc_api] The API server received a Put request on "/drives/vhost_blk0" with body "{\n  \"drive_id\": \"vhost_blk0\",\n  \"socket\": \"/mnt/nvme7n1/wayne/firecracker/spdk/vhost_blk0\",\n  \"is_root_device\": false,\n  \"is_read_only\": false\n}".
2025-12-12T06:25:33.595238546 [anonymous-instance:fc_api] Received Error. Status code: 400 Bad Request. Message: Drive config error: Unable to create the virtio block device: Invalid block config.
{"fault_message":"Drive config error: Unable to create the virtio block device: Invalid block config."}2025-12-12T06:25:33.611499796 [anonymous-instance:fc_api] The API server received a Put request on "/network-interfaces/net1" with body "{\n  \"iface_id\": \"net1\",\n  \"guest_mac\": \"06:00:AC:10:00:02\",\n  \"host_dev_name\": \"tap0\"\n}".
2025-12-12T06:25:33.612504472 [anonymous-instance:fc_api] The request was executed successfully. Status code: 204 No Content.
2025-12-12T06:25:33.628371882 [anonymous-instance:fc_api] The API server received a Put request on "/actions" with body "{\"action_type\": \"InstanceStart\"}".
2025-12-12T06:25:33.671234854 [anonymous-instance:main] Artificially kick devices
2025-12-12T06:25:33.671512134 [anonymous-instance:fc_vcpu 0] Received a VcpuEvent::Resume message with immediate_exit enabled. immediate_exit was disabled before proceeding
2025-12-12T06:25:33.671712787 [anonymous-instance:fc_api] The request was executed successfully. Status code: 204 No Content.

here is request I sent

# API 配置(静态 IP boot_args)
curl -s --unix-socket "${API_SOCKET}" -X PUT "http://localhost/boot-source" -H "Content-Type: application/json" -d '{
  "kernel_image_path": "./vmlinux-6.1.141",
  "boot_args": "console=ttyS0 reboot=k panic=1 pci=off ip=172.16.0.2::172.16.0.1:255.255.255.252::eth0:none nameserver=8.8.8.8"
}'
curl -s --unix-socket "${API_SOCKET}" -X PUT "http://localhost/drives/rootfs" -H "Content-Type: application/json" -d '{
  "drive_id": "rootfs",
  "path_on_host": "./ubuntu-24.04.ext4",
  "is_root_device": true,
  "is_read_only": false
}'
curl -s --unix-socket "${API_SOCKET}" -X PUT "http://localhost/drives/vhost_blk0" -H "Content-Type: application/json" -d '{
  "drive_id": "vhost_blk0",
  "socket": "/mnt/nvme7n1/wayne/firecracker/spdk/vhost_blk0",
  "is_root_device": false,
  "is_read_only": false
}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions