Project

General

Profile

Actions

Bug #18976

closed

ceph-disk prepare accepts a directory who's name starts with /dev

Added by John Fulton about 7 years ago. Updated about 3 years ago.

Status:
Won't Fix
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
jewel,kraken
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

This bug is a proposal for ceph-disk prepare to reject an argument
that starts with /dev if that argument is not a valid block device
on the system (as per a command like lsblk).

I came across this in puppet-ceph [1] where users may be passing a
list of block devices to make OSDs. puppet-ceph's bug was to create
a directory starting with /dev and make a working deploy instead of
fail. I am fixing the bug in puppet-ceph so that /dev/ is reserved
only for real block devices, but thought you might want to check this
in the Ceph CLI tools themselves.

Below is my testing [2] indicating that I was able to do what is
reported in this bug. Perhaps it should kick back an error that
/dev/sdg is not a real block device?

[1] https://bugs.launchpad.net/puppet-ceph/+bug/1665697

[2]
[root@overcloud-osd-compute-0 ~]# fsid=34e222eb-e1f9-4efc-a4ea-983280de26c1
[root@overcloud-osd-compute-0 ~]# mkdir /dev/sdg
[root@overcloud-osd-compute-0 ~]# ceph-disk prepare --cluster ceph --cluster-uuid $fsid /dev/sdg
[root@overcloud-osd-compute-0 ~]#

[root@overcloud-osd-compute-0 ~]# ceph version
ceph version 10.2.2 (45107e21c568dd033c2f0a3107dec8f0b0e58374)
[root@overcloud-osd-compute-0 ~]#

[root@overcloud-osd-compute-0 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 50G 0 disk
├─vda1 252:1 0 1M 0 part
└─vda2 252:2 0 50G 0 part /
vdb 252:16 0 50G 0 disk
└─vdb1 252:17 0 50G 0 part /var/lib/ceph/osd/ceph-0
vdc 252:32 0 50G 0 disk
└─vdc1 252:33 0 50G 0 part /var/lib/ceph/osd/ceph-1
vdd 252:48 0 50G 0 disk
└─vdd1 252:49 0 50G 0 part /var/lib/ceph/osd/ceph-2
vde 252:64 0 50G 0 disk
└─vde1 252:65 0 50G 0 part /var/lib/ceph/osd/ceph-3
vdf 252:80 0 50G 0 disk
├─vdf1 252:81 0 5G 0 part
├─vdf2 252:82 0 5G 0 part
├─vdf3 252:83 0 5G 0 part
└─vdf4 252:84 0 5G 0 part
[root@overcloud-osd-compute-0 ~]#

[root@overcloud-osd-compute-0 ~]# ceph-disk list
/dev/vda :
/dev/vda1 other, iso9660
/dev/vda2 other, xfs, mounted on /
/dev/vdb :
/dev/vdb1 ceph data, active, cluster ceph, osd.0, journal /dev/vdf1
/dev/vdc :
/dev/vdc1 ceph data, active, cluster ceph, osd.1, journal /dev/vdf2
/dev/vdd :
/dev/vdd1 ceph data, active, cluster ceph, osd.2, journal /dev/vdf3
/dev/vde :
/dev/vde1 ceph data, active, cluster ceph, osd.3, journal /dev/vdf4
/dev/vdf :
/dev/vdf1 ceph journal, for /dev/vdb1
/dev/vdf2 ceph journal, for /dev/vdc1
/dev/vdf3 ceph journal, for /dev/vdd1
/dev/vdf4 ceph journal, for /dev/vde1
[root@overcloud-osd-compute-0 ~]#

[root@overcloud-osd-compute-0 ~]# rpm -qa | grep ceph
python-cephfs-10.2.2-0.el7.x86_64
ceph-10.2.2-0.el7.x86_64
ceph-common-10.2.2-0.el7.x86_64
ceph-base-10.2.2-0.el7.x86_64
ceph-radosgw-10.2.2-0.el7.x86_64
ceph-selinux-10.2.2-0.el7.x86_64
ceph-mds-10.2.2-0.el7.x86_64
libcephfs1-10.2.2-0.el7.x86_64
puppet-ceph-2.2.1-0.20170116235834.8e01a41.el7.centos.noarch
ceph-osd-10.2.2-0.el7.x86_64
ceph-mon-10.2.2-0.el7.x86_64
[root@overcloud-osd-compute-0 ~]#

Actions #2

Updated by Nathan Cutler about 7 years ago

  • Status changed from New to Fix Under Review
Actions #3

Updated by Nathan Cutler about 7 years ago

  • Backport set to jewel,kraken
Actions #4

Updated by Loïc Dachary about 7 years ago

The --data-dev, --journal-dev (--*-dev for each kind of argument) can be used to fail in case the provided argument is not a block device. Would that address the problem you're having ?

Actions #5

Updated by John Fulton about 7 years ago

Loic Dachary wrote:

The --data-dev, --journal-dev (--*-dev for each kind of argument) can be used to fail in case the provided argument is not a block device. Would that address the problem you're having ?

Yes, one could use those flags to address the original reported issue. I think the bug could be closed. Thanks.

Actions #6

Updated by Sage Weil about 3 years ago

  • Status changed from Fix Under Review to Won't Fix
Actions

Also available in: Atom PDF