Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Namespace masking] List host_nqns per namespace with namespace list command #1085

Closed
rahullepakshi opened this issue Feb 4, 2025 · 5 comments · Fixed by #893
Closed

[Namespace masking] List host_nqns per namespace with namespace list command #1085

rahullepakshi opened this issue Feb 4, 2025 · 5 comments · Fixed by #893

Comments

@rahullepakshi
Copy link
Contributor

Currently, there is no CLI that lists hostnqn's that are added through namespace add_host command. Upon scaling namespaces to larger numbers, providing hostnqn's that are added to a particular namespace will help user to track visibility of namespaces across all initiators.

Proposing to list hostNQN's column in below output

# podman run --rm quay.io/ceph/nvmeof-cli:latest --server-address 10.0.64.4 namespace list -n nqn.2016-06.io.spdk:cnode1.group1
Namespaces in subsystem nqn.2016-06.io.spdk:cnode1.group1:
╒════════╤════════════════════════╤════════════╤═════════╤═══════════╤═════════════════════╤═════════════╤══════════════╤═══════════╤═══════════╤════════════╤═════════════╕
│   NSID │ Bdev                   │ RBD        │ Image   │ Block     │ UUID                │        Load │ Visibility   │ R/W IOs   │ R/W MBs   │ Read MBs   │ Write MBs   │
│        │ Name                   │ Image      │ Size    │ Size      │                     │   Balancing │              │ per       │ per       │ per        │ per         │
│        │                        │            │         │           │                     │       Group │              │ second    │ second    │ second     │ second      │
╞════════╪════════════════════════╪════════════╪═════════╪═══════════╪═════════════════════╪═════════════╪══════════════╪═══════════╪═══════════╪════════════╪═════════════╡
│      1 │ bdev_9b84c869-6157-    │ rbd/image1 │ 1 GiB   │ 512 Bytes │ 9b84c869-6157-42b9- │           1 │ Restrictive  │ unset     │ unset     │ unset      │ unset       │
│        │ 42b9-82e0-46284c29138c │            │         │           │ 82e0-46284c29138c   │             │              │           │           │            │             │
├────────┼────────────────────────┼────────────┼─────────┼───────────┼─────────────────────┼─────────────┼──────────────┼───────────┼───────────┼────────────┼─────────────┤
│      2 │ bdev_c266771e-7b20-    │ rbd/image2 │ 1 GiB   │ 512 Bytes │ c266771e-7b20-4cfb- │           2 │ Restrictive  │ unset     │ unset     │ unset      │ unset       │
│        │ 4cfb-8d5d-3d7e78970916 │            │         │           │ 8d5d-3d7e78970916   │             │              │           │           │            │             │
├────────┼────────────────────────┼────────────┼─────────┼───────────┼─────────────────────┼─────────────┼──────────────┼───────────┼───────────┼────────────┼─────────────┤
│      3 │ bdev_8e1433c9-a32b-    │ rbd/image3 │ 1 GiB   │ 512 Bytes │ 8e1433c9-a32b-4a65- │           3 │ Restrictive  │ unset     │ unset     │ unset      │ unset       │
│        │ 4a65-88e7-d6e8cdb346d2 │            │         │           │ 88e7-d6e8cdb346d2   │             │              │           │           │            │             │
├────────┼────────────────────────┼────────────┼─────────┼───────────┼─────────────────────┼─────────────┼──────────────┼───────────┼───────────┼────────────┼─────────────┤
│      4 │ bdev_eae52f96-ba40-    │ rbd/image4 │ 1 GiB   │ 512 Bytes │ eae52f96-ba40-4abb- │           4 │ Restrictive  │ unset     │ unset     │ unset      │ unset       │
│        │ 4abb-ab2d-ef1de31bd883 │            │         │           │ ab2d-ef1de31bd883   │             │              │           │           │            │             │
├────────┼────────────────────────┼────────────┼─────────┼───────────┼─────────────────────┼─────────────┼──────────────┼───────────┼───────────┼────────────┼─────────────┤
│      5 │ bdev_e2f8b0c1-c81b-    │ rbd/image5 │ 1 GiB   │ 512 Bytes │ e2f8b0c1-c81b-4380- │           4 │ Restrictive  │ unset     │ unset     │ unset      │ unset       │
│        │ 4380-960c-a46b341b005d │            │         │           │ 960c-a46b341b005d   │             │              │           │           │            │             │
├────────┼────────────────────────┼────────────┼─────────┼───────────┼─────────────────────┼─────────────┼──────────────┼───────────┼───────────┼────────────┼─────────────┤
│      6 │ bdev_8a167c9e-8ccb-    │ rbd/image6 │ 1 GiB   │ 512 Bytes │ 8a167c9e-8ccb-4d6a- │           3 │ Restrictive  │ unset     │ unset     │ unset      │ unset       │
│        │ 4d6a-9a3a-26d9b75b6d3b │            │         │           │ 9a3a-26d9b75b6d3b   │             │              │           │           │            │             │
├────────┼────────────────────────┼────────────┼─────────┼───────────┼─────────────────────┼─────────────┼──────────────┼───────────┼───────────┼────────────┼─────────────┤
│      7 │ bdev_41bce73b-93ae-    │ rbd/image7 │ 1 GiB   │ 512 Bytes │ 41bce73b-93ae-4e7a- │           2 │ Restrictive  │ unset     │ unset     │ unset      │ unset       │
│        │ 4e7a-ad67-e41f997b2484 │            │         │           │ ad67-e41f997b2484   │             │              │           │           │            │             │
├────────┼────────────────────────┼────────────┼─────────┼───────────┼─────────────────────┼─────────────┼──────────────┼───────────┼───────────┼────────────┼─────────────┤
│      8 │ bdev_a83c947b-a0da-    │ rbd/image8 │ 1 GiB   │ 512 Bytes │ a83c947b-a0da-44eb- │           1 │ Restrictive  │ unset     │ unset     │ unset      │ unset       │
│        │ 44eb-92b4-2a9ae8100a7b │            │         │           │ 92b4-2a9ae8100a7b   │             │              │           │           │            │             │
╘════════╧════════════════════════╧════════════╧═════════╧═══════════╧═════════════════════╧═════════════╧══════════════╧═══════════╧═══════════╧════════════╧═════════════╛


@gbregman
Copy link
Collaborator

gbregman commented Feb 4, 2025

@rahullepakshi this is not true. You were using an old CLI. In the latest CLI it seems like that:

root@gil-vm:/home/ceph/gil-ceph-nvmeof> cephnvmf namespace list -n  nqn.2016-06.io.spdk:cnode1
Namespaces in subsystem nqn.2016-06.io.spdk:cnode1:
╒════════════════════════════╤════════╤════════════════════════╤════════════════╤═════════╤═══════════╤═════════════════════╤═════════════╤══════════════════════════════════════╤═══════════╤═══════════╤════════════╤═════════════╕
│ NQN                        │   NSID │ Bdev                   │ RBD            │ Image   │ Block     │ UUID                │        Load │ Visibility                           │ R/W IOs   │ R/W MBs   │ Read MBs   │ Write MBs   │
│                            │        │ Name                   │ Image          │ Size    │ Size      │                     │   Balancing │                                      │ per       │ per       │ per        │ per         │
│                            │        │                        │                │         │           │                     │       Group │                                      │ second    │ second    │ second     │ second      │
╞════════════════════════════╪════════╪════════════════════════╪════════════════╪═════════╪═══════════╪═════════════════════╪═════════════╪══════════════════════════════════════╪═══════════╪═══════════╪════════════╪═════════════╡
│ nqn.2016-06.io.spdk:cnode1 │      1 │ bdev_62062101-26d9-    │ rbd/demo_image │ 10 MiB  │ 512 Bytes │ 62062101-26d9-4f38- │           1 │ · nqn.2014-08.org.nvmexpress:uuid:   │ unset     │ unset     │ unset      │ unset       │
│                            │        │ 4f38-8309-0fa02a44db84 │                │         │           │ 8309-0fa02a44db84   │             │ 893a6752-fe9b-ca48-aa93-e4565f32881c │           │           │            │             │
│                            │        │                        │                │         │           │                     │             │ · nqn.2014-08.org.nvmexpress:uuid:   │           │           │            │             │
│                            │        │                        │                │         │           │                     │             │ 893a6752-fe9b-ca48-aa93-e4565f32881d │           │           │            │             │
│                            │        │                        │                │         │           │                     │             │ · nqn.2014-08.org.nvmexpress:uuid:   │           │           │            │             │
│                            │        │                        │                │         │           │                     │             │ 893a6752-fe9b-ca48-aa93-e4565f32881e │           │           │            │             │
╘════════════════════════════╧════════╧════════════════════════╧════════════════╧═════════╧═══════════╧═════════════════════╧═════════════╧══════════════════════════════════════╧═══════════╧═══════════╧════════════╧═════════════╛

@gbregman
Copy link
Collaborator

gbregman commented Feb 4, 2025

Or, to see it more clearly:

root@gil-vm:/home/ceph/gil-ceph-nvmeof> cephnvmf --format json namespace list -n  nqn.2016-06.io.spdk:cnode1
{
    "error_message": "Success",
    "subsystem_nqn": "nqn.2016-06.io.spdk:cnode1",
    "namespaces": [
        {
            "nsid": 1,
            "bdev_name": "bdev_62062101-26d9-4f38-8309-0fa02a44db84",
            "rbd_image_name": "demo_image",
            "rbd_pool_name": "rbd",
            "load_balancing_group": 1,
            "block_size": 512,
            "rbd_image_size": "10485760",
            "uuid": "62062101-26d9-4f38-8309-0fa02a44db84",
            "hosts": [
                "nqn.2014-08.org.nvmexpress:uuid:893a6752-fe9b-ca48-aa93-e4565f32881c",
                "nqn.2014-08.org.nvmexpress:uuid:893a6752-fe9b-ca48-aa93-e4565f32881d",
                "nqn.2014-08.org.nvmexpress:uuid:893a6752-fe9b-ca48-aa93-e4565f32881e"
            ],
            "ns_subsystem_nqn": "nqn.2016-06.io.spdk:cnode1",
            "trash_image": false,
            "rw_ios_per_second": "0",
            "rw_mbytes_per_second": "0",
            "r_mbytes_per_second": "0",
            "w_mbytes_per_second": "0",
            "auto_visible": false
        }
    ],
    "status": 0
}

@gbregman
Copy link
Collaborator

gbregman commented Feb 4, 2025

I guess the latest development CLI is not pushed to quai.io yet. We should create a new version and update the cont1ainers t1here and then you will get this feature.

@gbregman
Copy link
Collaborator

gbregman commented Feb 4, 2025

This was done in PR #893

@gbregman gbregman closed this as completed Feb 4, 2025
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NVMe-oF Feb 4, 2025
@gbregman
Copy link
Collaborator

gbregman commented Feb 4, 2025

@rahullepakshi you see "Restrictive" in the visibility column in case the namespace was created with "no-auto-visible" set but no hosts were added to it. Once you add hosts to the namespace you will see them in the visibility column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants