rbd features說明

一、rbd format 含義

format 1 - 新建 rbd 映像時使用最初的格式,此格式兼容所有版本的 librbd 和內核模塊,但是不支持較新的功能,像克隆。

format 2 - 使用第二版 rbd 格式,librbd 和 3.11 版以上內核模塊才支持。此格式增加了克隆支持,使得擴展更容易,還允許以後增加新功能。

二、rbd features 屬性表

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

作者:龍龍小寶


分享到:


相關文章: