Jump to content
XPEnology Community

qemu-based Xpenology: how to use qemu-emulated NVME SSD as cache?


everwisher

Recommended Posts

In Proxmox, I emulated a nvme-disk and passed it through to a DSM guest using the following qemu option:

  -drive 'file=/dev/mapper/pve-vm--201--disk--1,if=none,id=nvm' \
  -device 'nvme,serial=deadbeef,drive=nvm'

After starting the DSM guest, disk /dev/nvme0n1 can be seen using this command:

sudo udevadm info /dev/nvme0n1

The following information was printed:

Quote

Disk /dev/nvme0n1: 256 GiB, 274877906944 bytes, 536870912 sectors
Disk model: QEMU NVMe Ctrl                          
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

P: /devices/pci0000:00/0000:00:03.0/nvme/nvme0/nvme0n1
N: nvme0n1
E: DEVNAME=/dev/nvme0n1
E: DEVPATH=/devices/pci0000:00/0000:00:03.0/nvme/nvme0/nvme0n1
E: DEVTYPE=disk
E: MAJOR=259
E: MINOR=0
E: PHYSDEVBUS=pci
E: PHYSDEVDRIVER=nvme
E: PHYSDEVPATH=/devices/pci0000:00/0000:00:03.0
E: SUBSYSTEM=block
E: SYNO_ATTR_SERIAL=deadbeef
E: SYNO_DEV_DISKPORTTYPE=UNKNOWN
E: SYNO_INFO_PLATFORM_NAME=apollolake
E: SYNO_KERNEL_VERSION=4.4
E: SYNO_SUPPORT_XA=no
E: TAGS=:systemd:
E: USEC_INITIALIZED=366408

Then I modified the `/lib64/libsynonvme.so.1` file using a HEX editor in Visual Studio Code, changing the DS918+ NVME address from 0000:00:13.0 and 0000:00:13:1 to 0000:00:03.0 and 0000:00:03:1 respectively.

 

However, when I rebooted DSM, no nvme ssd appears in the Storage Manager.

 

Anyone with any clue about resolving this?

Link to comment
Share on other sites

you might be over complicate things, just create  virtual volume on the nvme in knm and declare it a (sata) ssd for the xpenology vm

it would be even possible to have one real nvme, create two virtual ssd's and use it as write capable cache (kind of defeats the intention syno had but as long as you keep that in mind ...)

Link to comment
Share on other sites

1 hour ago, IG-88 said:

you might be over complicate things, just create  virtual volume on the nvme in knm and declare it a (sata) ssd for the xpenology vm

it would be even possible to have one real nvme, create two virtual ssd's and use it as write capable cache (kind of defeats the intention syno had but as long as you keep that in mind ...)

There are some premises here:

1. I have 3 ssds of different capacities, i.e. 250G, 512G, and 800G, and I borrowed the idea from Synology SHR, splitting the 512G and 800G into segments of 250G, and made two raid0 arrays, with the rest part from 800G ssd for host's use. The software raid0 partitions are grouped into virtual group and then used as logical volumes. This configuration has been running for quite a while and I cannot take it apart to passthrough an nvme ssd for DSM.

 

2. I used a SATA-based lv as cache for DSM. But the emulated nature of SATA can be restricting the transfer rate so I'm looking for a NVME-emulated solution. I remember to have seen some benchmark results, showing transfer rates of emulated NVME device is only inferior to paravirtualized SCSI but far superior to emulated SATA.

Link to comment
Share on other sites

On 5/2/2022 at 10:26 PM, everwisher said:

remember to have seen some benchmark results, showing transfer rates of emulated NVME device is only inferior to paravirtualized SCSI but far superior to emulated SATA.

maybe with 7.x and this one?

https://xpenology.com/forum/topic/58072-how-to-have-ds3622xs-recognize-nvme-ssd-cache-drive-maybe-works-on-other-models/?do=findComment&comment=275268

 

Link to comment
Share on other sites

2 hours ago, IG-88 said:

Thank you for replying.

 

I cannot use this yet as I reverted from DS3622xs back to DS918+ and /etc.default/.extensionPort file doesn't exist in DS918+ firmware. I believe the modification of libsynonvme.so.1 still applies for DS918+, but the problem is said to be regarding the emulated nvme block that is presented to DSM as "Available Spare: 0%", which I believe to hit the point.

 

That being said, we can only passthrough physical nvme storage block to virtualized DSM currently.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...