一、rbd format 含义
format 1 - 新建 rbd 映像时使用最初的格式,此格式兼容所有版本的 librbd 和内核模块,但是不支持较新的功能,像克隆。
format 2 - 使用第二版 rbd 格式,librbd 和 3.11 版以上内核模块才支持。此格式增加了克隆支持,使得扩展更容易,还允许以后增加新功能。
二、rbd features 属性表
三、ceph rbd features 默认配置
ceph rbd 默认开启了一些属性,61的意思是表格中 layering + exclusive-lock + object-map + fast-diff + deep-flatten 的 bit 码相加得到的值
rbd_default_features = 61
3.1 创建默认 rbd 映像文件
shell> rbd create rbd/mytest --size 10G
shell> rbd info mytest
rbd image 'mytest':
size 10 GiB in 2560 objects
order 22 (4 MiB objects)
id: 1533c6b8b4567
block_name_prefix: rbd_data.1533c6b8b4567
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
op_features:
flags:
create_timestamp: Thu Nov 21 17:34:19 2019
3.2 指定 format 和 feature 创建 rbd 映像文件
# kernel 3.10 仅支持 layering 属性
shell> rbd create rbd/mytest --size 10G --image-format 2 --image-feature layering
四、关闭不支持的属性(两种方式)
4.1 动态关闭不支持的属性
shell> rbd feature disable rbd/mytest deep-flatten
shell> rbd feature disable rbd/mytest fast-diff
shell> rbd feature disable rbd/mytest object-map
shell> rbd feature disable rbd/mytest exclusive-lock
4.2 创建rbd image时关闭不支持的属性
shell> cat /etc/ceph/ceph.conf
rbd_default_features = 1
作者:龍龍小宝