Add debug logging for Ceph OSD detection
Added log_info messages to show: - Count of OSDs found - Each device-to-OSD mapping as discovered Also fixed array subscript quoting in CEPH_DEVICE_TO_OSD. Run with --verbose to see Ceph detection diagnostics. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -665,6 +665,7 @@ build_ceph_cache() {
|
||||
# Parse ceph-volume lvm list output
|
||||
# Format: blocks starting with "====== osd.X =======" followed by device info
|
||||
local current_osd=""
|
||||
local osd_count=0
|
||||
while IFS= read -r line; do
|
||||
# Match OSD header: "====== osd.5 ======="
|
||||
if [[ "$line" =~ ======[[:space:]]+osd\.([0-9]+)[[:space:]]+======= ]]; then
|
||||
@@ -672,9 +673,12 @@ build_ceph_cache() {
|
||||
# Match block device line: " block device /dev/sda"
|
||||
elif [[ -n "$current_osd" && "$line" =~ block[[:space:]]device[[:space:]]+/dev/([^[:space:]]+) ]]; then
|
||||
local dev_name="${BASH_REMATCH[1]}"
|
||||
CEPH_DEVICE_TO_OSD[$dev_name]="$current_osd"
|
||||
CEPH_DEVICE_TO_OSD["$dev_name"]="$current_osd"
|
||||
((osd_count++))
|
||||
log_info "Found $current_osd on $dev_name"
|
||||
fi
|
||||
done < <(ceph-volume lvm list 2>/dev/null)
|
||||
log_info "Cached $osd_count Ceph OSDs"
|
||||
|
||||
# Skip if ceph command is not available
|
||||
if ! command -v ceph &>/dev/null; then
|
||||
|
||||
Reference in New Issue
Block a user