Merge "Store ODL logs to file"

This commit is contained in:
Zuul 2018-07-06 13:34:01 +00:00 committed by Gerrit Code Review
commit 1842528f14
6 changed files with 61 additions and 23 deletions

View File

@ -0,0 +1,32 @@
heat_template_version: rocky
description: >
Logging configuration for containerized OpenDaylight API service
outputs:
config_settings:
description: Extra hieradata needed to log to files in the host.
value: null
docker_config:
description: Extra containers needed for logging to files in the host.
value:
step_1: {}
volumes:
description: The volumes needed to log to files in the host.
value:
- /var/log/containers/opendaylight:/opt/opendaylight/data/log
host_prep_tasks:
description: Extra ansible tasks needed for logging to files in the host.
value:
- name: create persistent logs directory
file:
path: "{{ item }}"
state: directory
with_items:
- /var/log/containers/opendaylight
- /var/log/opendaylight
- name: opendaylight logs readme
copy:
dest: /var/log/opendaylight/readme.txt
content: |
Logs from OpenDaylight container can be found at /var/log/containers/opendaylight/karaf.log
ignore_errors: true

View File

@ -72,6 +72,9 @@ resources:
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
OpenDaylightApiLogging:
type: OS::TripleO::Services::Logging::OpenDaylightApi
outputs:
role_data:
description: Role data for the OpenDaylight API role.
@ -133,38 +136,33 @@ outputs:
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
- {get_attr: [OpenDaylightApiLogging, volumes]}
-
- /var/lib/kolla/config_files/opendaylight_api.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/opendaylight/:/var/lib/kolla/config_files/src:ro
- /var/lib/opendaylight/journal:/opt/opendaylight/journal
- /var/lib/opendaylight/snapshots:/opt/opendaylight/snapshots
- /var/lib/opendaylight/data:/opt/opendaylight/data
- /var/log/containers/opendaylight:/opt/opendaylight/data/log
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
metadata_settings:
get_attr: [OpenDaylightBase, role_data, metadata_settings]
host_prep_tasks:
- name: Delete cache folder
file:
path: /var/lib/opendaylight/data/cache
state: absent
- name: create persistent directories
file:
path: "{{ item }}"
state: directory
with_items:
- /var/lib/opendaylight/snapshots
- /var/lib/opendaylight/journal
- /var/lib/opendaylight/data
- /var/log/opendaylight
- /var/log/containers/opendaylight
- name: opendaylight logs readme
copy:
dest: /var/log/opendaylight/readme.txt
content: |
Logs from opendaylight container can be found by running "sudo docker logs opendaylight_api" and are also available in /var/log/containers/opendaylight/karaf.log
ignore_errors: true
list_concat:
- {get_attr: [OpenDaylightApiLogging, host_prep_tasks]}
-
- name: Delete cache folder
file:
path: /var/lib/opendaylight/data/cache
state: absent
- name: create persistent directories
file:
path: "{{ item }}"
state: directory
with_items:
- /var/lib/opendaylight/snapshots
- /var/lib/opendaylight/journal
- /var/lib/opendaylight/data
upgrade_tasks:
- when: step|int == 0
tags: common

View File

@ -13,4 +13,3 @@ parameter_defaults:
NeutronPluginExtensions: 'port_security'
NeutronMechanismDrivers: 'opendaylight_v2'
NeutronServicePlugins: 'odl-router_v2,trunk'
OpenDaylightLogMechanism: 'console'

View File

@ -14,4 +14,3 @@ parameter_defaults:
NeutronPluginExtensions: 'port_security'
NeutronMechanismDrivers: 'opendaylight_v2'
NeutronServicePlugins: 'odl-router_v2,trunk'
OpenDaylightLogMechanism: 'console'

View File

@ -338,6 +338,7 @@ resource_registry:
OS::TripleO::Services::Logging::NovaCommon: docker/services/logging/files/nova-common.yaml
OS::TripleO::Services::Logging::NovaLibvirt: OS::Heat::None
OS::TripleO::Services::Logging::NovaPlacement: docker/services/logging/files/nova-placement.yaml
OS::TripleO::Services::Logging::OpenDaylightApi: docker/services/logging/files/opendaylight-api.yaml
OS::TripleO::Services::Logging::PankoApi: docker/services/logging/files/panko-api.yaml
# Tempest

View File

@ -0,0 +1,9 @@
---
features:
- |
Configure ODL to log to file instead of console. Also ODL
log configuration has been moved out of general service
configurations to a stand-alone config file at
docker/services/logging/files/opendaylight-api.yaml. ODL
logs are now accessible at /var/log/containers/opendaylight/
karaf.log