def _is_valid_dev_type(device_info, vg):
    if (
        'E: MAJOR' in device_info and
        int(device_info['E: MAJOR']) not in VALID_MAJORS
    ):
        # NOTE(agordeev): filter out cd/dvd drives and other
        # block devices in which bareon aren't interested
        return False

    if any(
        os.path.basename(device_info['E: DEVNAME']).startswith(n)
        for n in ('nbd', 'ram', 'loop')
    ):
        return False

    if 'E: DEVNAME' not in device_info:
        return False

    if (vg and 'E: DM_VG_NAME' in device_info or
       not vg and 'E: DM_VG_NAME' not in device_info):
        return True
    else:
        return False
Returns bool value if we should use device based on different rules:
dataset/ETHPy150Open openstack/bareon/bareon/utils/hardware.py/_is_valid_dev_type