For anyone getting started with vRealize Automation (vRA) 8.x you’ve probably noticed (or will soon notice) a lot has changed under the hood. The appliance now runs everything in containers. This makes certain things like troubleshooting actions in vRealize Orchestrator a bit more difficult– at first.
In the vRA 7.x world you just need to ssh into the vRA appliance and find the log in /var/log/… In 8.x with containers, the process is similar however you need to first get a shell on the appropriate container. That process is described in this article.
When using ‘External Values’ with a vRA custom form element, you may occasionally run into non-descript errors that require additional investigation to identify the cause. There is in vRA 8.x there is quick way to view a aggregate of the logs and a slower process to access the scripting.log and other logs. Both processes are outlined below.
Logging into the appliance
SSH into the vRA appliance.
Aggregate log method
This method displays an aggregate of the log files in the container. It’s good for quickly looking for an issue, but can be quite busy depending on the source.
- List all available pods in the prelude namespace, locate the name of the ‘vco’ pod (This is the Orchestrator pod). This process can be used for other pods as well.
kubectl -n prelude get pods
- To view and tail a log use the following command:
kubectl -n prelude logs <pod_name> -f
- If a pod contains multiple containers, you will be presented with an error which requires additional input.
To specify a specific container use the following command:
kubectl -n prelude logs <pod_name> -f <container name>
kubectl -n prelude logs vco-app-56858bccf6-hrcj4 -f vco-server-app
kubectl -n prelude logs vco-app-56858bccf6-hrcj4 -f vco-server-app | grep -A 1 -B 1 "is null"
In container logs method
- List all available prelude pods, locate the name of the ‘vco’ pod (This is the Orchestrator pod). This process can be used for other pods as well.
kubectl -n prelude get pods
- Find the which containers are present in the pod by running the describe command. This will present a verbose output of the makeup of the pod which includes the container names.
kubectl describe pod/<pod_name> -n <namespace>Example:
kubectl describe pod/vco-app-56858bccf6-hrcj4 -n prelude
The output we are interested will be formatted and show the container names like this. Here are the container names which are needed for the next step.
Containers: vco-polyglot-runner: ... vco-server-app: ... vco-controlcenter-app: ...
- Get a shell on the container running in the pod
kubectl -n <namespace> exec -ti <pod_name> -c <container_name> <command>Example:
kubectl -n prelude exec -ti vco-app-56858bccf6-hrcj4 -c vco-server-app bash
- Locate and enjoy the logs
find . -name "*.log"
- Tail the log of your choice
tail -f /usr/lib/vco/app-server/logs/scripting.log