Posted May 21, 20232 yr Hello, I need to change the hard drive model and serial number on a VM. Unfornutaly i can´t find a way to change the model name in libvirt. On Proxmox this is possible, i found a example on GitHub: -device "ide-hd,drive=disk00,bus=ide.0,serial=00000000000000000001,model=VMware Virtual IDE Hard Drive" \ Here the Serial and the Model is changeable. Is there a way to change the HardDrive Model in Unraid? Thanks!
May 22, 20232 yr Add <serial></serial> to your disk block: something like this in the xml: <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/path/to/disk.img'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' unit='1'/> <serial>YOURSERIALNUMBERHERE</serial> </disk>
May 23, 20232 yr Author thanks for the answer, i can change the serial number exactly as you write. Unfortunately, that doesn't work with the model. I tried to add a <Model><\Model> in the XML. However, this entry is automatically deleted after saving.
May 23, 20232 yr Solution 4 hours ago, Reclaim said: I tried to add a <Model><\Model> in the XML. However, this entry is automatically deleted after saving. That's because model is not defined in libvirt. I don't think disk model was implemented in libvirt. Try to add a qemu override and see if that works. So, for serial and model do the following: - define the disk block with your disk, set a serial and give it an alias starting with ua-: <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/path/to/disk.img'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' unit='1'/> <alias name='ua-mydisk'/> <serial>YOURSERIALNUMBERHERE</serial> </disk> - add at the bottom before the domain closing tag a qemu override referring to the alias: <qemu:override> <qemu:device alias='ua-mydisk'> <qemu:frontend> <qemu:property name='model' type='string' value='VMware Virtual IDE Hard Drive'/> </qemu:frontend> </qemu:device> </qemu:override> </domain> And make sure you defined the proper legacy schema at the top of your xml: <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> Edited May 23, 20232 yr by ghost82
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.