目的:阅读官方文档,熟悉rbd命令。
rbd命令行参数:
http://docs.ceph.com/docs/wip-5900/man/8/rbd/
image相关
http://docs.ceph.com/docs/wip-5900/rbd/rados-rbd-cmds/
列出pools
http://docs.ceph.com/docs/wip-5900/rados/operations/pools/
root@maqi-openstack:~$ ceph osd lspools
0 rbd,1 cephfs_data,2 cephfs_metadata,3 .rgw.root,4 .rgw.control,5 .rgw,6 .rgw.gc,7 .users.uid,
这里显示了0 ~ 7共8个pool。
The default pools include:
- data
- metadata
- rbd
创建image
root@maqi-openstack:~$ rbd create foo --size 1024
列出image
root@maqi-openstack:~$ rbd ls
foo
root@maqi-openstack:~$ rbd ls rbd #rbd是默认pool
foo
查看image详细信息
root@maqi-openstack:~$ rbd --image foo info
rbd image 'foo':
size 1024 MB in 256 objects
order 22 (4096 kB objects)
block_name_prefix: rb.0.102b.74b0dc51
format: 1
root@maqi-openstack:~$ rbd --image foo -p rbd info
rbd image 'foo':
size 1024 MB in 256 objects
order 22 (4096 kB objects)
block_name_prefix: rb.0.102b.74b0dc51
format: 1
Resize image
root@maqi-openstack:~$ rbd resize --image foo --size 2048
Resizing image: 100% complete...done.
root@maqi-openstack:~$ rbd --image foo info
rbd image 'foo':
size 2048 MB in 512 objects
order 22 (4096 kB objects)
block_name_prefix: rb.0.102b.74b0dc51
format: 1
删除image
root@maqi-openstack:~$ rbd rm foo -p rbd
Removing image: 100% complete...done.
root@maqi-openstack