Support DRBD 8.4.3 command syntax
authorThomas Thrainer <thomasth@google.com>
Thu, 2 May 2013 15:10:32 +0000 (17:10 +0200)
committerGuido Trotter <ultrotter@google.com>
Fri, 3 May 2013 07:42:06 +0000 (09:42 +0200)
DRBD 8.4.3 does not support specifying volume ids directly while
creating the meta device. It requires a slightly different syntax (using
flex-external as volume id) which is fortunately also supported by (at
least) DRBD 8.4.2.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

lib/block/drbd_cmdgen.py

index 35ee875..b82aaaa 100644 (file)
@@ -306,7 +306,7 @@ class DRBD84CmdGenerator(BaseDRBDCmdGenerator):
 
   def GenInitMetaCmd(self, minor, meta_dev):
     return ["drbdmeta", "--force", self._DevPath(minor),
-            "v08", meta_dev, "0", "create-md"]
+            "v08", meta_dev, "flex-external", "create-md"]
 
   def GenLocalInitCmds(self, minor, data_dev, meta_dev, size_mb, params):
     cmds = []
@@ -317,9 +317,9 @@ class DRBD84CmdGenerator(BaseDRBDCmdGenerator):
     # We need to apply the activity log before attaching the disk else drbdsetup
     # will fail.
     cmds.append(["drbdmeta", self._DevPath(minor),
-                 "v08", meta_dev, "0", "apply-al"])
+                 "v08", meta_dev, "flex-external", "apply-al"])
 
-    attach_cmd = ["drbdsetup", "attach", minor, data_dev, meta_dev, "0",
+    attach_cmd = ["drbdsetup", "attach", minor, data_dev, meta_dev, "flexible",
                   "--on-io-error=detach"]
     if size_mb:
       attach_cmd.extend(["--size", "%sm" % size_mb])