Comment 5 for bug 1780332

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

osd_fsid gets generated in the ceph lib called from the ceph-osd charm. It's just a version 4 (randomized) uuid - nothing special.

_ceph_volume -> fsid UUID generated -> _allocate_logical_volume -> vaultlocker -> LUKS header

lib/ceph/utils.py:
def _ceph_volume(dev, osd_journal, encrypt=False, bluestore=False,
                 key_manager=CEPH_KEY_MANAGER):
    """
    Prepare and activate a device for usage as a Ceph OSD using ceph-volume.

    # ...
    osd_fsid = str(uuid.uuid4())
    cmd.append('--osd-fsid')
    cmd.append(osd_fsid)
    # ...

    # calls to _allocate_logical_volume

def _allocate_logical_volume(dev, lv_type, osd_fsid,
                             size=None, shared=False,
                             encrypt=False,
                             key_manager=CEPH_KEY_MANAGER):
    """
    Allocate a logical volume from a block device, ensuring any
    required initialization and setup of PV's and VG's to support
    the LV.
    # ...

    lv_name = "osd-{}-{}".format(lv_type, osd_fsid)
    current_volumes = lvm.list_logical_volumes()
    if shared:
        dev_uuid = str(uuid.uuid4())
    else:
        dev_uuid = osd_fsid # the uuid is reused here
    pv_dev = _initialize_disk(dev, dev_uuid, encrypt, key_manager) # calls vaultlocker