Project

General

Profile

Bug #62320

lvm list should filter also on vg name

Added by Gilles Mocellin 7 months ago. Updated 3 months ago.

Status:
Fix Under Review
Priority:
Normal
Target version:
% Done:

0%

Source:
Community (user)
Tags:
Backport:
reef quincy
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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.

History

#1 Updated by Gilles Mocellin 7 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})

#2 Updated by Gilles Mocellin 7 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.

#3 Updated by Guillaume Abrioux 5 months ago

  • Status changed from New to In Progress
  • Assignee set to Guillaume Abrioux

#4 Updated by Gaudenz Steinlin 3 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).

#5 Updated by Konstantin Shalygin 3 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

Also available in: Atom PDF