therapist Posted March 2, 2022 Share Posted March 2, 2022 Ive recently upgraded my server with a few NVME drives, one of which replaced a VHD for a VM. I have been passing whole disks through to VMs for quite some time like this: <disk type='block' device='disk'> <driver name='qemu' type='raw' cache='none' discard='unmap'/> <source dev='/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_1TB_XXXXXXXXXX'/> <target dev='hdf' bus='scsi'/> <boot order='2'/> <alias name='scsi0-0-0-3'/> <address type='drive' controller='0' bus='0' target='0' unit='3'/> </disk> After doing some reading I learned that NVME drives can be passed through directly to show as an actual NVME drive (as opposed to thin provisioned) <hostdev mode='subsystem' type='pci' managed='yes'> <driver name='vfio'/> <source> <address domain='0x0000' bus='0x41' slot='0x00' function='0x0'/> </source> <alias name='hostdev2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </hostdev> Is there any actual functional difference in passing devices one or the other way? Any performance benefit? ALSO I learned that VHDs can be passed through as NVME devices <qemu:commandline> <qemu:arg value='-drive'/> <qemu:arg value='file=/mnt/cnvme/VMS/VHD_BULK/GEIST/GEIST_Z.img,format=raw,if=none,id=NVME1'/> <qemu:arg value='-device'/> <qemu:arg value='nvme,drive=NVME1,serial=nvme-1'/> </qemu:commandline> Quote Link to comment
ghost82 Posted March 2, 2022 Share Posted March 2, 2022 (edited) 35 minutes ago, therapist said: Is there any actual functional difference in passing devices one or the other way? Any performance benefit? Main difference is that in first case you attach the real disk to an emulated controller (scsi in your example), in the second case you pass directly the real disk+controller. In first case there's some overhead because of the emulated controller (maybe not noticeable at all in everyday use, unless you read the numbers coming from a disk benchmark app). Edited March 2, 2022 by ghost82 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.