linstor-gateway icon indicating copy to clipboard operation
linstor-gateway copied to clipboard

Linstor gateway command upgrade is ignoring -c connect string

Open marcellinus77 opened this issue 9 months ago • 1 comments

Linstor gateway command upgrade is ignoring -c connect string

root@node-4:~# linstor-gateway -c http://1.2.3.4:8080 nfs upgrade linstor-nfs
ERRO[0000] failed to upgrade drbd options: failed to get resource definition: Get "http://localhost:3370/v1/resource-definitions/linstor-nfs": dial tcp 127.0.0.1:3370: connect: connection refused 

marcellinus77 avatar Mar 30 '25 23:03 marcellinus77

The upgrade commands do not actually connect to the linstor-gateway server but rather to LINSTOR directly. I can see how that behavior is counter-intuitive, but there is a technical reason for it.

The correct way to use the command is to supply a list of LINSTOR controllers to try to connect to. You can do that by:

  • Putting a list of controllers in /etc/linstor-gateway/linstor-gateway.toml:
    [linstor]
    controllers = [ "1.2.3.4:3370" ]
    
  • Setting the LS_CONTROLLERS environment variable to a comma-separated list of controllers
  • Or using the --controllers flag of the upgrade command to supply the same comma-separated list.

Thanks for the report, I'll think of a way to make this more evident in the documentation.

chrboe avatar Mar 31 '25 12:03 chrboe