qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [SPDK] How to setup a QEMU system disk by using SPDK?


From: Wodkowski, PawelX
Subject: Re: [Qemu-block] [SPDK] How to setup a QEMU system disk by using SPDK?
Date: Wed, 6 Jun 2018 11:36:35 +0000

You can use SPDK nbd to expose lvol and write it while vhost is running. Then just stop exported nbd and pass lvol to qemu.

 

Pawel

 

From: SPDK [mailto:address@hidden On Behalf Of Bob Chen
Sent: Wednesday, June 6, 2018 12:28 PM
To: Wang, ChenX <address@hidden>
Cc: Storage Performance Development Kit <address@hidden>; qemu block <address@hidden>
Subject: Re: [SPDK] How to setup a QEMU system disk by using SPDK?

 

 

2018-06-06 16:40 GMT+08:00 Wang, ChenX <address@hidden>:

Hi,  Bob

 

I have try to boot the os by QEMU UEFI, but failed, following is my qemu command:

. /qemu-system-x86_64 -smbios type=0,uefi=on -smp 8 -m 1024 -net user,hostfwd=tcp::10020-:22 \

-net nic -chardev socket,id=char0,path=vhost.0 -device vhost-user-blk-pci,chardev=char0,num-queues=4,bootindex=0  --enable-kvm

 

Would you be willing to share your commands and some tips for QEMU UEFI? Thanks so much. J

 

I was using the edk2-ovmf UEFI, https://github.com/tianocore/edk2. You may download the nightly build RPMs from https://www.kraxel.org/repos/jenkins/edk2/

Add a pflash drive to qemu's command-line, looks like:

 

-drive file=OVMF_CODE-pure-efi.fd,format=raw,if=pflash \

-m 4G -object memory-backend-file,id=mem0,size=4G,mem-path=/dev/hugepages,share=on -numa node,memdev=mem0 \

-chardev socket,id=spdk_vhost_scsi0,path=/var/tmp/vhost.0 \

-device vhost-user-scsi-pci,id=scsi0,chardev=spdk_vhost_scsi0,num_queues=4

 

However you still don't have a correct SPDK volume by far. Because most of the images you could download from the Internet are built on traditional BIOS boot-loader, thus cannot be directly copied. What I did is having the guest OS reinstalled from its attaching live CD-ROM.

 

Regarding to the import/export functionality, I think another app is needed to read/write lvol while interacting with vhost app simultaneously. Like qemu itself a little bit.

Perhaps someone could integrate it into the qemu-img command?

 

 

Thanks,

Chen

 

From: SPDK [mailto:address@hidden] On Behalf Of Harris, James R
Sent: Wednesday, June 6, 2018 2:14 AM
To: Bob Chen <address@hidden>; Storage Performance Development Kit <address@hidden>; Cao, Gang <address@hidden>; qemu block <address@hidden>
Subject: Re: [SPDK] How to setup a QEMU system disk by using SPDK?

 

 

 

From: Bob Chen <address@hidden>
Date: Monday, June 4, 2018 at 10:47 PM
To: Storage Performance Development Kit <address@hidden>, "Cao, Gang" <address@hidden>, James Harris <address@hidden>, qemu block <address@hidden>
Subject: Re: [SPDK] How to setup a QEMU system disk by using SPDK?

 

 

[…]

 


I suspect this is because all SPDK logical volumes are exposed with 4KB logical block size.  IIRC, Seabios legacy boot doesn’t support 4KB logical block devices.  UEFI boot should work but we don’t have automated tests set up for that yet.

 

I will have a try for UEFI boot-loader. 

 


I think SPDK logical volumes could be exposed with 512 byte logical block size, if the underlying block device has a 512 byte logical block size.  Using 4KB LBA simplified the implementation a bit and all metadata has to use 4KB for atomicity.  But talking with Ben we don’t see any reason 512 byte for read/write/unmap operations wouldn’t work.  We may have to use feature bits though so that this change in behavior only applies to newly created logical volumes.

Bob – I’m curious if you can boot your VM with the SPDK logical volume as a secondary disk?

 

 Yes, we could. Although we were able to see the device in the VM, that disk with the guest OS inside still couldn't be mounted. Seemed like read-only or corrupted.

 

Because SPDK by far does not provide a method to import or export volume metadata to a external file, we came up with this thought and managed to copy data by `dd` and nbd. Not very straight forward...

 

 

Good news, UEFI works! Now Qemu can boot on the SPDK system disk successfully.

 

What we are expecting next is a more portable way to import/export volume.

 

 

Thanks for the update!  Would you be willing to add a section to the SPDK vhost doc (doc/vhost.md) with some tips for QEMU UEFI boot?

 

Regarding import/export – what kind of method do you have in mind?  I agree that a more straight forward method is warranted.

 

-Jim

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]