summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commands/storage/lmi/scripts/storage/common.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/commands/storage/lmi/scripts/storage/common.py b/commands/storage/lmi/scripts/storage/common.py
index 57824cf..ea43e7f 100644
--- a/commands/storage/lmi/scripts/storage/common.py
+++ b/commands/storage/lmi/scripts/storage/common.py
@@ -354,6 +354,15 @@ def get_parents(ns, obj, deep=False):
yield parent
elif lmi_isinstance(obj, ns.CIM_StoragePool):
+ # find VGs of the thin pool
+ assoc_class = "LMI_VGAllocatedFromStoragePool"
+ if assoc_class in ns.classes():
+ parents = obj.associators(
+ AssocClass=assoc_class,
+ Role="Dependent")
+ for parent in parents:
+ yield parent
+
# find physical volumes of the VG
parents = obj.associators(
AssocClass="LMI_VGAssociatedComponentExtent",
@@ -438,6 +447,15 @@ def get_children(ns, obj, deep=False):
yield c
elif lmi_isinstance(obj, ns.CIM_StoragePool):
+ # find thin pools from the VG
+ assoc_class = "LMI_VGAllocatedFromStoragePool"
+ if assoc_class in ns.classes():
+ children = obj.associators(
+ AssocClass=assoc_class,
+ Role="Antecedent")
+ for child in children:
+ yield child
+
# find LVs allocated from the VG
children = obj.associators(
AssocClass="LMI_LVAllocatedFromStoragePool",