Collect NSX-T NCP logs in PKS environment
search cancel

Collect NSX-T NCP logs in PKS environment

book

Article ID: 325710

calendar_today

Updated On:

Products

VMware NSX Networking

Issue/Introduction

Provide instructions to collect NCP logs with different options.

Symptoms:
This KB article describes how to collect NCP logs in PKS (1.2/ 1.3)  for NSX-T troubleshooting.

Environment

VMware NSX-T Data Center

Resolution

Get the deployment id of the kubernetes cluster and the instance id of the VM (master or worker))
Login Opsmanager or other machine with bosh client and kubectl client installed 

# bosh vms
Using environment '172.18.1.41' as client 'ops_manager'

Task 36563
Task 36562
Task 36563 done

Task 36562 done

Deployment 'pivotal-container-service-1ad5b09794ec7b43160d'

Instance                                                        Process State  AZ  IPs          VM CID                                   VM Type  Active
pivotal-container-service/3069599d-ba6b-453a-8e15-d8f5b8fdd004  running        AZ  172.18.1.42  vm-062fcfbc-962b-40fe-812a-4d8c68c9180b  large    true

1 vms

Deployment 'service-instance_60c7bef1-a796-4276-8001-cfa0aca85707'

Instance                                     Process State  AZ  IPs         VM CID                                   VM Type  Active
master/a8463a9d-8d06-45df-949f-13a6fb85ef82  running        AZ  172.30.0.2  vm-df8c41c0-9827-42b4-8aa6-1f8b145b904d  medium   true
worker/9100545d-c5e2-4c97-a6dd-5b28b80a3966  running        AZ  172.30.0.3  vm-d68ef49e-aa6d-474a-b5db-70f87c5c49c8  medium   true

2 vms


Generate NCP logs

Option 1:  Generate service instance logs including NCP logs. 


~# bosh logs -d service-instance_60c7bef1-a796-4276-8001-cfa0aca85707
Using environment '172.18.1.41' as client 'ops_manager'

Using deployment 'service-instance_60c7bef1-a796-4276-8001-cfa0aca85707'

Task 36690

Task 36690 | 18:43:37 | Fetching logs for worker/9100545d-c5e2-4c97-a6dd-5b28b80a3966 (0): Finding and packing log files
Task 36690 | 18:43:37 | Fetching logs for master/a8463a9d-8d06-45df-949f-13a6fb85ef82 (0): Finding and packing log files
Task 36690 | 18:43:42 | Fetching logs for worker/9100545d-c5e2-4c97-a6dd-5b28b80a3966 (0): Finding and packing log files (00:00:05)
Task 36690 | 18:43:58 | Fetching logs for master/a8463a9d-8d06-45df-949f-13a6fb85ef82 (0): Finding and packing log files (00:00:21)
Task 36690 | 18:44:01 | Fetching group of logs: Packing log files together

Task 36690 Started  Mon Apr  1 18:43:37 UTC 2019
Task 36690 Finished Mon Apr  1 18:44:01 UTC 2019
Task 36690 Duration 00:00:24
Task 36690 done

Downloading resource 'c3f46a3d-ba9b-43ab-844b-31e2419a7346' to '/root/service-instance_60c7bef1-a796-4276-8001-cfa0aca85707-20190401-144019-42423186.tgz'...

############################################                75.82% 75.23 MB/s 0s
Succeeded

Option 2:  Generate NCP logs by logging in PKS master node:

# bosh -d service-instance_60c7bef1-a796-4276-8001-cfa0aca85707 ssh master/a8463a9d-8d06-45df-949f-13a6fb85ef82
Using environment '172.18.1.41' as client 'ops_manager'

Using deployment 'service-instance_60c7bef1-a796-4276-8001-cfa0aca85707'

Task 36712. Done
Last login: Mon Apr  1 18:47:43 2019 from 172.18.1.181
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

master/a8463a9d-8d06-45df-949f-13a6fb85ef82:~$

$ sudo su -
master/a8463a9d-8d06-45df-949f-13a6fb85ef82:~#

# tar -zcvf /tmp/var-log-ncp.tar.gz /var/log
* Note this collect all logs including NCP

For live review, NCP logs are under /var/vcap/sys/log/ncp folder in master node
ncp.stdout.log
ncp.stderr.log 


Additional Information

Impact/Risks:
N/A