How to create a resource to handle dev-mapper devices
Jeffrey Lane
jeffrey.lane at canonical.com
Tue Nov 29 22:12:00 UTC 2016
SO this came up a long while ago and it's been very stagnant ever since.
The question is simple, how can we create a resource to identify
dev-mapper devices. Here's the problem: All disk testing depends on
a resource identified as a "DISK" as pulled from lshw.
For example, this job description:
unit: template
template-resource: device
template-filter: device.category == 'DISK'
plugin: shell
category_id: 2013.com.canonical.plainbox::disk
id: disk/disk_stress_ng_{name}
estimated_duration: 4560.0
user: root
requires:
package.name == 'stress-ng'
block_device.{name}_state != 'removable'
_summary: Disk stress_ng test for {product}
_description: Disk stress_ng test for {product}
command: disk_stress_ng {name} --base-time 240 --really-run
This fails on two cases, LVM and Multi-Path storage.
In both cases, you'll see "disk" devices, but those are NOT
accessible/usable (though you can destroy them quite easily, as we
learned). Instead, they're aggregated by dev-mapper into pseudo
devices.
So I supposed the ultimate answer requires that we can specify OR for
requirements like device.category:
device.category = "DISK" OR device.category = "MAPPER"
Or some sort of order of precedence of device.category?
So that if there's a mapper present, we use that, and if not, we use
disk devices.
Maybe something like Job A would be for DISK devices and Job B would
be for dev-mapper devices, and if dev-mapper is found and Job B is
run, we do NOT run Job A.
At least for now, that's how I'm picturing it, I'm sure there's a more
elegant way to do this.
At the end of the day, we need to be able to run these tests against
dev-mapper devices (both LVM and Multi-Path) and can not do so today.
The tests themselves are easy, it's a matter of the resource.
Thoughts?
Jeff
--
"Entropy isn't what it used to be."
Jeff Lane -
Server Certification Lead, Warrior Poet, Biker, Lover of Pie
Phone: 919-442-8649
Ubuntu Ham: W4KDH Freenode IRC: bladernr or bladernr_
gpg: 1024D/3A14B2DD 8C88 B076 0DD7 B404 1417 C466 4ABD 3635 3A14 B2DD
More information about the Checkbox-devel
mailing list