[SOLVED] Ceph failed to create osd

damu2025

New Member
Jan 19, 2025
2
0
1
Hello,
I changed the public_network and cluster_network in my cluster(pve 8.3.2 ceph 19.2.0),before that, i destoried all the osds in web ui.However,when I tried to recreate the osds,two of three nodes given me a strange error message.

Code:
Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
  WARNING: scan of VG vgubuntu from /dev/zd208 mda1 found mda_checksum 89a5bb4 mda_size 2038 vs 997f18e3 2038
  WARNING: Scanning /dev/zd208 mda1 found mismatch with other metadata.
  WARNING: scan failed to get metadata summary from /dev/zd208 PVID Aba4jmoGujHEkpMJQc4YJKk4hQTpQoXC
  WARNING: VG name vgubuntu is used by VGs d5eFx3-UeHB-a2BB-iw2H-Vm4f-qEGC-Ii0sWP and GR8kvD-eStv-gqJy-8tz6-yGAd-7Okq-kgWtQf.
  Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
  WARNING: VG name ubuntu-vg is used by VGs 6Jf5f7-jVL1-5Dce-NfQ2-KLrM-CB9u-BCt2FS and fFXpWz-ZDum-7R8a-T2j5-GrT4-nCi2-ZU6dmi.
  Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
  WARNING: Not using device /dev/zd64p3 for PV mliyjz-rOY9-zab8-ZJ93-rFVg-7WHh-3IVoeW.
  WARNING: Not using device /dev/zd384p3 for PV bFyMiu-0CtK-2jG6-HSxu-Hpb1-W8BS-FgSBgJ.
  WARNING: PV mliyjz-rOY9-zab8-ZJ93-rFVg-7WHh-3IVoeW prefers device /dev/zd0p3 because device was seen first.
  WARNING: PV bFyMiu-0CtK-2jG6-HSxu-Hpb1-W8BS-FgSBgJ prefers device /dev/zd80p3 because device was seen first.
create OSD on /dev/sda (bluestore)
wiping block device /dev/sda
200+0 records in
200+0 records out
209715200 bytes (210 MB, 200 MiB) copied, 0.722457 s, 290 MB/s
-->  AttributeError: 'NoneType' object has no attribute 'startswith'
TASK ERROR: command 'ceph-volume lvm create --data /dev/sda' failed: exit code 1

After some searching, it seems that the vgrename problem has no effect on osd create.Is it right?And how to fix the osd create problem?

Thanks a lot!
 
Done.Found some log in /var/log/ceph/ceph-volume.log
Code:
[2025-01-22 10:42:35,607][ceph_volume][ERROR ] exception caught by decorator
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ceph_volume/decorators.py", line 59, in newfunc
    return f(*a, **kw)
           ^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ceph_volume/main.py", line 166, in main
    terminal.dispatch(self.mapper, subcommand_args)
  File "/usr/lib/python3/dist-packages/ceph_volume/terminal.py", line 194, in dispatch
    instance.main()
  File "/usr/lib/python3/dist-packages/ceph_volume/devices/lvm/main.py", line 46, in main
    terminal.dispatch(self.mapper, self.argv)
  File "/usr/lib/python3/dist-packages/ceph_volume/terminal.py", line 194, in dispatch
    instance.main()
  File "/usr/lib/python3/dist-packages/ceph_volume/devices/lvm/prepare.py", line 55, in main
    self.args = parser.parse_args(self.argv)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 1874, in parse_args
    args, argv = self.parse_known_args(args, namespace)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 1907, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 2119, in _parse_known_args
    start_index = consume_optional(start_index)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 2059, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib/python3.11/argparse.py", line 1967, in take_action
    argument_values = self._get_values(action, argument_strings)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 2501, in _get_values
    value = self._get_value(action, arg_string)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/argparse.py", line 2534, in _get_value
    result = type_func(arg_string)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ceph_volume/util/arg_validators.py", line 75, in __call__
    super().get_device(dev_path)
  File "/usr/lib/python3/dist-packages/ceph_volume/util/arg_validators.py", line 33, in get_device
    self._device = Device(dev_path)
                   ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ceph_volume/util/device.py", line 125, in __init__
    sys_info.devices = disk.get_devices()
                       ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ceph_volume/util/disk.py", line 844, in get_devices
    if is_ceph_rbd(diskname):
       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ceph_volume/util/disk.py", line 386, in is_ceph_rbd
    return dev.startswith(('/dev/rbd'))
           ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'startswith'

Go to /usr/lib/python3/dist-packages/ceph_volume/util/disk.py, found out zhe function do not have empty object protection.
Code:
def is_ceph_rbd(dev):
    """
    Boolean to determine if a given device is a ceph RBD device, like /dev/rbd0
    """
    return dev.startswith(('/dev/rbd'))

Edit it like this.
Code:
def is_ceph_rbd(dev):
    """
    Boolean to determine if a given device is a ceph RBD device, like /dev/rbd0
    """
    if dev is not None:
        return dev.startswith(('/dev/rbd'))
    else:
        return False

In the same file,i found out that funtion is_mapper_device(device_name) has the same problem.Fix it like this.
Code:
def is_mapper_device(device_name):
    if device_name is not None:
        return device_name.startswith(('/dev/mapper', '/dev/dm-'))
    else:
        return False
After all, i got my new osds.
To do : find out why ceph pass a none object into this funtion?
 
Hello, I ran into same issue on debian 12. seems that my issue was the name of a lvm volume group.
from source https://github.com/ceph/ceph/blob/v18.2.4/src/ceph-volume/ceph_volume/api/lvm.py line 1224:
Python:
    results = re.split(r'^\/dev\/mapper\/(.+\w)-(\w.+)', mapper)
    results = list(filter(None, results))

    if len(results) != 2:
        return None

my volume name was /dev/mapper/data-1 after renaming into /dev/mapper/data-data1 (lvrename data 1 data1) the cepth-volume inventory return all volumes without issue.