Reclaim Posted May 21, 2023 Share Posted May 21, 2023 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! Quote Link to comment
ghost82 Posted May 22, 2023 Share Posted May 22, 2023 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> 1 Quote Link to comment
Reclaim Posted May 23, 2023 Author Share Posted May 23, 2023 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. Quote Link to comment
Solution ghost82 Posted May 23, 2023 Solution Share Posted May 23, 2023 (edited) 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, 2023 by ghost82 1 Quote Link to comment
Reclaim Posted May 23, 2023 Author Share Posted May 23, 2023 Thank you so much, it worked. 1 Quote Link to comment
Recommended Posts
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.