Commit 7ec47185 authored by Dimitris Bliablias's avatar Dimitris Bliablias Committed by Petr Pudlak

Add Gluster type to the node storage reporting set

This patch, adds the 'gluster' storage type to the set of storage types
for which full node storage reporting is available. This set is used by
the 'LUNodeQueryStorage' logical unit for getting information on storage
units on node(s).
Signed-off-by: default avatarDimitris Bliablias <bl.dimitris@gmail.com>
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent ba550291
...@@ -90,6 +90,7 @@ _USER_STORAGE_TYPE = { ...@@ -90,6 +90,7 @@ _USER_STORAGE_TYPE = {
constants.ST_LVM_PV: "lvm-pv", constants.ST_LVM_PV: "lvm-pv",
constants.ST_LVM_VG: "lvm-vg", constants.ST_LVM_VG: "lvm-vg",
constants.ST_SHARED_FILE: "sharedfile", constants.ST_SHARED_FILE: "sharedfile",
constants.ST_GLUSTER: "gluster",
} }
_STORAGE_TYPE_OPT = \ _STORAGE_TYPE_OPT = \
......
...@@ -1147,13 +1147,9 @@ def _GetStorageTypeArgs(cfg, storage_type): ...@@ -1147,13 +1147,9 @@ def _GetStorageTypeArgs(cfg, storage_type):
if storage_type == constants.ST_FILE: if storage_type == constants.ST_FILE:
return [[cfg.GetFileStorageDir()]] return [[cfg.GetFileStorageDir()]]
elif storage_type == constants.ST_SHARED_FILE: elif storage_type == constants.ST_SHARED_FILE:
dts = cfg.GetClusterInfo().enabled_disk_templates return [[cfg.GetSharedFileStorageDir()]]
paths = [] elif storage_type == constants.ST_GLUSTER:
if constants.DT_SHARED_FILE in dts: return [[cfg.GetGlusterStorageDir()]]
paths.append(cfg.GetSharedFileStorageDir())
if constants.DT_GLUSTER in dts:
paths.append(cfg.GetGlusterStorageDir())
return [paths]
else: else:
return [] return []
......
...@@ -471,6 +471,7 @@ _STORAGE_TYPES = { ...@@ -471,6 +471,7 @@ _STORAGE_TYPES = {
constants.ST_LVM_PV: LvmPvStorage, constants.ST_LVM_PV: LvmPvStorage,
constants.ST_LVM_VG: LvmVgStorage, constants.ST_LVM_VG: LvmVgStorage,
constants.ST_SHARED_FILE: FileStorage, constants.ST_SHARED_FILE: FileStorage,
constants.ST_GLUSTER: FileStorage,
} }
......
...@@ -451,7 +451,7 @@ parsing by scripts. In both cases, the ``--units`` option can be ...@@ -451,7 +451,7 @@ parsing by scripts. In both cases, the ``--units`` option can be
used to enforce a given output unit. used to enforce a given output unit.
The ``--storage-type`` option can be used to choose a storage unit The ``--storage-type`` option can be used to choose a storage unit
type. Possible choices are lvm-pv, lvm-vg or file. type. Possible choices are lvm-pv, lvm-vg, file, sharedfile and gluster.
The ``-o (--output)`` option takes a comma-separated list of output The ``-o (--output)`` option takes a comma-separated list of output
fields. The available fields and their meaning are: fields. The available fields and their meaning are:
......
...@@ -737,7 +737,9 @@ stsReport = ConstantUtils.mkSet [stFile, stLvmPv, stLvmVg] ...@@ -737,7 +737,9 @@ stsReport = ConstantUtils.mkSet [stFile, stLvmPv, stLvmVg]
-- | (as used by LUQueryNodeStorage) -- | (as used by LUQueryNodeStorage)
stsReportNodeStorage :: FrozenSet String stsReportNodeStorage :: FrozenSet String
stsReportNodeStorage = ConstantUtils.union stsReport $ stsReportNodeStorage = ConstantUtils.union stsReport $
ConstantUtils.mkSet [stSharedFile] ConstantUtils.mkSet [ stSharedFile
, stGluster
]
-- * Storage fields -- * Storage fields
-- ** First two are valid in LU context only, not passed to backend -- ** First two are valid in LU context only, not passed to backend
......
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