Merge branch 'stable-2.10' into stable-2.11
[ganeti-github.git] / lib / cmdlib / instance_storage.py
index fe3f23a..215db32 100644 (file)
@@ -43,7 +43,7 @@ from ganeti import locking
 from ganeti.masterd import iallocator
 from ganeti import objects
 from ganeti import utils
-from ganeti import rpc
+import ganeti.rpc.node as rpc
 from ganeti.cmdlib.base import LogicalUnit, NoHooksLU, Tasklet
 from ganeti.cmdlib.common import INSTANCE_DOWN, INSTANCE_NOT_RUNNING, \
   AnnotateDiskParams, CheckIAllocatorOrNode, ExpandNodeUuidAndName, \
@@ -296,6 +296,7 @@ def ComputeDiskSizePerVG(disk_template, disks):
     constants.DT_DRBD8: _compute(disks, constants.DRBD_META_SIZE),
     constants.DT_FILE: {},
     constants.DT_SHARED_FILE: {},
+    constants.DT_GLUSTER: {},
     }
 
   if disk_template not in req_size_dict:
@@ -470,7 +471,12 @@ def GenerateDiskTemplate(
         vg = disk.get(constants.IDISK_VG, vgname)
         return (vg, names[idx])
 
-    elif template_name in (constants.DT_FILE, constants.DT_SHARED_FILE):
+    elif template_name == constants.DT_GLUSTER:
+      logical_id_fn = lambda _1, disk_index, _2: \
+        (file_driver, "ganeti/%s.%d" % (instance_uuid,
+                                        disk_index))
+
+    elif template_name in constants.DTS_FILEBASED: # Gluster handled above
       logical_id_fn = \
         lambda _, disk_index, disk: (file_driver,
                                      "%s/%s" % (file_storage_dir,