3.6. Generating a sosreport archive for an OpenShift Container Platform cluster node
The recommended way to generate a sosreport for an OpenShift Container Platform 4.5 cluster node is through a debug pod.
Prerequisites
-
You have access to the cluster as a user with the
cluster-adminrole. - You have SSH access to your hosts.
-
You have installed the OpenShift CLI (
oc). - You have a Red Hat standard or premium Subscription.
- You have a Red Hat Customer Portal account.
- You have an existing Red Hat Support case ID.
Procedure
Obtain a list of cluster nodes:
$ oc get nodesEnter into a debug session on the target node. This step instantiates a debug pod called
<node_name>-debug:$ oc debug node/my-cluster-nodeSet
/hostas the root directory within the debug shell. The debug pod mounts the host’s root file system in/hostwithin the pod. By changing the root directory to/host, you can run binaries contained in the host’s executable paths:# chroot /host注意OpenShift Container Platform 4.5 cluster nodes running Red Hat Enterprise Linux CoreOS (RHCOS) are immutable and rely on Operators to apply cluster changes. Accessing cluster nodes using SSH is not recommended and nodes will be tainted as accessed. However, if the OpenShift Container Platform API is not available, or the kubelet is not properly functioning on the target node,
ocoperations will be impacted. In such situations, it is possible to access nodes usingssh core@<node>.<cluster_name>.<base_domain>instead.Start a
toolboxcontainer, which includes the required binaries and plug-ins to runsosreport:# toolbox注意If an existing
toolboxpod is already running, thetoolboxcommand outputs'toolbox-' already exists. Trying to start…. Remove the running toolbox container withpodman rm toolbox-and spawn a new toolbox container, to avoid issues withsosreportplug-ins.Collect a
sosreportarchive.Run the
sosreportcommand and enable thecrio.allandcrio.logsCRI-O container enginesosreportplug-ins:# sosreport -k crio.all=on -k crio.logs=on1 - 1
-kenables you to definesosreportplug-in parameters outside of the defaults.
- Press Enter when prompted, to continue.
-
Provide the Red Hat Support case ID.
sosreportadds the ID to the archive’s file name. The
sosreportoutput provides the archive’s location and checksum. The following sample output references support case ID01234567:Your sosreport has been generated and saved in: /host/var/tmp/sosreport-my-cluster-node-01234567-2020-05-28-eyjknxt.tar.xz1 The checksum is: 382ffc167510fd71b4f12a4f40b97a4e- 1
- The
sosreportarchive’s file path is outside of thechrootenvironment because the toolbox container mounts the host’s root directory at/host.
Provide the
sosreportarchive to Red Hat Support for analysis, using one of the following methods.Upload the file to an existing Red Hat support case directly from an OpenShift Container Platform cluster.
From within the toolbox container, run
redhat-support-toolto attach the archive directly to an existing Red Hat support case. This example uses support case ID01234567:# redhat-support-tool addattachment -c 01234567 /host/var/tmp/my-sosreport.tar.xz1 - 1
- The toolbox container mounts the host’s root directory at
/host. Reference the absolute path from the toolbox container’s root directory, including/host/, when specifying files to upload through theredhat-support-toolcommand.
Upload the file to an existing Red Hat support case.
Concatenate the
sosreportarchive by running theoc debug node/<node_name>command and redirect the output to a file. This command assumes you have exited the previousoc debugsession:$ oc debug node/my-cluster-node -- bash -c 'cat /host/var/tmp/sosreport-my-cluster-node-01234567-2020-05-28-eyjknxt.tar.xz' > /tmp/sosreport-my-cluster-node-01234567-2020-05-28-eyjknxt.tar.xz1 - 1
- The debug container mounts the host’s root directory at
/host. Reference the absolute path from the debug container’s root directory, including/host, when specifying target files for concatenation.
注意OpenShift Container Platform 4.5 cluster nodes running Red Hat Enterprise Linux CoreOS (RHCOS) are immutable and rely on Operators to apply cluster changes. Transferring a
sosreportarchive from a cluster node by usingscpis not recommended and nodes will be tainted as accessed. However, if the OpenShift Container Platform API is not available, or the kubelet is not properly functioning on the target node,ocoperations will be impacted. In such situations, it is possible to copy asosreportarchive from a node by runningscp core@<node>.<cluster_name>.<base_domain>:<file_path> <local_path>.- Navigate to an existing support case within https://access.redhat.com/support/cases/.
- Select Attach files and follow the prompts to upload the file.