目的
RedHat OpenShift on IBM Cloud(ROKS)ではROKSのクラスタバージョン毎にsosreportの取得方法が異なるため、いくつかのバージョン毎にsosreportを取得する方法を紹介する。
IBMCloudの公式ドキュメントに取得方法の記載はあるが、クラスタやワーカーノードのバージョンによっては、手順通り実施できないことがあるので注意
参考ページ
sosreport について
How to generate a sos report within nodes without SSH in OpenShift Container Platform 4
SOSレポートの収集
バージョン毎の実施方法
バージョン毎に実施方法が異なる
バージョン | sosreport | toolbox |
---|---|---|
ROKS4.14以下 | ✅ OK | ❌ NG |
ROKS4.15 | ✅ OK | ✅ OK |
ROKS4.16以降 | ❌ NG | ✅ OK |
sosreportの取得[4.14]
4.14の場合、公式ドキュメントにあるtoolboxコンテナが使えないが、ホストから直接sosreportコマンドが使える。
NodeのIPを確認
% oc get node
NAME STATUS ROLES AGE VERSION
10.244.0.4 Ready master,worker 52d v1.27.16+03a907c
10.244.64.10 Ready master,worker 52d v1.27.16+03a907c
debugノードを起動する
% oc debug node/10.244.0.4
Starting pod/1024404-debug-8gw8g ...
To use host binaries, run `chroot /host`
Pod IP: 10.244.0.4
If you don't see a command prompt, try pressing enter.
chroot /hostを実施
sh-4.4# chroot /host
sh-4.4#
sosreportの取得
🧰 sosreport コマンドオプション
🔌 プラグインの有効化(-e)
-
-e openshift
:OpenShift プラグインを有効化 -
-e openshift_ovn
:OpenShift OVN プラグインを有効化 -
-e openvswitch
:Open vSwitch プラグインを有効化 -
-e podman
:Podman プラグインを有効化 -
-e crio
:CRIO プラグインを有効化
⚙️ プラグインオプションの設定(-k)
-
-k crio.all=on
:CRIO の詳細情報収集を有効化 -
-k crio.logs=on
:CRIO のログ収集を有効化 -
-k podman.all=on
:Podman の詳細情報収集を有効化 -
-k podman.logs=on
:Podman のログ収集を有効化 -
-k networking.ethtool-namespaces=off
:ethtool の名前空間分離を無効化
📦 ログ収集オプション
-
--all-logs
:サイズ制限なしで全ログを収集
⏱️ 実行制御オプション
-
--plugin-timeout=600
:各プラグインのタイムアウトを600秒に設定
実行するオプションはサポートに従い、必要な情報を取得すること
コマンドを実行
「sos report -e openshift -e openshift_ovn -e openvswitch -e podman -e crio -k crio.all=on -k crio.logs=on -k podman.all=on -k podman.logs=on -k networing.ethtool-namespaces=off --all-logs --plugin-timeout=600」
sh-4.4# sos report -e openshift -e openshift_ovn -e openvswitch -e podman -e crio -k crio.all=on -k crio.logs=on -k podman.all=on -k podman.logs=on -k networing.ethtool-namespaces=off --all-logs --plugin-timeout=600
sos report (version 4.9.1)
This command will collect diagnostic and configuration information from
this Red Hat Enterprise Linux system and installed applications.
An archive containing the collected information will be generated in
/var/tmp/sos.fldqm3dg and may be provided to a Red Hat support
representative.
Any information provided to Red Hat will be treated in accordance with
the published support policies at:
Distribution Website : https://www.redhat.com/
Commercial Support : https://access.redhat.com/
The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.
No changes will be made to system configuration.
Press ENTER to continue, or CTRL-C to quit.
**「Press ENTER to continue, or CTRL-C to quit」**と出るため、ENTERを押下
Press ENTER to continue, or CTRL-C to quit.
Optionally, please enter the case id that you are generating this report for:
Setting up archive ...
Setting up plugins ...
|
|省略
|
Starting 53/94 networkmanager [Running: dnf logs networking networkmanager] n]
Plugin dnf timed out
Starting 58/94 openshift [Running: logs networkmanager openshift]
Starting 62/94 ostree [Running: logs openvswitch ostree]
Plugin logs timed out
Starting 68/94 processor [Running: openvswitch process processor]
Finishing plugins [Running: subscription_manager systemd] [plugin:systemd] command 'systemctl status --all' timed out after 300s
[plugin:subscription_manager] command 'subscription-manager list --all --available' timed out after 300s
Finishing plugins [Running: systemd]
Creating compressed archive...
Your sos report has been generated and saved in:
/var/tmp/sosreport-kube-cq29stct0hgp9gqe8hsg-acspaasoccl-lowspec-0000139e-2025-10-05-apqhukk.tar.xz
Size 614.69MiB
Owner root
sha256 2e711d07313d72e19d20251dd91bd021d5cc0583dcf6d6b81f921440524b8951
Please send this file to your support representative.
30分~60分ほど待つとレポートが生成される
レポートの保存先はコマンド結果に表示されているので確認する
Your sos report has been generated and saved in:
/var/tmp/sosreport-kube-cq29stct0hgp9gqe8hsg-acspaasoccl-lowspec-0000139e-2025-10-05-apqhukk.tar.xz
sosreportのダウンロード
sosreportを適当な場所にコピー
sh-4.4# cp /var/tmp/sosreport-kube-cq29stct0hgp9gqe8hsg-acspaasoccl-lowspec-0000139e-2025-10-05-apqhukk.tar.xz /tmp/sosreport.tar.xz
sh-4.4# ls /tmp
crio-goroutine-stacks-2025-10-05T211918-0500.log sosreport.tar.xz systemd-private-5003f6f889fc4b0681084107796d3c22-chronyd.service-TR0Elo
debug podの名前を確認
% oc get pod
NAME READY STATUS RESTARTS AGE
1024404-debug-8gw8g 1/1 Running 0 81m
Namespaceを確認
以下の例では、「default」がnamespace
oc get pods --all-namespaces | grep 1024412888-debug-rf9dj
default 1024412888-debug-rf9dj 1/1 Running 0 10m
ローカルPCにsosreportをダウンロード
下記はローカルPCのデスクトップにコピーした状態
oc cp <namespace>/<debug pod name>:/host/<sosreportパス> <ローカルPCのパス>
oc cp default/1024404-debug-8gw8g:/host/tmp/sosreport.tar.xz ~/Desktop/sosreport.tar.xz
% ls ~/Desktop/sosreport.tar.xz
/Users/kh/Desktop/sosreport.tar.xz
sosreportの削除
コピーしたファイルと、出力された二つのファイルを削除
sh-4.4# rm -rf sosreport.tar.xz
sh-4.4# rm -rf /var/tmp/sosreport-kube-cq29stct0hgp9gqe8hsg-acspaasoccl-lowspec-0000139e-2025-10-05-apqhukk.tar.xz
sh-4.4# ls /tmp
crio-goroutine-stacks-2025-10-05T211918-0500.log
systemd-private-5003f6f889fc4b0681084107796d3c22-chronyd.service-TR0Elo
sh-4.4# ls /var/tmp
crio-log-16e754b4f6d610a2f52eaa2560ade73a45bd71b2e44604e69533e052fa9815524201912545
exec-process-131958363
exec-process-261611256
pidfile246185144
sos.egmrcve0
debug nodeの停止
sh-4.4# exit
exit
sh-4.4# exit
exit
Removing debug pod ...
sosreportの取得[4.16以降のRHEL8/9、RHCOSノード]
「NodeのIPを確認」、「debugノードを起動する」および「chroot /hostを実施」までは一緒
以下の様に、sosreportを取得しようとするとエラーとなる
sh-5.1# sos report
sh: sos: command not found
代わりにtoolboxというコンテナが使えるので、toolboxを実行する
toolbox起動時にワーカーノードからRedHatイメージプルをするので、インターネットへの接続が必要
sh-5.1# toolbox
Trying to pull registry.redhat.io/rhel9/support-tools:latest...
Getting image source signatures
Checking if image destination supports signatures
Copying blob 97718391176c done |
Copying blob 74956640af32 done |
Copying config a46baefd96 done |
Writing manifest to image destination
Storing signatures
a46baefd96eef0f353f3454364d157bbbd4c6e35b14a551dee466c297887355c
Spawning a container 'toolbox-root' with image 'registry.redhat.io/rhel9/support-tools'
Detected RUN label in the container image. Using that as the default...
6fa53d798ae7f076887d9d91b5c77aa92692a859fce33971c531293ed9359238
toolbox-root
Container started successfully. To exit, type 'exit'.
あとは同じようにsosreportコマンドを実施可能
[root@kube-d3hij3ct0hhq33eav5c0-acspaasrhco-default-000001ba /]# sos report -e openshift -e openshift_ovn -e openvswitch -e podman -e crio -k crio.all=on -k crio.logs=on -k podman.all=on -k podman.logs=on -k networking.ethtool-namespaces=off --all-logs --plugin-timeout=600
sos report (version 4.9.2)
This command will collect diagnostic and configuration information from
this Red Hat Enterprise Linux system and installed applications.
An archive containing the collected information will be generated in
/host/var/tmp/sos.rwx3il93 and may be provided to a Red Hat support
representative.
Any information provided to Red Hat will be treated in accordance with
the published support policies at:
Distribution Website : https://www.redhat.com/
Commercial Support : https://access.redhat.com/
The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.
No changes will be made to system configuration.
Press ENTER to continue, or CTRL-C to quit.
toolboxからファイル(sosreport)のダウンロード
sosreport生成後、ROKS toolboxからdebug podにコピーしローカルPCまで持ってくる方法
[流れ]
toolboxでsosreportを生成
↓
toolboxからdebug podへファイルをコピー
↓
debug podからローカルPCへファイルをコピー
SOSレポートの出力パスを確認
SOSレポートの生成が完了すると、コンソールに出力ファイルのパスが表示されるので、そのパスを控える
以下の例では、「/tmp/sosreport-kube-d3i6nort0s32h4k54q20-octest-myworke-00000492-2025-10-07-hanhzkf.tar.xz」をメモ
Creating compressed archive...
Your sos report has been generated and saved in:
/tmp/sosreport-kube-d3i6nort0s32h4k54q20-octest-myworke-00000492-2025-10-07-hanhzkf.tar.xz
Size 24.20MiB
Owner root
sha256 b813b0c57ffcab48c4db4d4ce294bba025c9338e80093fad7638d47f4094b07d
toolboxからDebug Podにファイルをコピー
toolboxから抜けてshellメニューへ移動
Container started successfully. To exit, type 'exit'.
[root@kube-d3i6nort0s32h4k54q20-octest-myworke-00000492 /]# exit
exit
sh-4.4#
podman cp コマンドを使ってtoolboxからDebug Podにファイルをコピー
podman cp toolbox-root:<SOSレポートの出力パス> <Debug Pod内のコピー先パス>
sh-4.4# podman cp toolbox-root:/tmp/sosreport-kube-d3i6nort0s32h4k54q20-octest-myworke-00000492-2025-10-07-hanhzkf.tar.xz /tmp/sosreport-d3i6nort0s32h4k54q20.tar.xz
Debug Podの名前を確認
以下の例では「1024412888-debug-rf9dj」がdebug podの名前
oc get pod
NAME READY STATUS RESTARTS AGE
1024412888-debug-rf9dj 1/1 Running 0 4m17s
Namespaceを確認
以下の例では、「default」がnamespace
oc get pods --all-namespaces | grep 1024412888-debug-rf9dj
default 1024412888-debug-rf9dj 1/1 Running 0 10m
debug podからローカルPCにsosreportをダウンロード
下記はローカルPCのデスクトップにコピーした状態
oc cp <namespace>/<debug pod name>:/host/<sosreportパス> <ローカルPCのパス>
oc cp default/1024412888-debug-rf9dj:host/tmp/sosreport-d3i6nort0s32h4k54q20.tar.xz ./sosreport-d3i6nort0s32h4k54q20.tar.xz
最後にsosreportの削除とdebug podの削除を実施すること
sosreportコマンド実行時によく発生するエラー
sos reportコマンド実行時によくあるエラーについて
/host/var/tmpが利用できないエラーとなって実行できない場合がある
この場合は、別のフォルダにsos reportを出力して回避可能
[root@kube-d3hlj2lt0otsud4mrk00-dltest-default-000001d8 /]# sos report
temporary directory /host/var/tmp does not exist or is not writable
下記の場合、/tmpにsos reportを出力する
sos report --tmp-dir /tmp -e openshift -e openshift_ovn -e openvswitch -e podman -e crio -k crio.all=on -k crio.logs=on -k podman.all=on -k podman.logs=on -k networing.ethtool-namespaces=off --all-logs --plugin-timeout=600
Your sos report has been generated and saved in:
/host/tmp/sosreport-kube-d3hlj2lt0otsud4mrk00-dltest-default-000001d8-2025-10-06-qfpkivj.tar.xz