What is the best way to add NVMe M.2 SSD to a VM via "qm set" command or by adding a PCIe device in GUI's VM Hardware page?

rigel.local

Member
Mar 24, 2023
31
4
8
I need to passthrough NVMe M.2 SSDs to a TrueNAS VM and found out 2 Options:

1. I can simply use Proxmox GUI and add a PCIe M.2 device on Hardware page:

screenshot-2023-05-24-23-11-27@2x.png

2. Or it is possible to add NVMe device as "hard disk" using this command:

qm set 110 -virtio1 /dev/disk/by-id/nvme-SAMSUNG_MZ1LB1T9HALS-000FB_SERIALNUMBER


What is the difference between these 2 methods when it comes to performance and stable work within VM?

After I add 4 NVMe drives via Hardware GUI it looks like this:
screenshot-2023-05-24-23-16-01@2x.png

and after I add them via qm set command it looks like this:
screenshot-2023-05-24-23-20-08@2x.png
(device serial numbers have been blurred)
 
Last edited:
Hi,

The core difference is, that in 1. you are passing through the entire PCIe device [1][2] whereas in 2. the drives are handled by virtio [3].
That means with 1. you are directly giving the vm hardware whereas in 2. you have a layer of abstraction (by the virtio drivers) that then pass the disk from the host to the vm.
My educated guess would be that 1. gives better performance. However, you won't be able to use the snapshot feature or make backups with Proxmox Backup Server [4] , since Proxmox VE will have no idea that the passed-through device is a storage device. So you will have to backup using a different method.

Useful links for you could be the docs [5], our wiki on performance tweaks [6] and our wiki on how to benchmark storage speeds [7]

[1]: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_pci_passthrough
[2]: https://pve.proxmox.com/wiki/PCI_Passthrough
[3]: https://developer.ibm.com/articles/l-virtio/
[4]: https://pbs.proxmox.com/docs/
[5]: https://pve.proxmox.com/pve-docs/pve-admin-guide.html
[6]: https://pve.proxmox.com/wiki/Performance_Tweaks
[7]: https://pve.proxmox.com/wiki/Benchmarking_Storage
 
  • Like
Reactions: rigel.local
Thank you so much for your explanation and useful links for further reading on the subject! It looks like PCIe device passthrough is more suitable option for me.
 
  • Like
Reactions: noel.

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!