* hostname cannot be used for traddr?
@ 2021-08-19 14:27 Andreas Luengen
2021-08-19 14:37 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Luengen @ 2021-08-19 14:27 UTC (permalink / raw)
To: linux-nvme
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@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@dvtc3a:/tmp 07:45:38 995]#
[8.3 root@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
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: hostname cannot be used for traddr?
2021-08-19 14:27 hostname cannot be used for traddr? Andreas Luengen
@ 2021-08-19 14:37 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2021-08-19 14:37 UTC (permalink / raw)
To: Andreas Luengen; +Cc: linux-nvme
On Thu, Aug 19, 2021 at 04:27:35PM +0200, Andreas Luengen wrote:
> 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?
Not a bug and you're not missing anything. The kernel doesn't do
DNS lookups, so it need an ip address. The only enhancement we could
do is to do the DNS lookup in the nvmetcli code, and then store the
resolved IP address in configfs for the kernel.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-19 14:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 14:27 hostname cannot be used for traddr? Andreas Luengen
2021-08-19 14:37 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.