Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lvdisplay does not respect --reportformat #144

Open
drleq opened this issue Feb 29, 2024 · 1 comment
Open

lvdisplay does not respect --reportformat #144

drleq opened this issue Feb 29, 2024 · 1 comment

Comments

@drleq
Copy link

drleq commented Feb 29, 2024

Version
OS: Alma Linux 9.3

$ sudo lvdisplay --version
  LVM version:     2.03.21(2) (2023-04-21)
  Library version: 1.02.195 (2023-04-21)
  Driver version:  4.48.0
  Configuration:   ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-default-dm-run-dir=/run --with-default-run-dir=/run/lvm --with-default-pid-dir=/run --with-default-locking-dir=/run/lock/lvm --with-usrlibdir=/usr/lib64 --enable-fsadm --enable-write_install --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-cmdlib --enable-dmeventd --enable-blkid_wiping --with-udevdir=/usr/lib/udev/rules.d --enable-udev_sync --with-thin=internal --with-cache=internal --enable-lvmpolld --enable-lvmlockd-dlm --enable-lvmlockd-dlmcontrol --enable-lvmlockd-sanlock --enable-dbus-service --enable-notify-dbus --enable-dmfilemapd --with-writecache=internal --with-vdo=internal --with-vdo-format=/usr/bin/vdoformat --with-integrity=internal --with-default-use-devices-file=1 --disable-silent-rules --enable-app-machineid --enable-editline --disable-readline

Description
Previously, we have used pvdisplay --reportformat json to gather information about LVMs on a host. After moving to Alma Linux 9 this no longer works, although the lvmreport man page claims that it should.

$ sudo lvdisplay --reportformat json
  --- Logical volume ---
  LV Path                /dev/almalinux/swap
  LV Name                swap
  VG Name                almalinux
  LV UUID                gJbgHN-YWDp-Yl08-czwY-0mDN-ecM1-iPNGDy
  LV Write Access        read/write
  LV Creation host, time OPSLSALMA93001, 2023-12-14 12:43:23 +0000
  LV Status              available
  # open                 2
  LV Size                5.00 GiB
  Current LE             1280
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           253:1

  --- Logical volume ---
  LV Path                /dev/almalinux/root
  LV Name                root
  VG Name                almalinux
  LV UUID                s5rLbo-jBZe-76Oh-m8nj-3Dvz-1RTE-TCmjuq
  LV Write Access        read/write
  LV Creation host, time OPSLSALMA93001, 2023-12-14 12:43:23 +0000
  LV Status              available
  # open                 1
  LV Size                <44.00 GiB
  Current LE             11263
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     4096
  Block device           253:0

Workaround
Use the lvs command instead of lvdisplay.

@prajnoha
Copy link
Member

prajnoha commented Mar 1, 2024

The pvdisplay does not use reporting infrastructure unlike pvs/vgs/lvs/lvm fullreport. Actually, the --reportformat should not be allowed with *display commands at all. If it worked before, maybe it just switched to pvs automatically. But if you want proper reporting and with JSON format, please use the pvs/vgs/lvs. The *display commands are supposed to have only a single human-readable format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants