Bug 1929563 - host add with labels throws error by skipping host address
Summary: host add with labels throws error by skipping host address
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Cephadm
Version: 5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 5.0
Assignee: Daniel Pivonka
QA Contact: Sunil Kumar Nagaraju
Karen Norteman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-17 07:33 UTC by Sunil Kumar Nagaraju
Modified: 2021-08-30 08:28 UTC (History)
4 users (show)

Fixed In Version: ceph-16.2.0-20.el8cp
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-08-30 08:28:20 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHCEPH-1229 0 None None None 2021-08-30 00:18:01 UTC
Red Hat Product Errata RHBA-2021:3294 0 None None None 2021-08-30 08:28:39 UTC

Comment 3 Daniel Pivonka 2021-03-30 20:31:48 UTC
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

Comment 10 Daniel Pivonka 2021-04-30 17:01:23 UTC
'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

Comment 13 errata-xmlrpc 2021-08-30 08:28:20 UTC
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


Note You need to log in before you can comment on or make changes to this bug.