Join GitHub today
rbdmap: consider /etc/ceph/rbdmap when unmapping images #13361
As reported at http://tracker.ceph.com/issues/18884 , "rbdmap unmap" currently unmounts / unmaps all mapped RBD images, rather than just the images listed in RBDMAPFILE (/etc/ceph/rbdmap).
I'm unsure whether I should keep the existing behaviour and add the RBDMAP_UNMAP_ALL=no parameter, or just drop the old behaviour all together, given that it wasn't documented.
Lots of duplicated code that could be potentially consolidated into a few helper methods to be re-used between map/unmap_all/unmap_file methods
This new version follows @dillaman 's suggestion of adding an unmap-all parameter, which is used by the systemd service, and continues to unmount+unmap all RBD images regardless of whether or not they're listed in the config file. The behaviour of "rbdmap unmap" is changed such that it now respects the config file contents.