Changing the HardDrive Model Number possible?


Go to solution Solved by ghost82,

Recommended Posts

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!

Link to comment

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>

 

  • Thanks 1
Link to comment
  • 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 by ghost82
  • Thanks 1
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.