]> git.proxmox.com Git - pve-storage.git/commitdiff
drbd: call set_drbdsetup_props after auto-deploy
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 17 Jun 2015 09:23:52 +0000 (11:23 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 17 Jun 2015 09:33:49 +0000 (11:33 +0200)
Else it gets not assigned. For some unknown reason, we need to sleep
to avoid a split brain?!

PVE/Storage/DRBDPlugin.pm

index ca800368b98c44a20563ea3ce444815ace933e6b..e1d6a6055a56bdb863931f69bd7eb4ac52c2b871 100644 (file)
@@ -180,15 +180,6 @@ sub alloc_image {
     my ($rc, $res) = $hdl->create_resource($name, {});
     check_drbd_rc($rc->[0]);
 
-    ($rc, $res) = $hdl->set_drbdsetup_props(
-       { 
-           target => "resource",
-           resource => $name,
-           type => 'neto',
-           'allow-two-primaries' => 'yes',
-       });
-    check_drbd_rc($rc->[0]);
-   
     ($rc, $res) = $hdl->create_volume($name, $size, {});
     check_drbd_rc($rc->[0]);
 
@@ -197,6 +188,17 @@ sub alloc_image {
     ($rc, $res) = $hdl->auto_deploy($name, $redundancy, 0, 0);
     check_drbd_rc($rc->[0]);
 
+    sleep(5); # else we get split brain?!
+    
+    ($rc, $res) = $hdl->set_drbdsetup_props(
+       { 
+           target => "resource",
+           resource => $name,
+           type => 'neto',
+           'allow-two-primaries' => 'yes',
+       });
+    check_drbd_rc($rc->[0]);
     return $name;
 }