Project

General

Profile

Actions

Bug #62320

open

lvm list should filter also on vg name

Added by Gilles Mocellin 9 months ago. Updated about 2 months ago.

Status:
Pending Backport
Priority:
Normal
Target version:
% Done:

0%

Source:
Community (user)
Tags:
backport_processed
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.


Related issues 2 (2 open0 closed)

Copied to ceph-volume - Backport #64642: reef: lvm list should filter also on vg nameNewGuillaume AbriouxActions
Copied to ceph-volume - Backport #64643: quincy: lvm list should filter also on vg nameNewGuillaume AbriouxActions
Actions #1

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})

Actions #2

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.

Actions #3

Updated by Guillaume Abrioux 8 months ago

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

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).

Actions #5

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
Actions #6

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
Actions #7

Updated by Backport Bot about 2 months ago

  • Copied to Backport #64642: reef: lvm list should filter also on vg name added
Actions #8

Updated by Backport Bot about 2 months ago

  • Copied to Backport #64643: quincy: lvm list should filter also on vg name added
Actions #9

Updated by Backport Bot about 2 months ago

  • Tags set to backport_processed
Actions

Also available in: Atom PDF