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 modules | ||
---|---|---|
keystone | nova | mariadb |
glance | neutron | powervc-bumblebee |
ceilometer | swift | powervc-clerk |
cinder | panko | powervc-ttv |
apache2 | httpd | gnocchi |
blazar | mongodb | pacemaker |
placement | rabbitmq | haproxy |
PowerVC log management default configuration
[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
}
[root@vm-xxx ~]# cat /opt/ibm/powervc/logrotate.d/powervc-cinder
compress
/var/log/cinder/*.log /var/log/cinder/*/*/*/*.k2r {
rotate 4
hourly
minsize 200M
delaycompress
missingok
dateext
compress
}
/var/log/cinder/*/*.log {
rotate 4
hourly
minsize 200M
delaycompress
missingok
dateext
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).
[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
- Examples for PowerVC 2.2.1
-
- 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 | +---------------------------------------------------------------+----------------------------+---------+
- 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 }
- 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 }
- To view existing parameter values for component
storage:
- Examples for PowerVC 2.2.1.1
-
- To view existing parameter values for component
compute:
[root@vm-xxxx ~]# powervc-log-management view -t compute Current settings on the management node +---------------------------------------------------------------------------------+----------------------------+-------------+ | Configuration details for powervc-nova service | LogRotate attribute name | Value | +=================================================================================+============================+=============+ | The interval at which logs will be rotated | interval | daily | +---------------------------------------------------------------------------------+----------------------------+-------------+ | Maximum number of archive files | rotate | 4 | +---------------------------------------------------------------------------------+----------------------------+-------------+ | Maximum allowed log file size after which it would be rotated | size | Not Defined | +---------------------------------------------------------------------------------+----------------------------+-------------+ | Minimum size required for log to be rotated(minsize is used alongwith interval) | minsize | Not Defined | +---------------------------------------------------------------------------------+----------------------------+-------------+
- To configure the size 20M for component
compute:
powervc-log-management configure -t compute -s 20M Modified the size attributes for file /opt/ibm/powervc/logrotate.d/powervc-nova to 20M [root@lognov20 logrotate.d]# cat /opt/ibm/powervc/logrotate.d/powervc-nova /var/log/nova/*.log { size 20M rotate 4 hourly missingok dateext compress }
- To configure logrotate to happen daily for
reservation:
[root@vm-xxxx ~]# powervc-log-management configure -t reservation -in daily Modified the interval attributes for file /opt/ibm/powervc/logrotate.d/powervc-blazar to daily [root@lognov20 ~]# powervc-log-management view -t reservation Current settings on the management node +---------------------------------------------------------------------------------+----------------------------+-------------+ | Configuration details for powervc-blazar service | LogRotate attribute name | Value | +=================================================================================+============================+=============+ | The interval at which logs will be rotated | interval | daily | +---------------------------------------------------------------------------------+----------------------------+-------------+ | Minimum size required for log to be rotated(minsize is used alongwith interval) | minsize | 200m | +---------------------------------------------------------------------------------+----------------------------+-------------+ | Maximum number of archive files | rotate | 4 | +---------------------------------------------------------------------------------+----------------------------+-------------+ | Maximum allowed log file size after which it would be rotated | size | Not Defined | +---------------------------------------------------------------------------------+----------------------------+-------------+
- To view existing parameter values for component
compute:
Manual or force log rotation
To manually rotate the syslog files, run logrotate command.
- Example for 2.2.1
-
[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
- Example for 2.2.1.1
-
[root@vm-xxxx logrotate.d]# logrotate -f -v /opt/ibm/powervc/logrotate.d/powervc-ceilometer reading config file /opt/ibm/powervc/logrotate.d/powervc-ceilometer Reading state from file: /var/lib/logrotate/logrotate.status Allocating hash table for state file, size 64 entries Creating new state