Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csi: add logrotate file to a csi log dir #179

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions collection-scripts/gather_ceph_logs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ for ns in $namespaces; do
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}-debug" | awk '{print $1}')":/host/var/lib/rook/"${ns}"/log "${CEPH_DAEMON_LOG_OUTPUT_DIR}"
}

# Collecting csi and ceph daemon logs
csi_log_collection() {
dbglog "collecting csi and ceph daemon logs from node ${node}"
# as per the correction we are keeping both /var/lib/rook & /var/log/ceph for ceph pods, as to not break anything
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}-debug" | awk '{print $1}')":/host/var/log/ceph/ "${CEPH_DAEMON_LOG_OUTPUT_DIR}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once the csi operator changes are done we need to add the query the driver and get the host path here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ceph daemon logs are collected above right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path is incorrect /var/lib/rook which should be /var/log/ceph

As discussed offline already we will keep both as not break anything

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is resolved then, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes correct, will have a follow up PR once CSI-operator is there,
Till now it works with Rook operator

oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}-debug" | awk '{print $1}')":/host/var/lib/rook/"${ns}".rbd.csi.ceph.com/log "${CSI_LOG_OUTPUT_DIR}"
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}-debug" | awk '{print $1}')":/host/var/lib/rook/"${ns}".cephfs.csi.ceph.com/log "${CSI_LOG_OUTPUT_DIR}"
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}-debug" | awk '{print $1}')":/host/var/lib/rook/"${ns}".nfs.csi.ceph.com/log "${CSI_LOG_OUTPUT_DIR}"
}

crash_core_collection() {
dbglog "collecting crash core dump from node ${node}"
oc rsync -n "${ns}" "$(oc get pods -n "${ns}" --no-headers | grep "${node//./}"-debug | awk '{print $1}')":/host/var/lib/rook/"${ns}"/crash/ "${CRASH_OUTPUT_DIR}"
Expand Down Expand Up @@ -45,15 +55,18 @@ CMDS
dbglog "collecting crash, journal and volume logs from node ${node}"
CRASH_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/crash_${node}
CEPH_DAEMON_LOG_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/ceph_daemon_log_${node}
CSI_LOG_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/csi_log_${node}
JOURNAL_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/journal_${node}
KERNEL_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/kernel_${node}
COREDUMP_OUTPUT_DIR=${CEPH_COLLECTION_PATH}/coredump_${node}
mkdir -p "${CRASH_OUTPUT_DIR}"
mkdir -p "${CEPH_DAEMON_LOG_OUTPUT_DIR}"
parth-gr marked this conversation as resolved.
Show resolved Hide resolved
mkdir -p "${CSI_LOG_OUTPUT_DIR}"
mkdir -p "${JOURNAL_OUTPUT_DIR}"
mkdir -p "${KERNEL_OUTPUT_DIR}"
mkdir -p "${COREDUMP_OUTPUT_DIR}"
ceph_daemon_log_collection &
csi_log_collection &
pids_log+=($!)
crash_core_collection &
pids_log+=($!)
Expand Down
Loading