PowerVC Log management

Manually managing logs that various PowerVC components generate becomes a challenging and tedious job. PowerVC log management tool simplifies this process and prevents the log file size from becoming too large, yet ensures that sufficient details on the system activities are still available for proper monitoring and troubleshooting.

PowerVC log management is a log file manager tool for various PowerVC components. The tool is used to periodically cycle (or rotate) log files by removing the oldest ones from your system and creating the new ones. This process is conveniently automated and settings can be customized as needed.

PowerVC log management has two main functions.

  • View logrotate configurations.
  • Edit logrotate configurations.

Log file location

Logs on the system can be placed anywhere. However, considering their continuous change in size and content, by definition, the file system hierarchy prescribes that they are kept in the /var/log directory.

PowerVC log management modules

PowerVC log management tool manages these modules for log rotation automatically.
Table 1. PowerVC log management modules
PowerVC log management modules
keystone nova mariadb
glance neutron powervc-bumblebee
ceilometer swift powervc-clerk
cinder panko powervc-ttv

PowerVC log management default configuration

The example here depicts default config values for PowerVC cinder module.
[root@vm-xxx ~]# cat /etc/logrotate.d/openstack-cinder
compress
/var/log/cinder/*.log  /var/log/cinder/*/*/*/*.k2r {
    size 10M
    copytruncate
    rotate 4
    missingok
    compress
}
/var/log/cinder/*/*.log {
    size 10M
    copytruncate
    rotate 4
    missingok
    compress
}

Customizing PowerVC log parameters

PowerVC provides powervc-log-management tool to configure the various PowerVC log parameters according to the administrator’s needs for all components. Run powervc-log-management --help to view help options. Supported parameters for log configuration are rotate, size, interval, and min-size (requires interval).

Examples
[root@vm-xxxx ~]# powervc-log-management --help
usage: powervc-log-management [-h] {view,configure} ...
positional arguments:
  {view,configure}  configure, view and purge are the sub commands available
    view            View the current setting for logrotate configuration files This will display a consolidated view of the setting across the configuration files
    configure       Configure new settings for the logrotate configuration files
optional arguments:
  -h, --help        show this help message and exit
To view existing parameter values for component storage:
[root@vm-xxx ~]# powervc-log-management view -t compute

Current settings on the management node
+---------------------------------------------------------------+----------------------------+---------+
| Configuration details for openstack-nova service              | LogRotate attribute name   | Value   |
+===============================================================+============================+=========+
| Maximum number of archive files                               | rotate                     | 4       |
+---------------------------------------------------------------+----------------------------+---------+
| Maximum allowed log file size after which it would be rotated | size                       | 10M     |
+---------------------------------------------------------------+----------------------------+---------+
Example 1: To configure the size 20M for component storage:
[root@vm-xxx ~]# powervc-log-management configure -t compute -s 20M

PLAY [ Update logrotate Configuration ] ***************************** 
…
Modified the size attributes for file /etc/logrotate.d/openstack-nova to 20M
[root@vm-1996 ~]# cat /etc/logrotate.d/openstack-nova
/var/log/nova/*.log {
    size 20M
    rotate 4
    copytruncate
    missingok
    compress
}
Example 2: To configure logrotate to happen daily for storage:
[root@vm-xxx ~]# powervc-log-management configure -t compute -in daily

PLAY [ Update logrotate Configuration ] ***************************** 
…
Modified the interval attributes for file /etc/logrotate.d/openstack-nova to daily

[root@vm-xxx ~]# cat /etc/logrotate.d/openstack-nova
/var/log/nova/*.log {
    daily
    rotate 4
    copytruncate
    missingok
    compress
}

Manual or force log rotation

To manually rotate the syslog files, run logrotate command.

Example

[root@vm-xxx ~]# logrotate -f -v /etc/logrotate.d/openstack-ceilometer
reading config file /etc/logrotate.d/openstack-ceilometer
Reading state from file: /var/lib/logrotate/logrotate.status
Allocating hash table for state file, size 64 entries
Creating new state