http://docs.ceph.com/docs/master/start/quick-ceph-deploy/#create-a-cluster

http://docs.ceph.com/docs/master/install/manual-deployment/#adding-osds

ceph v12.2.4 (luminous)命令变动

http://docs.ceph.com/ceph-deploy/docs/changelog.html#id1

2.0.0
16-Jan-2018

- Backward incompatible API changes for OSD creation - will use ceph-volume and no longer consume ceph-disk.
- Remove python-distribute dependency
- Use /etc/os-release as a fallback when linux_distribution() doesn’t work
- Drop dmcrypt support (unsupported by ceph-volume for now)
- Allow debug modes for ceph-volume

ceph-deploy v2.0.0开始不再使用ceph-disk命令来初始化osd磁盘

如果还使用旧的命令初始磁盘会有以下报错

#ceph-deploy --overwrite-conf osd prepare 主机名:/dev/sdb 

[CLTQ-064-070][DEBUG ] Running command: vgcreate --force --yes ceph-bcd6c18d-492d-4dfb-90fa-4f572d4392c7 /dev/sdb
[CLTQ-064-070][DEBUG ]  stderr: Device /dev/sdb not found (or ignored by filtering).
[CLTQ-064-070][DEBUG ]   Unable to add physical volume '/dev/sdb' to volume group 'ceph-bcd6c18d-492d-4dfb-90fa-4f572d4392c7'.
[CLTQ-064-070][DEBUG ] --> Was unable to complete a new OSD, will rollback changes
[CLTQ-064-070][DEBUG ] --> OSD will be fully purged from the cluster, because the ID was generated
[CLTQ-064-070][DEBUG ] Running command: ceph osd purge osd.0 --yes-i-really-mean-it

ceph-deploy

## 单个磁盘设备为一个osd结点,磁盘初始化
parted  /dev/sdb mklabel gpt -s
## 清理磁盘
ceph-volume lvm zap /dev/sdb
## 创建osd结点
ceph-deploy osd create --data  /dev/sdb 主机名

或是分为两个步骤,手动添加

## 单个磁盘设备为一个osd结点,磁盘初始化
parted  /dev/sdb mklabel gpt -s
## 清理磁盘
ceph-volume lvm zap /dev/sdb

## 创建osd结点

ceph-volume lvm prepare --data /dev/sdb
ceph-volume lvm activate 0 

关于ceph-volume命令相关,参考:http://docs.ceph.com/docs/master/ceph-volume/