OpenShift Container Storage is now OpenShift Data Foundation starting with version 4.9.
Este conteúdo não está disponível no idioma selecionado.
Chapter 3. Commonly required logs for troubleshooting
Some of the commonly used logs for troubleshooting OpenShift Container Storage are listed, along with the commands to generate them.
Generating logs for a specific pod:
oc logs <pod-name> -n <namespace>
$ oc logs <pod-name> -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generating logs for Ceph or OpenShift Container Storage cluster:
oc logs rook-ceph-operator-<ID> -n openshift-storage
$ oc logs rook-ceph-operator-<ID> -n openshift-storageCopy to Clipboard Copied! Toggle word wrap Toggle overflow Generating logs for plugin pods like cephfs or rbd to detect any problem in the PVC mount of the app-pod:
oc logs csi-cephfsplugin-<ID> -n openshift-storage -c csi-cephfsplugin
$ oc logs csi-cephfsplugin-<ID> -n openshift-storage -c csi-cephfspluginCopy to Clipboard Copied! Toggle word wrap Toggle overflow oc logs csi-rbdplugin-<ID> -n openshift-storage -c csi-rbdplugin
$ oc logs csi-rbdplugin-<ID> -n openshift-storage -c csi-rbdpluginCopy to Clipboard Copied! Toggle word wrap Toggle overflow To generate logs for all the containers in the CSI pod:
oc logs csi-cephfsplugin-<ID> -n openshift-storage --all-containers
$ oc logs csi-cephfsplugin-<ID> -n openshift-storage --all-containersCopy to Clipboard Copied! Toggle word wrap Toggle overflow oc logs csi-rbdplugin-<ID> -n openshift-storage --all-containers
$ oc logs csi-rbdplugin-<ID> -n openshift-storage --all-containersCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Generating logs for cephfs or rbd provisioner pods to detect problems if PVC is not in BOUND state:
oc logs csi-cephfsplugin-provisioner-<ID> -n openshift-storage -c csi-cephfsplugin
$ oc logs csi-cephfsplugin-provisioner-<ID> -n openshift-storage -c csi-cephfspluginCopy to Clipboard Copied! Toggle word wrap Toggle overflow oc logs csi-rbdplugin-provisioner-<ID> -n openshift-storage -c csi-rbdplugin
$ oc logs csi-rbdplugin-provisioner-<ID> -n openshift-storage -c csi-rbdpluginCopy to Clipboard Copied! Toggle word wrap Toggle overflow To generate logs for all the containers in the CSI pod:
oc logs csi-cephfsplugin-provisioner-<ID> -n openshift-storage --all-containers
$ oc logs csi-cephfsplugin-provisioner-<ID> -n openshift-storage --all-containersCopy to Clipboard Copied! Toggle word wrap Toggle overflow oc logs csi-rbdplugin-provisioner-<ID> -n openshift-storage --all-containers
$ oc logs csi-rbdplugin-provisioner-<ID> -n openshift-storage --all-containersCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Generating OpenShift Container Storage logs using cluster-info command:
oc cluster-info dump -n openshift-storage --output-directory=<directory-name>
$ oc cluster-info dump -n openshift-storage --output-directory=<directory-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check the OpenShift Container Storage operator logs and events.
To check the operator logs :
oc logs <ocs-operator> -n openshift-storage
# oc logs <ocs-operator> -n openshift-storageCopy to Clipboard Copied! Toggle word wrap Toggle overflow - <ocs-operator>
oc get pods -n openshift-storage | grep -i "ocs-operator" | awk '{print $1}'# oc get pods -n openshift-storage | grep -i "ocs-operator" | awk '{print $1}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
To check the operator events :
oc get events --sort-by=metadata.creationTimestamp -n openshift-storage
# oc get events --sort-by=metadata.creationTimestamp -n openshift-storageCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Get the OpenShift Container Storage operator version and channel.
oc get csv -n openshift-storage
# oc get csv -n openshift-storageCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output :
NAME DISPLAY VERSION REPLACES PHASE ocs-operator.v4.7.2 OpenShift Container Storage 4.7.2 Succeeded
NAME DISPLAY VERSION REPLACES PHASE ocs-operator.v4.7.2 OpenShift Container Storage 4.7.2 SucceededCopy to Clipboard Copied! Toggle word wrap Toggle overflow oc get subs -n openshift-storage
# oc get subs -n openshift-storageCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output :
NAME PACKAGE SOURCE CHANNEL ocs-operator ocs-operator redhat-operators stable-4.7
NAME PACKAGE SOURCE CHANNEL ocs-operator ocs-operator redhat-operators stable-4.7Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the installplan is created.
oc get installplan -n openshift-storage
# oc get installplan -n openshift-storageCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the image of the components post updating OpenShift Container Storage.
Check the node on which the pod of the component you want to verify the image is running.
oc get pods -o wide | grep <component-name>
# oc get pods -o wide | grep <component-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For Example :
oc get pods -o wide | grep rook-ceph-operator
# oc get pods -o wide | grep rook-ceph-operatorCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
rook-ceph-operator-566cc677fd-bjqnb 1/1 Running 20 4h6m 10.128.2.5 rook-ceph-operator-566cc677fd-bjqnb 1/1 Running 20 4h6m 10.128.2.5 dell-r440-12.gsslab.pnq2.redhat.com <none> <none> <none> <none>
rook-ceph-operator-566cc677fd-bjqnb 1/1 Running 20 4h6m 10.128.2.5 rook-ceph-operator-566cc677fd-bjqnb 1/1 Running 20 4h6m 10.128.2.5 dell-r440-12.gsslab.pnq2.redhat.com <none> <none> <none> <none>Copy to Clipboard Copied! Toggle word wrap Toggle overflow dell-r440-12.gsslab.pnq2.redhat.comis the node-name.Check the image ID.
oc debug node/<node name>
# oc debug node/<node name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow <node-name>
Is the name of the node on which the pod of the component you want to verify the image is running.
chroot /host
# chroot /hostCopy to Clipboard Copied! Toggle word wrap Toggle overflow crictl images | grep <component>
# crictl images | grep <component>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For Example :
crictl images | grep rook-ceph
# crictl images | grep rook-cephCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
IMAGE TAG IMAGEID SIZE registry.redhat.io/ocs4/rook-ceph-rhel8-operator@sha256 <none> 5600a36370df4 1.55GBIMAGE TAG IMAGEID SIZE registry.redhat.io/ocs4/rook-ceph-rhel8-operator@sha256 <none> 5600a36370df4 1.55GBCopy to Clipboard Copied! Toggle word wrap Toggle overflow Take a note of the
IMAGEIDand map it to the Digest ID on the Rook Ceph Operator page.
Additional resources