[SOLVED] How do you set up a VM with NVMe interface?

piero.proietti

Renowned Member
Mar 12, 2010
16
0
66
Roma, Italy
www.piojoris15.com
To do some testing on a Linux installation program of mine, I would like to configure a VM with NVMe to test the operation on it.

I think I have done this previously - about a year ago - probably by editing the VM configuration files, but I don't remember and wasen't able to find informations.

Can anyone provide me with an example,
 
There is currently no way to do this directly in PVE via the GUI, but as you guessed, it can be done via the args parameter. Something in the form of this should work:

Code:
-drive file=/path/to/nvme1.img,if=none,id=NVME1 -device nvme,drive=NVME1,serial=nvme-1

More information can be found on the QEMU Wiki.
 
I tried this, commenting the line:
Code:
#scsi0: local:103/vm-103-disk-0.qcow2,iothread=1,size=32G
and adding the line:
Code:
-drive file=/var/lib/vz/images/103/vm-103-disk-0.qcow2,if=none,id=NVME1 -device nvme,drive=NVME1,serial=nvme-1

This is the configuration file on /etc/pve/qemu-server/103.conf

Code:
boot: order=scsi0;ide2;net0
cores: 2
ide2: local:iso/egg-of-debian-bullseye-colibri_amd64_2023-06-10_1157.iso,media=cdrom,size=1012M
memory: 4096
meta: creation-qemu=7.2.0,ctime=1686595998
name: NVMe
net0: virtio=56:E7:8A:FA:B5D,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
#scsi0: local:103/vm-103-disk-0.qcow2,iothread=1,size=32G
scsihw: virtio-scsi-single
smbios1: uuid=4cbb8d83-65cc-47da-a9ba-328120731ed3
sockets: 2
vga: qxl
vmgenid: 0d190ab4-059f-458d-9bcc-59ac4f4667c2
-drive file=/var/lib/vz/images/103/vm-103-disk-0.qcow2,if=none,id=NVME1 -device nvme,drive=NVME1,serial=nvme-1

Not working...

Code:
args: -drive file=/var/lib/vz/images/103/vm-103-disk-0.qcow2,if=none,id=NVME1 -device nvme,drive=NVME1,serial=nvme-1

OK, not is working, great!!! Thanks
 
Last edited:
I tried this, commenting the line:
Code:
#scsi0: local:103/vm-103-disk-0.qcow2,iothread=1,size=32G
and adding the line:
Code:
-drive file=/var/lib/vz/images/103/vm-103-disk-0.qcow2,if=none,id=NVME1 -device nvme,drive=NVME1,serial=nvme-1

This is the configuration file on /etc/pve/qemu-server/103.conf

Code:
boot: order=scsi0;ide2;net0
cores: 2
ide2: local:iso/egg-of-debian-bullseye-colibri_amd64_2023-06-10_1157.iso,media=cdrom,size=1012M
memory: 4096
meta: creation-qemu=7.2.0,ctime=1686595998
name: NVMe
net0: virtio=56:E7:8A:FA:B5D,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
#scsi0: local:103/vm-103-disk-0.qcow2,iothread=1,size=32G
scsihw: virtio-scsi-single
smbios1: uuid=4cbb8d83-65cc-47da-a9ba-328120731ed3
sockets: 2
vga: qxl
vmgenid: 0d190ab4-059f-458d-9bcc-59ac4f4667c2
-drive file=/var/lib/vz/images/103/vm-103-disk-0.qcow2,if=none,id=NVME1 -device nvme,drive=NVME1,serial=nvme-1

Code:
args: -drive file=/var/lib/vz/images/103/vm-103-disk-0.qcow2,if=none,id=NVME1 -device nvme,drive=NVME1,serial=nvme-1



 
  • Like
Reactions: piero.proietti
At last I added bootindex=1 to have boot, and started it.

This is the final working configuration:

Code:
args: -drive file=/var/lib/vz/images/103/vm-103-disk-0.qcow2,if=none,id=NVME1 -device nvme,drive=NVME1,serial=nvme-1,bootindex=1
bios: ovmf
boot: order=scsi0;ide2;net0
cores: 2
efidisk0: local-lvm:vm-103-disk-0,efitype=4m,pre-enrolled-keys=1,size=4M
ide2: zfs-dir:iso/ubuntu-22.04.2-desktop-amd64.iso,media=cdrom,size=4812096K
memory: 4096
meta: creation-qemu=7.2.0,ctime=1686637883
name: NVMe
net0: virtio=06:86:85:C7:6E:73,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
scsihw: virtio-scsi-single
smbios1: uuid=39f20000-1099-45b7-ab4f-7a20425ef6d2
sockets: 2
vga: qxl
vmgenid: 516de728-6346-4a37-859a-1ff4a2287af1
 

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!