kvaps / linstor-backup-script

Script for export linstor configuration as simple commands
Apache License 2.0
0 stars 1 forks source link

storage-pool-definition syntax error #1

Open IdahoPL opened 2 years ago

IdahoPL commented 2 years ago
# ./linstor-backup.sh | tee linstor_$(date +%Y-%m-%d).sh
# Linstor configuration file
# Generated by: linstor-backup.sh (0.3.2)
# Date:         Tue 29 Mar 2022 01:20:28 PM CEST
# Controller:   linstor controller 1.17.0; GIT-hash: 7e646d83dbbadf1ec066e1bc8b29ae018aff1f66
# Client:       linstor 1.12.0; GIT-hash: 5fa38bfb6b3ea18cda87aeafeedafc6b04103924

# Controller Options
[...]

# Nodes
[...]

# Node Interfaces

# Storage Pool Definitions
usage: linstor [-h] [--version] [--no-color] [--no-utf8] [--warn-as-error]
               [--curl] [--controllers CONTROLLERS] [-m]
               [--output-version {v0,v1}] [--verbose] [-t TIMEOUT]
               [--disable-config] [--user USER] [--password PASSWORD]
               [--certfile CERTFILE] [--keyfile KEYFILE] [--cafile CAFILE]
               [--allow-insecure-auth]
               {advise, backup, controller, drbd-proxy, encryption,
               error-reports, exos, file, help, interactive, list-commands,
               node, physical-storage, remote, resource, resource-connection,
               resource-definition, resource-group, snapshot, sos-report,
               space-reporting, storage-pool, volume, volume-definition,
               volume-group} ...
linstor: error: argument {advise, backup, controller, drbd-proxy, encryption, error-reports, exos, file, help, interactive, list-commands, node, physical-storage, remote, resource, resource-connection, resource-definition, resource-group, snapshot, sos-report, space-reporting, storage-pool, volume, volume-definition, volume-group}: invalid choice: 'storage-pool-definition' (choose from 'interactive', 'help', 'list-commands', 'commands', 'list', 'exit', 'quit', 'controller', 'c', 'node', 'n', 'resource-definition', 'rd', 'resource-group', 'rg', 'volume-group', 'vg', 'resource', 'r', 'resource-connection', 'rc', 'volume', 'v', 'snapshot', 's', 'drbd-proxy', 'proxy', 'storage-pool', 'sp', 'volume-definition', 'vd', 'physical-storage', 'ps', 'error-reports', 'err', 'exos', 'advise', 'adv', 'backup', 'b', 'remote', 'file', 'f', 'encryption', 'e', 'sos-report', 'sos', 'space-reporting', 'spr', 'dm-migrate', 'gen-zsh-completer')

linstor -m storage-pool-definition list throws syntax error.

# linstor -m storage-pool-definition list
usage: linstor [-h] [--version] [--no-color] [--no-utf8] [--warn-as-error]
               [--curl] [--controllers CONTROLLERS] [-m]
               [--output-version {v0,v1}] [--verbose] [-t TIMEOUT]
               [--disable-config] [--user USER] [--password PASSWORD]
               [--certfile CERTFILE] [--keyfile KEYFILE] [--cafile CAFILE]
               [--allow-insecure-auth]
               {advise, backup, controller, drbd-proxy, encryption,
               error-reports, exos, file, help, interactive, list-commands,
               node, physical-storage, remote, resource, resource-connection,
               resource-definition, resource-group, snapshot, sos-report,
               space-reporting, storage-pool, volume, volume-definition,
               volume-group} ...
linstor: error: argument {advise, backup, controller, drbd-proxy, encryption, error-reports, exos, file, help, interactive, list-commands, node, physical-storage, remote, resource, resource-connection, resource-definition, resource-group, snapshot, sos-report, space-reporting, storage-pool, volume, volume-definition, volume-group}: invalid choice: 'storage-pool-definition' (choose from 'interactive', 'help', 'list-commands', 'commands', 'list', 'exit', 'quit', 'controller', 'c', 'node', 'n', 'resource-definition', 'rd', 'resource-group', 'rg', 'volume-group', 'vg', 'resource', 'r', 'resource-connection', 'rc', 'volume', 'v', 'snapshot', 's', 'drbd-proxy', 'proxy', 'storage-pool', 'sp', 'volume-definition', 'vd', 'physical-storage', 'ps', 'error-reports', 'err', 'exos', 'advise', 'adv', 'backup', 'b', 'remote', 'file', 'f', 'encryption', 'e', 'sos-report', 'sos', 'space-reporting', 'spr', 'dm-migrate', 'gen-zsh-completer')
kvaps commented 2 years ago

Hi, this script was written for older versions of linstor, so storage-pool-definition no longer required, you can just remove these lines:

https://github.com/kvaps/linstor-backup-script/blob/245e5da8ebd4d2f1d86b493bfdb93fd21c3fff60/linstor-backup.sh#L41-L50

kvaps commented 2 years ago

However this script is not able to export resource-groups and create resource-definitions with resource-group specified (yet).

Some usable commands to manage resource-groups:

linstor -m resource-group list
linstor resource-group create --help

and resource definitions :

linstor -m --output-version=v1 resource-definition list | jq -jr '.[][] | .name, " ", .resource_group_name, "\n"'
linstor resource-definition create --resource-group

PRs are wellcome.