Console logs are critical for troubleshooting the startup process of an instance. These logs are produced at boot time, before the console becomes available. Typically, when working with cloud hosted instances, accessing these can be difficult. OpenStack Compute provides a mechanism for accessing the console logs.
To access the console logs of an instance, the following information is required:
openstack
command-line clientopenrc
file containing appropriate credentialsFor this example, we will view the last five lines of the cookbook.test
instance.
To show the console logs of an instance, use the following command:
openstack console log show --lines 5 cookbook.test
This connects to the serial console output of an instance, mimicking the information as if a monitor was directly attached to a physical server:
[[0;32m OK [0m] Started udev Coldplug all Devices. [[0;32m OK [0m] Started Dispatch Password Requests to Console Directory Watch. [[0;32m OK [0m] Started Set console font and keymap. [[0;32m OK [0m] Created slice system-getty.slice. [[0;32m OK [0m] Found device /dev/ttyS0.
The openstack console log show
command collects the console logs, as if you were connected to the server via a serial port or sitting behind the keyboard and monitor at boot time. The command will, by default, return all of the logs generated to that point. To limit the amount of output, the --lines
parameter can be used to return a specific number of lines from the end of the log.
18.218.238.134