Add mount Gluster operation in CreateDisks.
Signed-off-by: Weiwei Jia <[email protected]>
---
lib/cmdlib/instance_storage.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/lib/cmdlib/instance_storage.py b/lib/cmdlib/instance_storage.py
index 793cfa6..ff2e585 100644
--- a/lib/cmdlib/instance_storage.py
+++ b/lib/cmdlib/instance_storage.py
@@ -254,6 +254,21 @@ def CreateDisks(lu, instance, to_skip=None,
target_node_uuid=None, disks=None):
" node %s" % (file_storage_dir,
lu.cfg.GetNodeName(pnode_uuid)))
+ gluster_storage_dir = file_storage_dir
+ diskparams = lu.cfg.GetClusterInfo().diskparams
+ for template, dt_params in diskparams.items():
+ if template == constants.DT_GLUSTER_FILE:
+ gluster_volname = dt_params[constants.LDP_VOLNAME]
+ gluster_hostname = dt_params[constants.LDP_HOSTNAME]
+ result = lu.rpc.call_mount_gluster_storage_dir(pnode_uuid,
+ gluster_hostname,
+ gluster_volname,
+ gluster_storage_dir)
+
+ result.Raise("Failed to mount directory '%s' on"
+ " node %s" % (gluster_storage_dir,
+ lu.cfg.GetNodeName(pnode_uuid)))
+
disks_created = []
for idx, device in enumerate(disks):
if to_skip and idx in to_skip:
--
1.7.10.4