Ceph enable the object map feature
The Hammer release brought the support of a new feature for RBD images called object map. The object map tracks which blocks of the image are actually allocated and where. This is especially useful for operations on clones like resize, import, export, flattening and size calculation since the client does not need to calculate where each object is located. The client will just look up on that table.
There are currently several features available:
layering
: layering support, where id is 1striping
: striping v2 support, where id is 2exclusive-lock
: exclusive locking support, where id is 4object-map
: object map support (requires exclusive-lock), where id is 8
To enable one feature you have two options:
- using the CLI with the
rbd
command - from your
ceph.conf
by using therbd_default_features
flag
If you want to use a single option simply put its id, if you want more features you have to sum the ids.
For example: to use exclusive-lock
simply do:
$ rbd create bar -s 1024 --image-format=2 --image-features=4 |
Same in your ceph.conf
with rbd_default_features = 4
To enable object-map
, you need exclusive-lock
so you need to sum 4+8
:
$ rbd create bar -s 1024 --image-format=2 --image-features=12 |
Same in your ceph.conf
with rbd_default_features = 12
If you want to check the map
$ rados -p rbd ls |grep 5ea22ae8944a |
The future CLI version will be easier, as you won’t need to use digits anymore. The proper name of the feature will be used instead. After the image creation, you will be able to add more features too.
$ rbd create leseb -s 1024 --image-format 2 --image-feature exclusive-lock |
Enjoy!
Comments