Skip to content

Commit

Permalink
Merge pull request clearcontainers#595 from mcastelino/topic/docs
Browse files Browse the repository at this point in the history
Docs: Add documentation for obtaining VM Kernel logs
  • Loading branch information
Samuel Ortiz authored Sep 28, 2017
2 parents dd85a0a + 37db7c0 commit 14a68bd
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/debug-kernel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Get cc-runtime Kernel logs

The `cc-runtime` launches a virtual machine when a new pod is
created. This virtual machine (VM) uses a custom kernel inside the VM.

The kernel boot logs are disabled by default. However these logs may be desired
when the kernel is customized by the end user, or if the virtual machine boot
fails due to the kernel.

To provide a debug log of the kernel boot, Clear Containers supports an option
to enable kernel boot logs using the configuration file.

1. Enable debug in `configuration.toml`

```
$ enable_debug = true
```

2. Run a container to generate the logs

```
$ sudo docker run -ti busybox true
```

3. Filter the kernel boot logs from the `cc-proxy` logs

The `cc-proxy` logs show the sources of its collated information. To see
the kernel boot logs, filter `cc-proxy` logs by the QEMU serial console.
The QEMU serial console is represented by `source=qemu`.

```
$ journalctl -u cc-proxy | grep source=qemu
```

4. Obtain logs using standalone `cc-proxy`

In some cases it may be easier to run the `cc-proxy` standalone by first stopping
the `cc-proxy` service and running it standalone to capture the logs.

```
$ sudo systemctl stop cc-proxy
$ sudo /usr/libexec/clear-containers/cc-proxy -log debug
```

This will result in the `cc-proxy` log being printed on the terminal. This method
can also be used to capture the logs in a specific `cc-proxy` file.

0 comments on commit 14a68bd

Please sign in to comment.