Project

General

Profile

Bug #38935

ceph-volume v12.2.10 OSError(no such file or directory) when try to create an osd

Added by dovefi Z about 5 years ago. Updated almost 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Community (user)
Tags:
ceph-volume luminous v12.2.10
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

i try to use ceph-volume to create an osd manually,Command is as follows

ceph-volume lvm create --data /dev/vdc --osd-id=0 --bluestore

but it return an OSError
OSError: (2, 'No such file or directory', '/var/lib/ceph/osd/ceph-0')

so i read the ceph-volume source code,and it found the reason in src/ceph_volume/util/system.py line:86
def mkdir_p(path, chown=True):
    """ 
    A `mkdir -p` that defaults to chown the path to the ceph user
    """ 
    try:
        os.mkdir(path)
    except OSError as e:
        if e.errno == errno.EEXIST:
            pass
        else:
            raise
    if chown:
        uid, gid = get_ceph_user_ids()
        os.chown(path, uid, gid)

it use os.mkdir(path) method to create dir,but actually /var/lib/ceph/osd is not exist, so may be it should use
os.mkdirs(path)

and it really work

History

#1 Updated by dovefi Z about 5 years ago

sorry , it should be

os.makedirs(path)

#2 Updated by Brad Hubbard about 5 years ago

  • Project changed from Ceph to ceph-volume
  • Category deleted (common)

#3 Updated by Andrew Schoen almost 5 years ago

The --osd-id flag was intended to reuse an ID that had been previously used, not explicitly set the ID for a new osd. That being said, we could probably fail more gracefully here.

#4 Updated by dovefi Z almost 5 years ago

Andrew Schoen wrote:

The --osd-id flag was intended to reuse an ID that had been previously used, not explicitly set the ID for a new osd. That being said, we could probably fail more gracefully here.

is there any problem ? if it can set the ID for a new osd

Also available in: Atom PDF