I'm using libvirt+KVM+Qemu on Ubuntu 11.04. I have some scsi devices like this:
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/shared-01-02-00.img'/>
<target dev='sda' bus='scsi'/>
<address type='drive' controller='0' bus='0' unit='0'/>
</disk>
The show up in the virtual machine as e.g. /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0
For my management purposes, I would like to be able to assigned an arbitrary 'serial number' to the virtual devices, which would show up when scsi_id
is run on the block device from inside the virtual machine. How can I do that?