Project

General

Profile

Bug #36098

Updated by Alfredo Deza 11 months ago

Specifically, in containers, lsblk can miss the fact that a valid PARTLABEL exists:

<pre>
[root@osd0 /]# lsblk -P -p -o NAME,PARTLABEL,TYPE /dev/sda1
NAME="/dev/sda1" PARTLABEL="" TYPE="part"

[root@osd0 /]# blkid -t PARTLABEL="ceph data"
/dev/sdb1: UUID="4a58f041-e07f-4a41-8da5-ef324857f74d" TYPE="xfs" PARTLABEL="ceph data" PARTUUID="edd042e3-4557-40f1-8f97-4a66f47a3994"
/dev/sda1: UUID="94f52534-5dd2-465a-aff9-1007d2142b39" TYPE="xfs" PARTLABEL="ceph data" PARTUUID="a472b208-16f8-4732-8ad3-18f9ce4e5a3b"
/dev/sdc1: UUID="e332edfe-5cf4-44e7-b0b5-90d469d96aae" TYPE="xfs" PARTLABEL="ceph data" PARTUUID="97a01173-33e4-4ac6-8862-dbc388948b53"
</pre>

The problem with this is that <pre>simple scan</pre> has this check:

<pre>
if disk.is_partition(args.osd_path):
label = disk.lsblk(args.osd_path)['PARTLABEL']
if 'data' not in label:
raise RuntimeError('Device must be the data partition, but got: %s' % label)
</pre>

Specifically this line:

<pre>
label = disk.lsblk(args.osd_path)['PARTLABEL']
</pre>

Should be changed, probably using a helper, that may allow things like:

<pre>
>>> Device.is_ceph_disk
True
>>> Device.ceph_disk.journal
False
>>> Device.ceph_disk.data
True
</pre>

Back