Skip to content

[WIP] cephfs-mirror: support file system peer additions with remote monitor host - #39657

Closed
vshankar wants to merge 4 commits into
ceph:masterfrom
vshankar:wip-cephfs-mirror-peer-add-with-mon-host
Closed

vshankar wants to merge 4 commits into
ceph:masterfrom
vshankar:wip-cephfs-mirror-peer-add-with-mon-host

Conversation

@vshankar

Copy link
Copy Markdown
Contributor

Peer cluster monitor host is tracked in FSMap::ClusterInfo. Mirror daemons can connect to the peer cluster without the need for the peer cluster configuration file to be present in the primary site. librados searches for keyring in default locations.

pybing/mirroring needs to connect to the remote cluster when adding a peer. This is to set a special xattr (on root) to "mark" the remote filesystem as a peer. This is done so that a "peered" filesystem cannot be added as a peer again from another cluster. However, librados python binding does not seem to search for keyrings in default locations as mentioned in https://docs.ceph.com/en/latest/rados/api/python/#connect-to-the-cluster thereby failing the connect (see changes in src/pybind/mgr/mirroring/fs/utils.py in this PR). Specifying the path to keyring file (or accepting it from the user) does not look clean too.

@batrick @liewegas @mchangir ^^

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 api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

This would allow file system peers (for mirroring) to be added
by specifying remote clusters monitor address instead of copying
remote clusters ceph config file.

Signed-off-by: Venky Shankar <[email protected]>
…ied)

This allows connecting to the peer cluster without having the cluster
configuration file on the primary cluster.

Signed-off-by: Venky Shankar <[email protected]>
@vshankar
vshankar force-pushed the wip-cephfs-mirror-peer-add-with-mon-host branch from 04343da to 6069f9e Compare February 24, 2021 08:51

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I spoke with Sage and Jason about this earlier today. The way rbd-mirror does this is by storing the mon_host and secret in the mon config-key store [1]. I would suggest we should go in that direction as we can maintain the same model for configuration to be consistent. rbd-mirror uses a mon 'profile rbd-mirror' authorization to allow access to the config keys for the secret/mon_host. We can have the exact same setup for cephfs-mirror.

Storing the mon_host in the config-key store is not as necessary since you could safely store that in the FSMap but it would be consistent with rbd-mirror. If you want to just store the secret in the config-key store, I'm okay with that.

(There is also an rbd-mirror-peer profile but I'm not sure what that's for. @dillaman ? It's not mentioned in the docs for rbd-mirror.)

cc @dillaman @liewegas

[1] https://docs.ceph.com/en/latest/rbd/rbd-mirroring/#add-cluster-peer-manually
[2] https://docs.ceph.com/en/latest/rbd/rbd-mirroring/#rbd-mirror-daemon

@dillaman

Copy link
Copy Markdown

(There is also an rbd-mirror-peer profile but I'm not sure what that's for. @dillaman ? It's not mentioned in the docs for rbd-mirror.)

It's used by automatic bootstrap process [1] internally to allow the remote peer (i.e. site-A) to install its own secret keys in the peer cluster's (i.e. site-b) config-key store.

[1] https://docs.ceph.com/en/latest/rbd/rbd-mirroring/#bootstrap-peers

@dillaman

Copy link
Copy Markdown

... as I also mentioned, librbd's new instant-image restore feature supports using config://...-style URIs to instruct the code where in the MON config-key store to extract secrets [1]. This 'config://'-scheme was originally introduced in RGW for certs and it's since spread to ceph-iscsi for certs, and now this.

[1] https://github.com/ceph/ceph/blob/master/src/librbd/Utils.cc#L214

@batrick batrick mentioned this pull request Feb 24, 2021
3 tasks done
@batrick

batrick commented Feb 24, 2021

Copy link
Copy Markdown
Member

... as I also mentioned, librbd's new instant-image restore feature supports using config://...-style URIs to instruct the code where in the MON config-key store to extract secrets [1]. This 'config://'-scheme was originally introduced in RGW for certs and it's since spread to ceph-iscsi for certs, and now this.

[1] https://github.com/ceph/ceph/blob/master/src/librbd/Utils.cc#L214

Nice! Maybe we should store that URI in the FSMap then.

@vshankar

Copy link
Copy Markdown
Contributor Author

... as I also mentioned, librbd's new instant-image restore feature supports using config://...-style URIs to instruct the code where in the MON config-key store to extract secrets [1]. This 'config://'-scheme was originally introduced in RGW for certs and it's since spread to ceph-iscsi for certs, and now this.
[1] https://github.com/ceph/ceph/blob/master/src/librbd/Utils.cc#L214

Nice! Maybe we should store that URI in the FSMap then.

ACK. Nice approach.

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@vshankar vshankar closed this Apr 27, 2021
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.

3 participants