LINBIT / drbd-utils

DRBD userspace utilities (for 9.x, 8.4, 8.3)
GNU General Public License v2.0
78 stars 46 forks source link

The problem of `drbdsetup status --json`in version 8.9.10 #10

Closed zeaone closed 2 years ago

zeaone commented 2 years ago

When using the drbdsetup status all --json command in version 8.9.10(in picture 1), the prompt --json option does not exist (In picture 2), but you can see the --json option when executing drbdsetup status -h(In picture 3)

picture 1

picture 2

picture 3

rck commented 2 years ago

thanks for reporting that. json output is only supported in DRBD9, listing --json here is most likely because of some shared code. I consider this a very minor issue, let's see when time actually allows to fix that.

Also, somebody should tell the Debian people that they ship very very old drbd-utils. drbd-utils 9.X still support kernel module 8 DRBD versions. By shipping that old drbd-utils they just make it hard for people to try new (out of tree) DRBD 9.0/9.1/... kernel module versions

lge commented 2 years ago

Please use drbd-utils 9.19 (current at the time of writing) or even more recent (depending on when you pull this note out of the archives). Yes, even with DRBD kernel module version 8.4; the utils version is independent of the kernel module version. There have even been 8.4 relevant fixes since 2016 (the release date of 8.9.10) ...

The way we support 8.4 with the current utils is: we ship an extra binary, /lib/drbd/drbdsetup-8.4. drbdsetup executes the current binary, intended to be used with the current kernel module version. Which is also where the "help" output comes from. Once drbdsetup actually needs to do something, it detects the version of the currently loaded kernel module, and re-execs the drbdsetup-8.4 or even drbdsetup-8.3 binary if appropriate. That's when the "--json" goes wrong.

drbdsetup-8.4 status -h should show USAGE: drbdsetup-84 status {resource|all} [--verbose] [--statistics] [--color=...]

We never implemented the json flavor of status output for 8.4. Intentionally. If you feel the need for it, you are apparently writing some kind of "integration". You should base that on current versions of DRBD (and current utils versions as well). Not on beyond-end-of-life versions.

Thanks, Lars Ellenberg

zeaone commented 2 years ago

Please use drbd-utils 9.19 (current at the time of writing) or even more recent (depending on when you pull this note out of the archives). Yes, even with DRBD kernel module version 8.4; the utils version is independent of the kernel module version. There have even been 8.4 relevant fixes since 2016 (the release date of 8.9.10) ... The way we support 8.4 with the current utils is: we ship an extra binary, /lib/drbd/drbdsetup-8.4. drbdsetup executes the current binary, intended to be used with the current kernel module version. Which is also where the "help" output comes from. Once drbdsetup actually needs to do something, it detects the version of the currently loaded kernel module, and re-execs the drbdsetup-8.4 or even drbdsetup-8.3 binary if appropriate. That's when the "--json" goes wrong. drbdsetup-8.4 status -h should show USAGE: drbdsetup-84 status {resource|all} [--verbose] [--statistics] [--color=...] We never implemented the json flavor of status output for 8.4. Intentionally. If you feel the need for it, you are apparently writing some kind of "integration". You should base that on current versions of DRBD (and current utils versions as well). Not on beyond-end-of-life versions. Thanks, Lars Ellenberg

thanks for your reply,If I update drbd-utils to version 9.19 and keep my drbd kernel version as 8.4.10. Can I use drbdsetup status all --json to get json output?

zeaone commented 2 years ago

thanks for reporting that. json output is only supported in DRBD9, listing --json here is most likely because of some shared code. I consider this a very minor issue, let's see when time actually allows to fix that.

Also, somebody should tell the Debian people that they ship very very old drbd-utils. drbd-utils 9.X still support kernel module 8 DRBD versions. By shipping that old drbd-utils they just make it hard for people to try new (out of tree) DRBD 9.0/9.1/... kernel module versions

thanks for your reply ,I will to upgrade my drbd-utils version

zeph commented 8 months ago

i did upgrade, to latest ubuntu LTS noble which has the latest available package for such... ii drbd-utils 9.22.0-1 amd64 RAID 1 over TCP/IP for Linux (user utilities)

(this utility is being used by LINSTOR / piraeus-operator) it still fails not recognizing the --json option therefore all the DaemonSet pods of ha-controller are failing with

- ha-controller-mbssn › ha-controller
 18:49:16.384018       1 agent.go:205] caches synced
 18:49:16.384044       1 agent.go:228] starting reconciliation
 18:49:16.384313       1 run.go:74] "command failed" err="failed to execute drbdsetup status --json: exit status 20"
rck commented 8 months ago

JFI if somebody lands here: the usual "wrong module loaded" case as always: https://github.com/piraeusdatastore/piraeus-operator/issues/587#issuecomment-1880557474