Working with image metadata
Ceph supports adding custom image metadata as key-value pairs. The pairs do not have any strict format. By using metadata you can also set the RADOS Block Device (RBD) configuration parameters for particular images. Use the rbd image-meta command to work with metadata.
Prerequisites
-
A running IBM Storage Ceph cluster.
-
Root-level access to the client node.
Procedure
-
To set a new metadata key-value pair:
Syntax
rbd image-meta set POOL_NAME/IMAGE_NAME KEY VALUEExample
[ceph: root@host01 /]# rbd image-meta set pool1/image1 last_update 2021-06-06This example sets the
last_updatekey to the2021-06-06value on theimage1image in thepool1pool. -
To view a value of a key:
Syntax
rbd image-meta get POOL_NAME/IMAGE_NAME KEYExample
[ceph: root@host01 /]# rbd image-meta get pool1/image1 last_updateThis example views the value of the
last_updatekey. -
To show all metadata on an image:
Syntax
rbd image-meta list POOL_NAME/IMAGE_NAMEExample
[ceph: root@host01 /]# rbd image-meta list pool1/image1This example lists the metadata set for the
image1image in thepool1pool. -
To remove a metadata key-value pair:
Syntax
rbd image-meta remove POOL_NAME/IMAGE_NAME KEYExample
[ceph: root@host01 /]# rbd image-meta remove pool1/image1 last_updateThis example removes the
last_updatekey-value pair from theimage1image in thepool1pool. -
To override the RBD image configuration settings set in the Ceph configuration file for a particular image:
Syntax
rbd config image set POOL_NAME/IMAGE_NAME PARAMETER VALUEExample
[ceph: root@host01 /]# rbd config image set pool1/image1 rbd_cache falseThis example disables the RBD cache for the
image1image in thepool1pool.
Reference
For a list of possible configuration options, see General options.