rbd: have a way of establishing configured mappings at boot time
We need to be careful about the config format, to make automatic editing easy (think Chef).
/etc/ceph/rbd.d/NAME.conf is used as ceph.conf to map image called NAME.
You can drop in multiple .conf files in that directory.
Two major use cases:
ln -s /etc/ceph/ceph.conf /etc/ceph/rbd.d/foo.conf
maps image "foo" at boot time with the main ceph.conf settings, with the keyrings configured there
install -m0600 appropriate-keyring /etc/ceph/rbd.d/bar.keyring
cat >>/etc/ceph/rbd.d/bar.conf <<EOF
keyring = bar.keyring
#2 Updated by Anonymous over 7 years ago
Single-file configuration is more annoying to handle with automated tools, file-per-device gives you good atomicity on manipulating the configuration.
Your point about pools in very good. I originally thought of putting "[rbd foo]" etc inside the config file, but I'm really hesitant to add special-purpose, more dynamic, fields/sections into the config file, and feel this is on a different level from ceph.conf anyway.
Perhaps /etc/ceph/rbd.d/ANYTHINGUNIQUEHERE.conf with contents like
image = NAME # maybe leave out to take from name of conf file
pool = notrbd # leave out for default "rbd"
id = cephkeythatcanmaprbd # leave out for default "admin"
config = /etc/ceph/non-default-ceph.conf # leave out for default