Accidentally deleted qemu-server folder. help recreate config file for a VM

pzerone

New Member
Aug 17, 2024
5
0
1
I had mounted the qemu-server folder to a container where i was tesing an app i wrote for some automation. when deleting the project file, forgot to unmout the qemu-folder and deleted all the vm conf files. ive looked up past threads about this and recreated couple of my VMS. but i had a NAS which had couple of extra disks mounted differently and i cannot seem to find how to recreate those lines. could anyone help?. the NAS is still running and i have the `ps` output of it. any help would be greatly appreciated.

output of ps aux | grep '/usr/bin/kvm -id 100':
Code:
root     3435501  5.5  3.2 11728476 8441184 ?    SLl  Jun10 5427:02 /usr/bin/kvm -id 100 -name A-100,debug-threads=on -no-shutdown -chardev socket,id=qmp,path=/var/run/qemu-server/100.qmp,server=on,wait=off -mon chardev=qmp,mode=control -chardev socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5 -mon chardev=qmp-event,mode=control -pidfile /var/run/qemu-server/100.pid -daemonize -smbios type=1,uuid=b3c31193-134b-4207-907b-8fba659860ea -smp 4,sockets=1,cores=4,maxcpus=4 -nodefaults -boot menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg -vnc unix:/var/run/qemu-server/100.vnc,password=on -cpu qemu64,+aes,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,+pni,+popcnt,+sse4.1,+sse4.2,+ssse3 -m 8192 -object iothread,id=iothread-virtioscsi0 -device pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e -device pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f -device pci-bridge,id=pci.3,chassis_nr=3,bus=pci.0,addr=0x5 -device vmgenid,guid=6e6f73b3-466d-4bec-ab47-e26362a04f71 -device piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2 -device usb-tablet,id=tablet,bus=uhci.0,port=1 -device vfio-pci,host=0000:4b:00.2,id=hostpci0,bus=pci.0,addr=0x10 -device vfio-pci,host=0000:4b:00.3,id=hostpci1,bus=pci.0,addr=0x11 -device VGA,id=vga,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on -iscsi initiator-name=iqn.1993-08.org.debian:01:bd4f82d43e4 -device virtio-scsi-pci,id=virtioscsi0,bus=pci.3,addr=0x1,iothread=iothread-virtioscsi0 -drive file=/dev/zvol/Tank/vm-100-disk-0,if=none,id=drive-scsi0,format=raw,cache=none,aio=io_uring,detect-zeroes=on -device scsi-hd,bus=virtioscsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100 -drive file=/dev/disk/by-id/scsi-35000c500daafb71b,if=none,id=drive-virtio1,format=raw,cache=none,aio=io_uring,detect-zeroes=on -device virtio-blk-pci,drive=drive-virtio1,id=virtio1,bus=pci.0,addr=0xb -drive file=/dev/disk/by-id/scsi-35000c500daba084f,if=none,id=drive-virtio2,format=raw,cache=none,aio=io_uring,detect-zeroes=on -device virtio-blk-pci,drive=drive-virtio2,id=virtio2,bus=pci.0,addr=0xc -drive file=/dev/disk/by-id/scsi-35000c500dab91e37,if=none,id=drive-virtio3,format=raw,cache=none,aio=io_uring,detect-zeroes=on -device virtio-blk-pci,drive=drive-virtio3,id=virtio3,bus=pci.0,addr=0xd -netdev type=tap,id=net0,ifname=tap100i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on -device virtio-net-pci,mac=BC:24:11:3A:CF:CD,netdev=net0,bus=pci.0,addr=0x12,id=net0,rx_queue_size=1024,tx_queue_size=256 -machine type=pc+pve0

what i currently have:

Code:
agent: 1
boot: order=scsi0;ide2;net0
cores: 1
cpu: x86-64-v2-AES
ide2: none,media=cdrom
memory: 8192
name: A-100
net0: virtio=BC:24:11:3A:CF:CD,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
scsi0: Tank:vm-100-disk-0,iothread=1,size=55G
scsihw: virtio-scsi-single
smbios1: uuid=b3c31193-134b-4207-907b-8fba659860ea
sockets: 1
vmgenid: 6e6f73b3-466d-4bec-ab47-e26362a04f71

this is missing the 3 disks that i have attached before. rewriting those back is where im stuck.
 
get them from -drive file from ps output :
Code:
virtio1: /dev/disk/by-id/scsi-35000c500daafb71b
virtio2: /dev/disk/by-id/scsi-35000c500daba084f
virtio3: /dev/disk/by-id/scsi-35000c500dab91e37
 
Last edited:
Thanks for the reply.
Should it be virtio<num> or scsi<num>?

I currently have it like this:
scsi1: /dev/disk/by-id/scsi-35000c500daafb71b,media=disk,size=16T
scsi2: /dev/disk/by-id/scsi-35000c500daba084f,media=disk,size=16T
scsi3: /dev/disk/by-id/scsi-35000c500dab91e37,media=disk,size=16T

But have not rebooted yet to test it
 
from your ps output, it's virtio but you can switch to scsi as it's recommended.
from your ps output, correct order is mine instead, you've reverse 2 and 3.
media=disk doesn't exist in .conf
 
Last edited:
ok thank you so much... i also did a qm rescan and it corrected the boot disk size for me.. Ill update here once i reboot it. If it doesn't work, im thinking of creating a new VM and attach these disks manually once again...
 
It went fine.. had some minor hiccups.. truenas wasn't picking up its IP address after the reboot.. had to manually fix that. And the truenas dashboard went blank. I basically did a preference reset to default in truenas and re imported the pool and everything is back to normal
 

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!