Commit 33f2a81a authored by Iustin Pop's avatar Iustin Pop
Browse files

Treat virtual LVs as inexistent

Currently, “gnt-cluster verify” and “gnt-cluster verify-disks” use the
list of LVs as returned by backend.GetVolumeList to determine whether an
LV exists or not. However, LVs can also be ‘virtual’, which is handled
correctly (i.e. as missing) by the bdev code, but not by this function.

This patch changed GetVolumeList to simply skip virtual LVs; this makes
cluster verify and verify-disks report these correctly as missing. The
only downside is that an user could get confused (lvs reports the volume
as existing, but ganeti as missing). However, this is better than simply
considering virtual LVs as “good”.

No other code beside these two gnt-cluster operations uses the
GetVolumeList function, so we don't change the behaviour of the rest of
the code (e.g. replace-disks, instance info, etc.).
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 9216a9f7
......@@ -547,6 +547,11 @@ def GetVolumeList(vg_name):
name, size, attr = match.groups()
inactive = attr[4] == '-'
online = attr[5] == 'o'
virtual = attr[0] == 'v'
if virtual:
# we don't want to report such volumes as existing, since they
# don't really hold data
lvs[name] = (size, inactive, online)
return lvs
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment