disk_test fails: IOError: [Errno 2] No such file or directory: '/sys/block//device/model'

Bug #552998 reported by Mathias Gug on 2010-04-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Undecided
Marc Tardif

Bug Description

While trying to run checkbox-cli 0.9.1 in a virtual machine (kvm with virtio devices) I ran into the following error:

Running disk_test...
..
The following hard drives were detected:

Traceback (most recent call last):
  File "/usr/share/checkbox/scripts/disk_test", line 32, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/share/checkbox/scripts/disk_test", line 21, in main
    model_file = open(model_path)
IOError: [Errno 2] No such file or directory: '/sys/block//device/model'

Is this correct?

  y: yes
  n: no
  s: skip
  t: test

Please choose (y/n/s/t): n

Package built from https://code.launchpad.net/~cr3/ubuntu/lucid/checkbox/0.9.1/+merge/22421

Related branches

Marc Tardif (cr3) on 2010-04-01
Changed in checkbox:
assignee: nobody → Marc Tardif (cr3)
status: New → Confirmed
Marc Tardif (cr3) wrote :

The problem with block devices exposed using virtio in kvm is that they look quite similar according to udevadm. For example, the following devices are supposed to be a virtual hard drive and cdrom respectively:

$ udevadm info -q env -p /block/vda
UDEV_LOG=3
DEVPATH=/devices/virtio-pci/virtio1/block/vda
MAJOR=252
MINOR=0
DEVNAME=/dev/vda
DEVTYPE=disk
SUBSYSTEM=block
ID_PART_TABLE_TYPE=dos
DEVLINKS=/dev/block/252:0

$ udevadm info -q env -p /block/vdb
UDEV_LOG=3
DEVPATH=/devices/virtio-pci/virtio2/block/vdb
MAJOR=252
MINOR=16
DEVNAME=/dev/vdb
DEVTYPE=disk
SUBSYSTEM=block
ID_FS_LABEL=Ubuntu-Server_10.04_i386
ID_FS_LABEL_ENC=Ubuntu-Server\x2010.04\x20i386
ID_FS_TYPE=iso9660
ID_FS_USAGE=filesystem
DEVLINKS=/dev/block/252:16 /dev/disk/by-label/Ubuntu-Server\x2010.04\x20i386

Marc Tardif (cr3) wrote :

Even parted_devices doesn't seem to detect block devices exposed using virtio.

Marc Tardif (cr3) wrote :

Correction, parted_devies does detect block devices but does not distinguish virtual hard drives from cdroms:

$ sudo parted_devices
/dev/vda 2147483648 Virtio Block Device
/dev/vdb 693774336 Virtio Block Device

Marc Tardif (cr3) wrote :

It seems that there is currently no way to distinguish cdrom devices from disk devices when using virtio in kvm. So, until the driver can expose this distinction, the only workaround is to prevent the disk_test script from failing with an exception.

Changed in checkbox:
status: Confirmed → Fix Committed
Marc Tardif (cr3) on 2010-04-02
Changed in checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers