Skip to content

Also report VG-s / PV-s when a VG has no LV#166

Merged
ogayot merged 3 commits intocanonical:mainfrom
ogayot:lvm-vg-no-lv
Mar 9, 2026
Merged

Also report VG-s / PV-s when a VG has no LV#166
ogayot merged 3 commits intocanonical:mainfrom
ogayot:lvm-vg-no-lv

Conversation

@ogayot
Copy link
Copy Markdown
Member

@ogayot ogayot commented Mar 5, 2026

Previously, probert did not list a VG (or associated PVs) if there is no LV inside of it.

Having the information about empty VGs is important when Subiquity generates the name of a VG to create. Indeed, the name it generates must not conflict with any existing ones, otherwise, LVM will refuse to create it.

Fixed by listing VGs that have no LV as well.

LP:#2143299

I also fixed an issue where probert would error-log "Found duplicate volume group" for all VG-s that have more than one LV.

For a VG with 11 LVs, we previously got 10 misleading "duplicates" errors:

2026-03-06 09:40:46,963 ERROR probert.lvm:233 Found duplicate volume group: testvg
2026-03-06 09:40:46,963 ERROR probert.lvm:233 Found duplicate volume group: testvg
2026-03-06 09:40:46,963 ERROR probert.lvm:233 Found duplicate volume group: testvg
2026-03-06 09:40:46,964 ERROR probert.lvm:233 Found duplicate volume group: testvg
2026-03-06 09:40:46,967 ERROR probert.lvm:233 Found duplicate volume group: testvg
2026-03-06 09:40:46,967 ERROR probert.lvm:233 Found duplicate volume group: testvg
2026-03-06 09:40:46,968 ERROR probert.lvm:233 Found duplicate volume group: testvg
2026-03-06 09:40:46,969 ERROR probert.lvm:233 Found duplicate volume group: testvg
2026-03-06 09:40:46,969 ERROR probert.lvm:233 Found duplicate volume group: testvg
2026-03-06 09:40:46,969 ERROR probert.lvm:233 Found duplicate volume group: testvg

which is obviously wrong.

We want the VG name to be the identifier, and since we're passing the VG name
to the extract_lvm_volume_group function, we don't need to return it.

The caller already has all the info that they need.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
ogayot added 2 commits March 6, 2026 10:45
If a VG has two or more LVs (which is very common), probert mistakenly assumes
there is a "duplicate VG" and logs it as an error.

But this is plain wrong. Probert loops through all the LV-s and checks whether
the LV's underlying VG has already been discovered.

So for a VG with 5 LV-s, probert will claim that there are duplicate VG-s 4
times.

This was reported as an observation in LP: #1941968.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Previously, probert did not list a VG (or associated PVs) if there is no LV
inside of it.

Having the information about empty VGs is important when Subiquity generates
the name of a VG to create. Indeed, the name it generates must not conflict
with any existing ones, otherwise, LVM will refuse to create it.

Fixed by listing VGs that have no LV as well.

LP: #2143299

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Copy link
Copy Markdown
Collaborator

@Chris-Peterson444 Chris-Peterson444 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@ogayot ogayot merged commit 4d33326 into canonical:main Mar 9, 2026
2 checks passed
@ogayot ogayot deleted the lvm-vg-no-lv branch March 9, 2026 10:30
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

Successfully merging this pull request may close these issues.

2 participants