Setting hard drive serial number

alatteri

Well-Known Member
Hello,

I need to virtualize some severs which the software is licensed to the hard drive serial number. I know this is possible with plain qemu+kvm, but I do not see any documentation regarding this in Proxmox and the VM conf files see to have a different non XML format than plain qemu+kvm.

Thanks for any help.

Alan
 
Last edited:
args is only for plain KVM commands.
the comands you see at: man kvm

Use:

# qm showcmd <VM-number>

this shows your run qemu-kvm command.

in this output you must search for something like this.
-drive file:<path to your Disk> .... -<something>
this you must copy to your conf.

please backup your config before you edit the file.

args: <copy>,serial=<your_needed_serial>

and command out the standard entry about this drive

I hope you understand my description.
 
Last edited by a moderator:
I got this working using the args: But really, it would be great to be able to set this a Proxmox way in the gui. Because install of just serial=' ABCD1234'
the args become this:

-device ahci,id=ahci0,multifunction=on,bus=pci.0,addr=0x7 -drive file=/var/lib/vz/images/100/vm-100-disk-1.qcow2,if=none,id=drive-sata0,format=qcow2,aio=native,cache=none,detect-zeroes=on -device ide-drive,bus=ahci0.0,drive=drive-sata0,id=sata0,bootindex=100,serial=' ABCD1234'


Also this prevents easy cloning from the GUI, as the in the clone, the whole arg is taken, and it doesn't actually clone the drive. So cloning basically becomes a manual shell process.

Thanks.
Alan
 
A simpler way is just to add the serial=1234 or whatever to the .conf file for your VM. Make sure you power cycle (not a simple reboot) the VM to reset the value.

Example:

bootdisk: virtio0
cores: 1
ide0: VMStorage:101/vm-101-disk-2.qcow2,cache=writethrough,size=50G,serial=1234
ide1: VMStorage:101/vm-101-disk-1.qcow2,cache=writethrough,size=50G,serial=12345
ide2: VMStorage:iso/Windows2008_Standard.iso,media=cdrom
memory: 1024
name: Win2008FirstServer
net0: bridge=vmbr0,e1000=66:61:40:33:66:64
numa: 0
ostype: win8
parent: test
smbios1: uuid=4286957f-21c6-461f-b7b0-8aa4247e3cba
sockets: 1
 
I stumbled on this problem too. I think we need this in general in Proxmox for virtualizing.
Same applies to smbios entries with spaces (not allowed via GUI) and have to be encapsulated with ' and also applying SLIC via GUI would also be great.
 
There is no harddisk abstraction for a container. It only 'sees' the data - file storage.

You can, however, attach a physical disk to a container, so the data is directly accessible (also serial).
 
"Holy Thread Necro Batman!" -- Leaving this note here for anyone else running into a similar issue since this is a high hit on Le Googles for vm virtio disk serial numbers.

(Please don't judge me for the aged infra versions here)

I spent the better part of 30+ minutes trying to figure out why serial={{ some guid }} in ProxMox 6.4-15 on my VM's SCSI harddrive wasn't being passed into my Alpine 3.16 guest OS. After scouring dmesg, lsblk output, etc -- I found that there appears to be something wonky with mdev on Alpine.

Booting up to a bootable linux distro with udev, the lsblk output gave serial numbers just fine.... so keep your Debian/Ubuntu/Kali live cd iso handy if you're using Alpine or a similar busybox'd distro.

I'm in the slow process of stepped upgrading my clustered proxmox install to get to a more respectable set of software versions.
 

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!