Skip to content

cephadm: Infer config on "cephadm shell"#34728

Merged
sebastian-philipp merged 1 commit intoceph:masterfrom
ricardoasmarques:infer-config
May 4, 2020
Merged

cephadm: Infer config on "cephadm shell"#34728
sebastian-philipp merged 1 commit intoceph:masterfrom
ricardoasmarques:infer-config

Conversation

@ricardoasmarques
Copy link
Contributor

@ricardoasmarques ricardoasmarques commented Apr 24, 2020

This PR simplifies the usage of cephadm shell on MON nodes by inferring the config:

node2:~ # cephadm shell
INFO:cephadm:Inferring fsid 3637a7ea-8593-11ea-a951-5254005a2e6a
INFO:cephadm:Inferring config /var/lib/ceph/3637a7ea-8593-11ea-a951-5254005a2e6a/mon.node2/config
INFO:cephadm:Using recent ceph image registry.opensuse.org/filesystems/ceph/octopus/upstream/images/ceph/ceph:latest
[ceph: root@node2 /]# ceph -s
  cluster:
    id:     3637a7ea-8593-11ea-a951-5254005a2e6a
...

The main motivation of this PR, is that the /etc/ceph/ceph.conf generated by the bootstrap command will became outdated when new MONs are added.

Fixes: https://tracker.ceph.com/issues/44792

Signed-off-by: Ricardo Marques rimarques@suse.com

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard backend
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

Comment on lines +1096 to +1098
if daemon['name'].startswith('mon.'):
name = daemon['name']
break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really need proper data types and classes here in cephadm.

@ricardoasmarques ricardoasmarques changed the title cephadm: Infer config on "cephadm shell" [DNM] cephadm: Infer config on "cephadm shell" Apr 24, 2020
@ricardoasmarques ricardoasmarques changed the title [DNM] cephadm: Infer config on "cephadm shell" cephadm: Infer config on "cephadm shell" Apr 24, 2020
if args.config:
logger.debug('Using specified config: %s' % args.config)
return func()
if not args.config and os.path.exists(SHELL_DEFAULT_CONF):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe infer the config even if SHELL_DEFAULT_CONF exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jschmid1 I've changed it, so the new precedence order is:

  1. --config option
  2. config inferred from MON
  3. default /etc/ceph/ceph.conf location

@tchaikov
Copy link
Contributor

jenkins test docs

Fixes: https://tracker.ceph.com/issues/44792

Signed-off-by: Ricardo Marques <rimarques@suse.com>
@ricardoasmarques
Copy link
Contributor Author

@sebastian-philipp FYI, I've now updated the documentation in this PR to reflect the infer config behavior.

@sebastian-philipp
Copy link
Contributor

@sebastian-philipp sebastian-philipp merged commit d687234 into ceph:master May 4, 2020
ricardoasmarques referenced this pull request in smithfarm/ceph-salt Jun 2, 2020
The "ceph orch status" command is known to hang if /etc/ceph/ceph.conf
on the host points to hosts that used to be MONs but are not anymore.

It's debatable what an appropriate timeout is (30 seconds, more, less?)
but commands that are known to hang should have an explicit timeout.

References: ceph#199
Signed-off-by: Nathan Cutler <ncutler@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants