This is already supported. You can pass an lv to the lvm create or lvm prepare subcommands like so:
ceph-volume lvm prepare --data <vg_name>/<lv_name>
Oops, probably my expression, `logical devices` was improper.
What I mean and what I'm preparing PR to are as follows.
- a. Support devices created by device-mappers
Let assume that we want to use a device created with dm-flakey as OSD.
When we call `ceph-volume lvm prepare --data <path/to/device`,
it fails since the following condition A becomes false.
https://github.com/ceph/ceph/blob/70d27ce3523738c9363760d33d819bf48342b9fe/src/ceph-volume/ceph_volume/devices/lvm/prepare.py#L192
```
def prepare_device(self, arg, device_type, cluster_fsid, osd_fsid):
<snip>
if disk.is_partition(arg) or disk.is_device(arg): ... condition A
# we must create a vg, and then a single lv
vg = api.create_vg(arg)
lv_name = "osd-%s-%s" % (device_type, osd_fsid)
return api.create_lv(
lv_name,
vg.name, # the volume group
tags={'ceph.type': device_type})
else:
error = [
'Cannot use device (%s).' % arg,
'A vg/lv path or an existing device is needed']
raise RuntimeError(' '.join(error))
```
I know multiple devices are not supported as-is.
https://docs.ceph.com/docs/mimic/ceph-volume/lvm/prepare/#multipath-support
However, the above-mentioned condition A prohibits not only multipath
devices (lsblk's TYPE=="mpath"), but also all device excepts physical
devices and partitions thereof (TYPE == "disk" or "part").
It's a too strong restriction.
- b. Passing LV to ceph-volume transparently
Currently, we can pass LV to ceph-volume with `vg_name/lv_name` as you said.
In addition to this way, it's convenient to be able to pass it with a device
name because users can manage LVs and other devices transparently.
If I should divide this issue to two different ones, I'll do it.