Hi All,
Hi Roland!
So I tried to debug my "resize problem" (see below) further, and I think
I found the culprit -- including a patch:
drbdmanaged 0.99.12 tries to run the following command:
drbdadm -vvv -- --assume-clean -c
/var/lib/drbd.d/drbdmanage_vm-1001-disk-2.res resize vm-1001-disk-2/0
And this fails with "'vm-1001-disk-2/0' not defined in your config (for
this host)". And this is because the syntax of the command above is
wrong: the "-c /var/lib/drbd.d/drbdmanage_vm-1001-disk-2.res" is passed
to backend and not handled by drbdadm, because of the "--" in the
command line!
The right command to run would be the following:
drbdadm -vvv -c /var/lib/drbd.d/drbdmanage_vm-1001-disk-2.res --
--assume-clean resize vm-1001-disk-2/0
I patched the "resize" function in drbd/commands.py like this:
--- drbd/commands.py.orig 2017-05-24 14:25:29.000000000 +0200
+++ drbd/commands.py 2017-10-11 18:06:54.067422451 +0200
@@ -75,10 +75,10 @@
return 1
exec_args = [self.DRBDADM_UTIL, "-vvv"]
+ exec_args += self._direct_res(res_name)
if assume_clean:
exec_args.append("--")
exec_args.append("--assume-clean")
- exec_args += self._direct_res(res_name)
exec_args.append("resize")
exec_args.append(res_name + "/" + str(vol_id))
return self._run_drbdutils(exec_args)
... and now it works for me!
The signature of resize() is this:
def resize(self, res_name, vol_id, assume_clean):
So basically I thing this error will happen ieach time "assume_clean" is set.
What do you think?
Thanks!
Alex
Am 26.09.2017 um 17:53 schrieb Alexander Barton <abar...@thomas-daily.de>:
Hi all!
I’m playing with drbdmanage in a test setup (two node cluster), and “drbdmanage
resize” reproducibly fails for me.
Steps to reproduce:
$ drbdmanage new-volume -d 2 test 1
Operation completed successfully
Operation completed successfully
$ # check that everything is ok:
.drbdctrl role:Secondary
volume:0 disk:UpToDate
volume:1 disk:UpToDate
pvc1st02 role:Primary
volume:0 peer-disk:UpToDate
volume:1 peer-disk:UpToDate
test role:Secondary
disk:UpToDate
pvc1st02 role:Secondary
peer-disk:UpToDate
$ drbdmanage list-resources
+------------------------------------------------------------------------------+
| Name | | State |
|------------------------------------------------------------------------------|
| test | | ok |
+------------------------------------------------------------------------------+
$ drbdmanage list-volumes
+------------------------------------------------------------------------------+
| Name | Vol ID | Size | Minor | | State |
|------------------------------------------------------------------------------|
| test | 0 | 1 GiB | 110 | | ok |
+------------------------------------------------------------------------------+
Now everything looks ok on both nodes, volume was created with 1 GB in size.
Let’s resize it to 3 GB:
$ drbdmanage resize-volume test 0 3
Operation completed successfully
BUT:
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: INFO drbdsetup: External
command 'drbdsetup': Exit code 0
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: WARNING DrbdManager: Marked
storage resource 'test' volume 0 deployed because DRBD reports the volume
online and attached
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: WARNING DrbdManager: Marked
resource 'test' deployed because DRBD reports all its volumes deployed
Sep 26 17:50:55 pvc1st01 org.drbd.drbdmanaged[908]: Rounding size to boundary
between physical extents: 3.00 GiB.
Sep 26 17:50:55 pvc1st01 org.drbd.drbdmanaged[908]: Size of logical volume
drbdpool/test_00 changed from 1.00 GiB (257 extents) to 3.00 GiB (769 extents).
Sep 26 17:50:55 pvc1st01 dmeventd[868]: No longer monitoring thin pool
drbdpool-drbdthinpool-tpool.
Sep 26 17:50:55 pvc1st01 lvm[868]: Monitoring thin pool
drbdpool-drbdthinpool-tpool.
Sep 26 17:50:55 pvc1st01 org.drbd.drbdmanaged[908]: Logical volume
drbdpool/test_00 successfully resized.
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: INFO DrbdAdm: Running
external command: drbdadm --config-to-test
/var/lib/drbd.d/drbdmanage_test.res.tmp --config-to-exclude
/var/lib/drbd.d/drbdmanage_test.res sh-nop
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: INFO DrbdAdm: External
command 'drbdadm': Exit code 0
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: INFO DrbdAdm: Running
external command: drbdadm -c /var/lib/drbd.d/drbdmanage_test.res.tmp -d up test
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: INFO DrbdAdm: External
command 'drbdadm': Exit code 0
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: INFO DrbdAdm: Running
external command: drbdsetup wait-connect-resource --wait-after-sb=yes
--wfc-timeout=10 test
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: INFO DrbdAdm: External
command 'drbdsetup': Exit code 0
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: INFO DrbdAdm: Running
external command: drbdadm -vvv -- --assume-clean -c
/var/lib/drbd.d/drbdmanage_test.res resize test/0
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: ERROR DrbdAdm: External
command 'drbdadm': Exit code 1
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: ERROR drbdadm/stderr: 'test/0'
not defined in your config (for this host).
Sep 26 17:50:55 pvc1st01 drbdmanaged[1747]: ERROR Resizing resource 'test'
volume 0: DRBD resize command failed
… and “drbdmanage list-volumes” still shows the volume with 1 GB.
Sometimes I can see a “FAILED” in the “drbdmanage list-volumes” output, but not
all the time.
Any ideas?
Version information:
pvc1st01.int.dc3:~ # uname -a
Linux pvc1st01 4.10.17-3-pve #1 SMP PVE 4.10.17-21 (Thu, 31 Aug 2017 14:57:17
+0200) x86_64 GNU/Linux
pvc1st01.int.dc3:~ # cat /proc/drbd
version: 9.0.9-1 (api:2/proto:86-112)
GIT-hash: f7b979e7af01813e031aac579140237640c94569 build by root@debian9-wks01,
2017-09-20 13:07:09
Transports (api:16): tcp (9.0.9-1)
pvc1st01.int.dc3:~ # drbdmanage --version
drbdmanage 0.99.11; GIT-hash: 30082017f3c5487fac791d42bf48deb91c148204
Thanks!
Alex
_______________________________________________
drbd-user mailing list
drbd-user@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user