Bug 901493 - [TestOnly] No ID_SERIAL for virtio-blk devices
[TestOnly] No ID_SERIAL for virtio-blk devices
Status: CLOSED DUPLICATE of bug 877836
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Stefan Hajnoczi
Virtualization Bugs
: TestOnly
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-18 05:20 EST by Rajendra Kumar
Modified: 2013-01-22 21:16 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-22 21:16:38 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Rajendra Kumar 2013-01-18 05:20:22 EST
Description of problem:

Virtio-blk devices does not have ID_SERIAL and no way to uniquely identify virtual devices under guest OS. I tried to add <serial>SERIAL_ID</serial> 
to existing virtio-blk devices using virsh command. I tried this command 
on active and inactive guest but it is failing with different errors. 

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. setup a guest using virtio-blk disk, without giving a serial id to 
   the disk, this is the default situation. 
2. In guest, run `udevadm info /dev/vda | grep ID_SERIAL`, it returns empty.
3. Create an XML file to update a specific device. To add a line for the 
   source device

   <disk type='file' device='disk'>
        <driver name='qemu' type='raw'/>
        <source file='/var/lib/libvirt/images/mydisk.img'/>
        <target dev='vdb' bus='virtio'/>
        <alias name='virtio-disk1'/>
        <serial>1234565453</serial>
        <address type='pci' domain='0x0000' bus='0x00' 
                 slot='0x07' function='0x0'/>
   </disk>

4. add serialID by updating the device with the help of below command: 
   $ virsh update-device <GuestName> guest-device.xml



Actual results:
1. Step2 o/p is null.
2. Step4 o/p is as below.
###
error: Failed to update device from t.xml
error: unsupported configuration: disk bus 'virtio' cannot be updated.
###


Expected results:
All virtio-blk devices should have ID_SERIAL.

Additional info:
Comment 2 Sibiao Luo 2013-01-21 01:11:55 EST
Hi all,

   Qemu-kvm did not support serial property for virtio_blk device before qemu-kvm-0.12.1.2-2.350.el6, you could check it by '/usr/libexec/qemu-kvm -device virtio-blk-pci,?'.
But it support later than qemu-kvm-0.12.1.2-2.350.el6. BTW, there are two ways to specify the serial number for virtio_blk device, e.g: -drive serial=xxxxx,.... and ....-device virtio-blk-pci serial=xxxxx.
note: the serial ws limited to 20 charachters.
and we can check serial number in guest.
- Linux guest.
# cat /sys/block/vdX/serial
- Windows guest.
] hddsn.exe YYY    ---->   YYY is the disk you want to check.

Best Regards.
sluo
Comment 3 Ademar Reis 2013-01-22 08:56:01 EST
The feature was introduced by 0458d1ca16af0a6903e3409634bcd3cb5d445ca6, necessary for Bug 877836 (VERIFIED) and backported by Stefan. It'll be part of RHEL6.4.

Reassigning, marking it TestOnly and status:ON_QA.
Comment 4 Sibiao Luo 2013-01-22 21:16:38 EST
Hi all,
 
   Base on comment #2 and comment #3, disk serial numbers are supported later than qemu-kvm-0.12.1.2-2.350.el6, it'll be part of RHEL6.4, and i also tried latest qemu-kvm-0.12.1.2-2.352.el6, it works well. Close this issue as duplicated to bug 877836, free to correct me if any mistake.

Best Regards.
sluo

*** This bug has been marked as a duplicate of bug 877836 ***

Note You need to log in before you can comment on or make changes to this bug.