Bug #62320
openlvm list should filter also on vg name
0%
Description
I have a cluster build on custom created LVM volumes (because I use multipath, and the cluster was build in 2017/mimic erra.
For example, with ceph-ansible I have :
lvm_volumes: - data: data-lv1 data_vg: data-vg1 crush_device_class: sas15k - data: data-lv1 data_vg: data-vg2 crush_device_class: sas15k
[...]
You can see that all the LVs have the same name in different VG.
ceph-volume filter only on lv_name :
single_report function in /usr/lib/python3/dist-packages/ceph_volume/devices/lvm/listing.py :
if isinstance(arg, int) or arg.isdigit(): lv = api.get_lvs_from_osd_id(arg) elif arg[0] == '/': lv = api.get_lvs_from_path(arg) else: *lv = [api.get_single_lv(filters={'lv_name': arg.split('/')[1]})]*
So it fails like that :
$ sudo ceph-volume --cluster ceph lvm list data-vg1/data-lv1 --format=json --> RuntimeError: Filters {'lv_name': 'data-lv1'} matched more than 1 LV present on this host.
With only ceph-volume, I can workaround by passing the fulldevice path /dev/vg/lv, but it breaks my ceph-ansible, where I can't present devices in another way.
And, the doc says we can use vg/lv devices, so It should work.
I suppose api.get_single_lv() can have multiple filters, one on vg_name should be fine.
Updated by Gilles Mocellin 9 months ago
It's done in prepare.py prepare() function :
try: vg_name, lv_name = self.args.data.split('/') data_lv = api.get_single_lv(filters={'lv_name': lv_name, 'vg_name': vg_name})
Also in zap.py :
def zap_lv(self, device): """ Device examples: vg-name/lv-name, /dev/vg-name/lv-name Requirements: Must be a logical volume (LV) """ lv = api.get_single_lv(filters={'lv_name': device.lv_name, 'vg_name': device.vg_name})
Updated by Gilles Mocellin 9 months ago
Sorry, one mistake (I cannot edit the bug) :
T§he problem appears with 16.2.11, not 16.2.10 where it worked.
Updated by Guillaume Abrioux 8 months ago
- Status changed from New to In Progress
- Assignee set to Guillaume Abrioux
Updated by Gaudenz Steinlin 5 months ago
PR fixing this issue: https://github.com/ceph/ceph/pull/53841
BTW this also breaks ceph-ansible (at least in some configuration which previously worked).
Updated by Konstantin Shalygin 5 months ago
- Status changed from In Progress to Fix Under Review
- Target version set to v19.0.0
- Backport set to reef quincy
- Pull request ID set to 53841
Updated by Guillaume Abrioux about 2 months ago
- Status changed from Fix Under Review to Pending Backport
- Backport changed from reef quincy to reef,quincy
Updated by Backport Bot about 2 months ago
- Copied to Backport #64642: reef: lvm list should filter also on vg name added
Updated by Backport Bot about 2 months ago
- Copied to Backport #64643: quincy: lvm list should filter also on vg name added