-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ceph-salt-formula: give explicit IP addr when adding host #465
Conversation
The upstream cephadm developers recently added a commit - 0facfac91fd8f71e5a8b869d818e7c2b07b93516 - which was backported to pacific and was found to be causing our "ceph orch host add" command to fail because we weren't specifying the IP address explicitly. While the developers are now discussing whether the command really should fail in this way, it seems prudent to give our IP address here explicitly, since mgr/cephadm is going to try to resolve the hostname, anyway. Fixes: ceph#463 Signed-off-by: Nathan Cutler <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an unavoidable kink with socket.gethostbyname(socket.gethostname())
: if you happen to have specified the system hostname with the loopback address in /etc/hosts, this construct will return 127.0.0.1. I'm almost certain this is unavoidable, and you shouldn't be configuring /etc/hosts like that anyway, but, it might be worth checking if the address returned starts with "127.", and aborting or erroring out in that case. Otherwise looks fine.
...I realise bailing out in this context may be problematic, so don't let my comment stop this PR. Might be worth opening an issue to somehow add a hostname resolution check elsewhere in ceph-salt, as a general sanity check? |
alternative would be to have the check in ceph/ceph#43856 |
Well, it's not an "either-or" proposition. It's possible (and probably even desirable) for both ceph-salt and mgr/cephadm to implement this same check. But ceph-salt has an advantage: it isn't running in a container. So it doesn't get confused about its own IP address like mgr/cephadm does. |
Anyway, let's move the discussion of the IP address sanity check to #466 I'm going to merge this soon if there are no further comments. |
The upstream cephadm developers recently added a commit - ceph/ceph@0facfac - which was backported to pacific and was found to be causing our post-bootstrap "ceph orch host add" command to fail because we weren't specifying the IP address explicitly.
While the developers are now discussing whether the command really should fail in this way, it seems prudent to give our IP address here explicitly, since mgr/cephadm is going to try to resolve the hostname, anyway.
Fixes: #463
Signed-off-by: Nathan Cutler [email protected]