disk_test fails: IOError: [Errno 2] No such file or directory: '/sys/block//device/model'
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/
sys.
File "/usr/share/
model_file = open(model_path)
IOError: [Errno 2] No such file or directory: '/sys/block/
Is this correct?
y: yes
n: no
s: skip
t: test
Please choose (y/n/s/t): n
Package built from https:/
Related branches
Changed in checkbox: | |
assignee: | nobody → Marc Tardif (cr3) |
status: | New → Confirmed |
Marc Tardif (cr3) wrote : | #1 |
Marc Tardif (cr3) wrote : | #2 |
Even parted_devices doesn't seem to detect block devices exposed using virtio.
Marc Tardif (cr3) wrote : | #3 |
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 : | #4 |
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 |
Changed in checkbox: | |
status: | Fix Committed → Fix Released |
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 /devices/ virtio- pci/virtio1/ block/vda TABLE_TYPE= dos /dev/block/ 252:0
UDEV_LOG=3
DEVPATH=
MAJOR=252
MINOR=0
DEVNAME=/dev/vda
DEVTYPE=disk
SUBSYSTEM=block
ID_PART_
DEVLINKS=
$ udevadm info -q env -p /block/vdb /devices/ virtio- pci/virtio2/ block/vdb Ubuntu- Server_ 10.04_i386 ENC=Ubuntu- Server\ x2010.04\ x20i386 filesystem /dev/block/ 252:16 /dev/disk/ by-label/ Ubuntu- Server\ x2010.04\ x20i386
UDEV_LOG=3
DEVPATH=
MAJOR=252
MINOR=16
DEVNAME=/dev/vdb
DEVTYPE=disk
SUBSYSTEM=block
ID_FS_LABEL=
ID_FS_LABEL_
ID_FS_TYPE=iso9660
ID_FS_USAGE=
DEVLINKS=