hostname cannot be used for traddr?

Andreas Luengen LUENGEN at de.ibm.com
Thu Aug 19 07:27:35 PDT 2021


Hi nvmetcli developers.

Following the NVMe specs I understand that it should be possible to use 
host name or fully qualified domain name instead of an IP address in the 
traddr field.
Setting the host name works, but when I try to attach a device this fails. 
Just changing the host name to a valid IP address and then attaching a 
device works (see below).

May I  miss something or is this a bug?


/ports/3/subsystems> cd ..
/ports/3> ls
o- 3 
.............................................................................. 
[trtype=rdma, traddr=172.16.80.97, trsvcid=4420]
  o- referrals 
............................................................................................................... 
[...]
  o- subsystems 
.............................................................................................................. 
[...]
/ports/3> set addr traddr=cesip1
Parameter traddr is now 'cesip1'.
/ports/3> ls
o- 3 
.................................................................................... 
[trtype=rdma, traddr=cesip1, trsvcid=4420]
  o- referrals 
............................................................................................................... 
[...]
  o- subsystems 
.............................................................................................................. 
[...]
/ports/3> cd subsystems
/ports/3/subsystems> ls
o- subsystems 
................................................................................................................ 
[...]
/ports/3/subsystems> create cesnode1-0005
Could not symlink cesnode1-0005 in configFS: [Errno 22] Invalid argument: 
'/sys/kernel/config/nvmet/subsystems/cesnode1-0005' -> 
'/sys/kernel/config/nvmet/ports/3/subsystems/cesnode1-0005'
/ports/3/subsystems> cd ..
/ports/3> set addr traddr=172.16.80.97
Parameter traddr is now '172.16.80.97'.
/ports/3> cd subsystems
/ports/3/subsystems> create cesnode1-0005
/ports/3/subsystems> ls
o- subsystems 
................................................................................................................ 
[...]
  o- cesnode1-0005 
........................................................................................................... 
[...]
/ports/3/subsystems> cd /ports
/ports> ls
o- ports 
..................................................................................................................... 
[...]
  o- 1 
............................................................................ 
[trtype=rdma, traddr=172.16.80.98, trsvcid=4420]
  | o- referrals 
............................................................................................................. 
[...]
  | o- subsystems 
............................................................................................................ 
[...]
  |   o- dvtc3a-0005 
......................................................................................................... 
[...]
  o- 3 
............................................................................ 
[trtype=rdma, traddr=172.16.80.97, trsvcid=4420]
    o- referrals 
............................................................................................................. 
[...]
    o- subsystems 
............................................................................................................ 
[...]
      o- cesnode1-0005 
....................................................................................................... 
[...]
/ports>
/ports/3> cd subsystems
/ports/3/subsystems> delete cesnode1-0005
/ports/3/subsystems> cd ..
/ports/3> set addr traddr=cesip1.a.b.c.ibm.com
Parameter traddr is now 'cesip1.a.b.c.ibm.com'.
/ports/3> cd subsystems
/ports/3/subsystems> create cesnode1-0005
Could not symlink cesnode1-0005 in configFS: [Errno 22] Invalid argument: 
'/sys/kernel/config/nvmet/subsystems/cesnode1-0005' -> 
'/sys/kernel/config/nvmet/ports/3/subsystems/cesnode1-0005'


Here when I trying to restore a preconfigured config file:

[8.3 root at dvtc3a:/tmp 07:45:18 994]# nvmetcli clear; nvmetcli restore 
/tmp/nvmet.dvtc3a.rdma.nameonly; nvmetcli ls
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/nvmet/nvme.py", line 635, in 
add_subsystem
    "%s/subsystems/%s" % (self._path, nqn))
OSError: [Errno 22] Invalid argument: 
'/sys/kernel/config/nvmet/subsystems/cesnode1-0005' -> 
'/sys/kernel/config/nvmet/ports/3/subsystems/cesnode1-0005'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/sbin/nvmetcli", line 656, in <module>
    main()
  File "/usr/sbin/nvmetcli", line 639, in main
    funcs[sys.argv[1]](savefile)
  File "/usr/sbin/nvmetcli", line 595, in restore
    errors = nvme.Root().restore_from_file(from_file)
  File "/usr/lib/python3.6/site-packages/nvmet/nvme.py", line 382, in 
restore_from_file
    abort_on_error=abort_on_error)
  File "/usr/lib/python3.6/site-packages/nvmet/nvme.py", line 363, in 
restore
    Port.setup(self, t, err_func)
  File "/usr/lib/python3.6/site-packages/nvmet/nvme.py", line 687, in 
setup
    port.add_subsystem(s)
  File "/usr/lib/python3.6/site-packages/nvmet/nvme.py", line 637, in 
add_subsystem
    raise CFSError("Could not symlink %s in configFS: %s" % (nqn, e))
nvmet.nvme.CFSError: Could not symlink cesnode1-0005 in configFS: [Errno 
22] Invalid argument: '/sys/kernel/config/nvmet/subsystems/cesnode1-0005' 
-> '/sys/kernel/config/nvmet/ports/3/subsystems/cesnode1-0005'
o- / 
......................................................................................................................... 
[...]
  o- hosts 
................................................................................................................... 
[...]
  | o- hostnqn-cesnode1ip1 
................................................................................................... 
[...]
  o- ports 
................................................................................................................... 
[...]
  | o- 3 
................................................................................ 
[trtype=rdma, traddr=cesip1, trsvcid=4420]
  |   o- referrals 
........................................................................................................... 
[...]
  |   o- subsystems 
.......................................................................................................... 
[...]
  o- subsystems 
.............................................................................................................. 
[...]
    o- cesnode1-0005 
........................................................... [version=1.3, 
allow_any=1, serial=657df07bdfbd0a8c]
      o- allowed_hosts 
....................................................................................................... 
[...]
      o- namespaces 
.......................................................................................................... 
[...]
        o- 1 ................................ 
[path=/ibm/scale01/nvme/disk5.img, 
uuid=0fa67003-22db-4948-967d-31d30babd814, enabled]
[8.3 root at dvtc3a:/tmp 07:45:38 995]#

[8.3 root at dvtc3a:/tmp 07:45:38 995]# cat /tmp/nvmet.dvtc3a.rdma.nameonly
{
  "hosts": [
    {
      "nqn": "hostnqn-cesnode1ip1"
    }
  ],
  "ports": [
    {
      "addr": {
        "adrfam": "ipv4",
        "traddr": "cesip1",
        "treq": "not specified",
        "trsvcid": "4420",
        "trtype": "rdma"
      },
      "portid": 3,
      "referrals": [],
      "subsystems": [
        "cesnode1-0005"
      ]
    }
  ],
  "subsystems": [
    {
      "allowed_hosts": [],
      "attr": {
        "allow_any_host": "1",
        "serial": "657df07bdfbd0a8c",
        "version": "1.3"
      },
      "namespaces": [
        {
          "device": {
            "nguid": "00000000-0000-0000-0000-000000000000",
            "path": "/ibm/scale01/nvme/disk5.img",
            "uuid": "0fa67003-22db-4948-967d-31d30babd814"
          },
          "enable": 1,
          "nsid": 1
        }
      ],
      "nqn": "cesnode1-0005"
    }
  ]
}

/etc/hosts contains a mapping for this name (a,b,c are substitutes for the 
real entries):
172.16.80.97  cesip1  cesip1.a.b.c.ibm.com

Mit freundlichen Grüßen / Kind regards

Andreas Luengen






More information about the Linux-nvme mailing list