rbdmap: replace rbdmap with systemd unit generator#40844
rbdmap: replace rbdmap with systemd unit generator#40844
Conversation
|
@wjwithagen hi Willem, does the FreeBSD port use/support rbdmap? |
|
I would prefer to keep this script as well. |
|
@wjwithagen But I think keeping the |
|
@huww98 |
|
I am just wondering, while we are here, couldn't be made more generic to also support other device types (nbd), as it is described in the feature request [1]? Note, right now |
I've just tested that it just works when you add In my case: |
idryomov
left a comment
There was a problem hiding this comment.
I left some comments but haven't looked at the new script itself yet.
In the cover letter you say
It is designed to be fully compatible with the original /etc/ceph/rbdmap config file.
but then a few lines below
Previous "id=admin,options='lock_on_read,queue_depth=1024'" can now be written as "id=admin,lock_on_read,queue_depth=1024", which is more nature.
Can the new script handle the old options=... syntax?
In a later comment you say
I've added some new features that would break rbdmap once used.
Can you enumerate what those are, precisely?
I wonder we should try to make |
Yes, it can.
Basically everything listed in "new features" from cover-letter: |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
Replace original rbdmap bash script with rbdmap-generator, which is a systemd unit generator that generates one rbdmap@.service for each RBD image on boot or `systemctl daemon-reload`. This generator is written in Python3, and its behavior closely follows systemd-cryptsetup-generator(8). It is designed to be fully compatible with the original /etc/ceph/rbdmap config file. Apart from original functions, this generator supports several new features: * Support adding systemd unit options (e.g. x-systemd.requires=) from /etc/ceph/rbdmap config file. The design closely follows systemd-fstab-generator(8) * Support noauto, nofail options. They have the same semantic as in systemd-cryptsetup-generator(8) * Previous "id=admin,options='lock_on_read,queue_depth=1024'" can now be written as "id=admin,lock_on_read,queue_depth=1024", which is more nature. We have some additional advantages compared with the original script: * Other units may acquire dependency to a specific RBD device, may through the rbdmap@.service units, or the standard .device and blockdev@.target units. * We do not have to deal with mount and umount in the script. The mount unit created by systemd-fstab-generator(8) will automatically pull in and wait until RBD device mapping finished. * Furthermore, we may support on-demand RBD mapping. For example, when working with automount, the mount unit triggered by access to the mount point will in turn trigger the RBD device mapping automatically. However, there are still some breaking changes: * Manually invoke `rbdmap` command is not supported. They may be replaced with `systemctl start|stop rbdmap@*.service`. `rbdmap unmap-all` has no replacement. * There is no easy way to override the config file path. Hooks in /etc/ceph/rbd.d/ are still supported but should be considered deprecated. Administrators should use systemd unit file to deploy hooks. Signed-off-by: 胡玮文 <huww98@outlook.com>
replaced with rbdmap-generator Signed-off-by: 胡玮文 <huww98@outlook.com>
Located at `/etc/ceph/rbdtab`, similar to `/etc/crypttab`. If it is not present, fallback to old rbdmap. Signed-off-by: 胡玮文 <huww98@outlook.com>
Signed-off-by: 胡玮文 <huww98@outlook.com>
The hook usage are undocumented. With the current generator approach, using systemd unit override should be a lot easier than these hooks. Signed-off-by: 胡玮文 <huww98@outlook.com>
Add deprecated warning for rbdmap Improve error when the same image is specifiled multiple times Don't print stack trace for known invalid config Signed-off-by: 胡玮文 <huww98@outlook.com>
The default pool used by 'rbd device map' command depends on 'rbd_default_pool' configuration. And the actual config value in effect is hard to acquire. For capability reason, if rbdmap config is in use, the default pool name is still hard-coded to 'rbd'. Signed-off-by: 胡玮文 <huww98@outlook.com>
Also add back some content from removed rbdmap(8) to new rbdmap(5) Also refined examples to include placeholder for optional fields, namespace. Signed-off-by: 胡玮文 <huww98@outlook.com>
|
Rebased. Thanks. @tchaikov |
My apologies, I'm swamped with higher-priority work which is intended to be backported to squid right now. I'll try to take a look at this as time allows in the coming weeks. My main concern is that we don't have test coverage (neither for the old way nor for the new way of doing mappings), so this is something that would need to be play-tested manually.
@huww98 Are you continuing to use this production? Anything new to share? |
|
We deploy this in our college. I have graduated now, so I'm not aware of the current status. |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Replace original rbdmap bash script with rbdmap-generator, which is a systemd unit generator that generates one rbdmap@.service for each RBD image on boot or
systemctl daemon-reload.This generator is written in Python3, and its behavior closely follows systemd-cryptsetup-generator(8). It is designed to be fully compatible with the original /etc/ceph/rbdmap config file.
Apart from original functions, this generator supports several new features:
Support adding systemd unit options (e.g. x-systemd.requires=) from /etc/ceph/rbdmap config file. The design closely follows systemd-fstab-generator(8)
Support noauto, nofail options. They have the same semantic as in systemd-cryptsetup-generator(8)
Previous "id=admin,options='lock_on_read,queue_depth=1024'" can now be written as "id=admin,lock_on_read,queue_depth=1024", which is more nature.
We have some additional advantages compared with the original script:
Other units may acquire dependency to a specific RBD device, may through the rbdmap@.service units, or the standard .device and blockdev@.target units.
We do not have to deal with mount and umount in the script. The mount unit created by systemd-fstab-generator(8) will automatically pull in and wait until RBD device mapping finished.
Furthermore, we may support on-demand RBD mapping. For example, when working with automount, the mount unit triggered by access to the mount point will in turn trigger the RBD device mapping automatically.
However, there are still some breaking changes:
Manually invoke
rbdmapcommand is not supported. They may be replaced withsystemctl start|stop rbdmap@*.service.rbdmap unmap-allhas no replacement.There is no easy way to override the config file path.
Hooks in /etc/ceph/rbd.d/ are still supported but should be considered deprecated. Administrators should use systemd unit file to deploy hooks.
Signed-off-by: 胡玮文 huww98@outlook.com
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox