Project

General

Profile

Bug #62693

Update nvme gw cli usage with proper entities

Added by Rahul Lepakshi 6 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Currently, nvme-cli usage reports "python3 -m control.cli" in it and also help [-h] command reports the same. this is incorrect incase of container/orchestration support.

This is applicable to all creation/deletion of NVMeOFGW components like bdev, NS, subsystem

# podman run quay.io/ceph/nvmeof-cli:0.0.2 --server-address 10.0.209.219 --server-port 5500 add_namespace -h 
usage: python3 -m control.cli add_namespace [-h] -n SUBNQN -b BDEV [-i NSID]Adds a namespace to a subsystem.optional arguments:  -h, --help            show this help message and exit  -n SUBNQN, --subnqn SUBNQN                        Subsystem NQN  -b BDEV, --bdev BDEV  Bdev name  -i NSID, --nsid NSID  Namespace ID

[root@ceph-nvmf1-g4htpa-node5 cephuser]# podman run -it quay.io/ceph/nvmeof-cli:0.0.2 --server-address 10.0.209.219 --server-port 5500 get_subsystems -h
usage: python3 -m control.cli get_subsystems [-h]

Gets subsystems.

optional arguments:
  -h, --help  show this help message and exit

[root@ceph-nvmf1-g4htpa-node5 cephuser]# podman run -it quay.io/ceph/nvmeof-cli:0.0.2 --server-address 10.0.209.219 --server-port 5500 create_bdev 
usage: python3 -m control.cli create_bdev [-h] -i IMAGE -p POOL [-b BDEV] [-s BLOCK_SIZE]python3 -m control.cli create_bdev: error: the following arguments are required: -i/--image, -p/--pool
[root@ceph-2sunilkumar-ebqdit-node6 ~]# podman run -it quay.io/ceph/nvmeof-cli:0.0.2 sh
usage: python3 -m control.cli [-h] [--server-address SERVER_ADDRESS] [--server-port SERVER_PORT] [--client-key CLIENT_KEY] [--client-cert CLIENT_CERT] [--server-cert SERVER_CERT] 
                             {create_bdev,delete_bdev,create_subsystem,delete_subsystem,add_namespace,remove_namespace,add_host,remove_host,create_listener,delete_listener,get_subsystems} ...python3 -m control.cli: error: argument subcommand: invalid choice: 'sh' (choose from 'create_bdev', 'delete_bdev', 'create_subsystem', 'delete_subsystem', 'add_namespace', 'remove_namespace', 'add_host', 'remove_host', 'create_listener', 'delete_listener', 'get_subsystems')

Expectation is like - usage should not report "control" module with "python3 -m control.cli"

History

#1 Updated by Rahul Lepakshi 6 months ago

github issue for dealing nvmeof cli issues - https://github.com/ceph/ceph-nvmeof/issues/212

#2 Updated by Ernesto Puerta 3 months ago

Hey Rahul,

What's the issue here? Containers usually wrap the main command under the ENTRYPOINT, and the arguments as CMD. You can see that here:

CMD []
ENTRYPOINT ["python3" "-m" "control.cli"]

That way, users of the container don't have to write the whole podman run ... python3 -m control.cli --server-address ..., but just pass the arguments. This was made this way for the sake of user-friendliness, but if that's too counterintuitive, we can simply force users to specify the whole python3 -m control.cli line. Would that address your concern?

Also available in: Atom PDF