Rate This Document
Findability
Accuracy
Completeness
Readability

"Failed to execute command" Displayed When Creating OSDs on Ceph

Symptom

Environment settings

Category

Item

Version

Hardware

CPU

Kunpeng 920 processor

Network

Ethernet-10GE

Storage

3 x 480 GB SSD

Memory

1024 GB

OS

CentOS

7.6

Kernel

4.14.0

Software

ceph-deploy

2.0.0

Python

2.7

Problem description: When the ceph-deploy osd create ceph1 --data /dev/bcache0 --block-db /dev/sdb1 --block-wal /dev/sdb2 command is executed to create an OSD, the message "OSError: [Error 2] No such file or directory: '/var/lib/ceph/osd/ceph-0'......[ceph1][ERROR ]RuntimeError: command returned non-zero exit status: 1 [cpeh_deploy.osd][ERROR ] Failed to execute command:/usr/sbin/ceph-volume --cluster ceph lvm create --bluestore --data /dev/bcache0 --block.wal /dev/sdb2 --block.db /dev/sdb1" is displayed.

Key Process and Cause Analysis

  • Cause 1: The /var/lib/ceph/osd/ceph-0 file does not exist.
  • Cause 2: The WAL and DB drives are partitioned using the fdisk /dev/sdb command.

Conclusion and Solution

  • For cause 1, manually create the file.
    mkdir -p /var/lib/ceph/osd/ceph-0
  • For cause 2, you are advised to use the parted utility to create partitions as follows:
    parted -s /dev/sdb mklabel gpt
    parted /dev/sdb mkpart primary xfs 2048s 240000     ### Partition 1, 240 GB
    parted /dev/sdb mkpart primary xfs 240000  480000   ### Partition 2, 240 GB