mgr/dashboard: Add support for managing RBD QoS
With PR#23743 merged, Ceph Nautilus will support defining an IOPS limit for RBD images on a per-image and pool level.
The RBD management in Ceph Mgr Dashboard should support this feature, by making it possible to define the limit when creating new RBD images or editing existing RBDs, as well as when creating or editing a Ceph pool dedicated to RBD.
On the command line, these limits can be configured as follows:
$ rbd config pool set $pool rbd_qos_iops_limit 100 $ rbd config image set $pool/$image rbd_qos_iops_limit 200
#1 Updated by Mykola Golub 11 months ago
I am not sure if the scope is intentionally limited only to QOS, but just to make sure you are aware about all available functionality, below some more details.
Via `rbd config pool|image` you can set not only QOS but much more. `rbd config pool ls $pool` and `rbd config image ls $pool/$image` will return the full list of possible overrides. E.g. for QOS we have these options:
% rbd config pool ls rbd |grep qos rbd_qos_bps_limit 0 config rbd_qos_iops_limit 0 config rbd_qos_read_bps_limit 0 config rbd_qos_read_iops_limit 0 config rbd_qos_write_bps_limit 0 config rbd_qos_write_iops_limit 0 config
So probably we want some more generic, not only QOS?
And the dashboard can use python rbd bindings:
params = rbd.config_list(ioctx) rbd.pool_metadata_set(ioctx, "conf_rbd_qos_bps_limit", "100") rbd.pool_metadata_remove(ioctx, "conf_rbd_qos_bps_limit") params = image.config_list() image.metadata_set("conf_rbd_qos_bps_limit", "100") image.metadata_remove("conf_rbd_qos_bps_limit")
Note, the overrides are stored in the pool/image metadata, and for set/remove we use "metadata" API, which requires the config keys to be prefixed with "conf_".