Bug #51365
openmgr/nfs: show both ipv4 and ipv6 address in cluster info command
0%
Description
https://github.com/ceph/ceph/blob/74df5af8e2d36c6143f214cab0fca1693d39f86e/src/pybind/mgr/nfs/cluster.py#L18-L28
With the current code only one of them is shown
- ceph nfs cluster info
{
"nfs": [ {
"hostname": "test031",
"ip": "2620:52:0:880:225:90ff:fefc:25a6",
"port": 2049
}
]
}
socket.getaddrinfo("test006", None, flags=socket.AI_CANONNAME,type=socket.SOCK_STREAM)
[(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, 'magna006', ('10.8.129.7', 0))]
socket.getaddrinfo("test031", None, flags=socket.AI_CANONNAME,type=socket.SOCK_STREAM)
[(<AddressFamily.AF_INET6: 10>, <SocketKind.SOCK_STREAM: 1>, 6, 'test031.test.com', ('2620:52:0:880:225:90ff:fefc:25a6', 0, 0, 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('10.8.128.31', 0))]
Updated by Sage Weil over 2 years ago
- Status changed from New to In Progress
The latest code tries to use the HostSpec.addr field here. Only if that field is empty (or a hostname instead of an IP) does it fall back to doing a DNS lookup. And on upgrade from older cephadm versions, cephadm tries to update those addr fields to be IP addresses. The only time that would fail is when you have a single-node cephadm cluster.
So.. I think this is a non-issue. The user should put the v4 or v6 address they want to use as the host addr, depending on their environment. We don't have a way to have multiple addrs for a host in the HostSpec, so I don't think it makes sense to change this info result.