跳至正文
Wener Notes

QEMU Storage & Block Devices

约 1 分钟阅读
标签:虚拟化QEMUStorageiSCSINBD

Operations

bash
# Convert Image
qemu-img convert -f parallels original.hds -O raw converted.raw

iSCSI

bash
# Connect to iSCSI target
qemu-system-x86_64 -iscsi initiator-name=iqn.2001-04.com.example:my-initiator \
  -cdrom iscsi://192.0.2.1/iqn.2001-04.com.example/2 \
  -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1

NBD (Network Block Device)

bash
# Create image
qemu-img create test -F qcow2 test.qcow2

# Export via QEMU Storage Daemon
qemu-storage-daemon \
  --blockdev driver=qcow2,node-name=test,file.filename=test.qcow2,file.locking=off,file.driver=file \
  --nbd-server addr.type=inet,addr.host=0.0.0.0,addr.port=6789 \
  --export nbd,device=test

# Export via qemu-nbd (default port 10809)
qemu-nbd -f qcow2 file.qcow2

NBD Server Options

bash
--nbd-server addr.type=inet,addr.host=<host>,addr.port=<port>
# Optional TLS
# [,tls-creds=<id>][,tls-authz=<id>]

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub1 条
Wikipedia1 条
其他外链3 条
最近更新commit 906e816编辑