upstream tracker issue: https://tracker.ceph.com/issues/50062 upstream fix PR: https://github.com/ceph/ceph/pull/40508 to add a host with labels and no addr use the --labels flag example: ceph orch host add vm-01 --labels=label1 ceph orch host add vm-01 --labels=label1,label2
'mon' could be a valid address if your dns resolves 'mon' to a valid ip of a machine. so either (a) the user is incorrectly using the 'orch host add' command trying to put a label in the address position which is a documentation issue (although i think this is documented already) or (b) the address does not resolve. in case (b) the error message returned cant really be improved to pin point problems like that at the moment. the exception returned from the execnet library (what cephadm uses for ssh connections) does not provide info on why the connection failed https://github.com/ceph/ceph/blob/master/src/pybind/mgr/cephadm/serve.py#L1225 there are plans upstream to change this library in the future but thats going to be ready for 5.0 but if the steps below "To check that the host is reachable:" are followed by the user an appropriate error will be given as to why the connection has failed >>> [ceph: root@vm-00 /]# ceph orch host add vm-01 mon >>> Please make sure that the host is reachable and accepts connections using the cephadm SSH key >>> To add the cephadm SSH key to the host: >>> > ceph cephadm get-pub-key > ~/ceph.pub >>> > ssh-copy-id -f -i ~/ceph.pub root@mon >>> >>> To check that the host is reachable open a new shell with the --no-hosts flag: >>> > cephadm shell --no-hosts >>> >>> Then run the following: >>> > ceph cephadm get-ssh-config > ssh_config >>> > ceph config-key get mgr/cephadm/ssh_identity_key > ~/cephadm_private_key >>> > chmod 0600 ~/cephadm_private_key >>> > ssh -F ssh_config -i ~/cephadm_private_key root@mon >>> [ceph: root@vm-00 /]# >>> [ceph: root@vm-00 /]# >>> [ceph: root@vm-00 /]# ceph cephadm get-ssh-config > ssh_config >>> [ceph: root@vm-00 /]# ceph config-key get mgr/cephadm/ssh_identity_key > ~/cephadm_private_key >>> [ceph: root@vm-00 /]# chmod 0600 ~/cephadm_private_key >>> [ceph: root@vm-00 /]# ssh -F ssh_config -i ~/cephadm_private_key root@mon >>> ssh: Could not resolve hostname mon: Name or service not known >>> [ceph: root@vm-00 /]# once the user sees "ssh: Could not resolve hostname mon: Name or service not known" they will know there address does not resolve also if the user in case (a) sees "ssh: Could not resolve hostname mon: Name or service not known" they will hopefully be able to figure out they used the command wrong
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Red Hat Ceph Storage 5.0 bug fix and enhancement), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:3294