Signed-off-by: Weiwei Jia <[email protected]>
---
lib/cmdlib/instance_storage.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/lib/cmdlib/instance_storage.py b/lib/cmdlib/instance_storage.py
index 4c602ae..bfb7324 100644
--- a/lib/cmdlib/instance_storage.py
+++ b/lib/cmdlib/instance_storage.py
@@ -255,6 +255,22 @@ def CreateDisks(lu, instance, to_skip=None,
target_node_uuid=None, disks=None):
" node %s" % (file_storage_dir,
lu.cfg.GetNodeName(pnode_uuid)))
+ if instance.disk_template == constants.DT_GLUSTER_FILE:
+ gluster_storage_dir = lu.cfg.GetClusterInfo().gluster_file_storage_dir
+ if not os.path.ismount(gluster_storage_dir):
+ diskparams = lu.cfg.GetClusterInfo().diskparams
+ glusterparams = diskparams[constants.DT_GLUSTER_FILE]
+ gluster_volname = glusterparams[constants.LDP_VOLNAME]
+ gluster_hostname = glusterparams[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