diff --git a/docker/services/logging/files/nova-api.yaml b/docker/services/logging/files/nova-api.yaml new file mode 100644 index 0000000000..402bce9fae --- /dev/null +++ b/docker/services/logging/files/nova-api.yaml @@ -0,0 +1,40 @@ +heat_template_version: pike + +description: > + Template for nova-api's logging to files + +parameters: + DockerNovaApiImage: + description: image + type: string + +outputs: + config_settings: + description: Extra hieradata needed to log to files in the host. + value: null + volumes: + description: The volumes needed to log to files in the host. + value: &nova_api_volumes + - /var/log/containers/nova:/var/log/nova + - /var/log/containers/httpd/nova-api:/var/log/httpd + docker_config: + description: Extra containers needed for logging to files in the host. + value: + step_2: + # db sync runs before permissions set by kolla_config + nova_api_init_logs: + image: {get_param: DockerNovaApiImage} + privileged: false + user: root + volumes: *nova_api_volumes + command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova'] + 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/nova + - /var/log/containers/httpd/nova-api diff --git a/docker/services/logging/files/nova-common.yaml b/docker/services/logging/files/nova-common.yaml new file mode 100644 index 0000000000..e40f9cd6ee --- /dev/null +++ b/docker/services/logging/files/nova-common.yaml @@ -0,0 +1,57 @@ +heat_template_version: pike + +description: > + Template for nova's logging to files + +parameters: + DockerNovaImage: + description: image + type: string + NovaServiceName: + description: service name + type: string + +resources: + + InitLogContainerName: + type: OS::Heat::Value + properties: + type: string + value: + str_replace: + template: nova_SERVICE_init_log + params: + SERVICE: {get_param: NovaServiceName} + +outputs: + cmd_extra_args: + description: Extra command line arguments for running the service in the container. + value: '' + config_settings: + description: Extra hieradata needed to log to files in the host. + value: null + volumes: + description: The volumes needed to log to files in the host. + value: + - /var/log/containers/nova:/var/log/nova + docker_config: + description: Extra containers needed for logging to files in the host. + value: + step_2: + map_replace: + - CONTAINERNAME: + image: {get_param: DockerNovaImage} + privileged: false + user: root + volumes: + - /var/log/containers/nova:/var/log/nova + command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova'] + - keys: + CONTAINERNAME: {get_attr: [InitLogContainerName, value]} + host_prep_tasks: + description: Extra ansible tasks needed for logging to files in the host. + value: + - name: create persistent logs directory + file: + path: /var/log/containers/nova + state: directory diff --git a/docker/services/logging/files/nova-placement.yaml b/docker/services/logging/files/nova-placement.yaml new file mode 100644 index 0000000000..0c56ea712f --- /dev/null +++ b/docker/services/logging/files/nova-placement.yaml @@ -0,0 +1,39 @@ +heat_template_version: pike + +description: > + Template for nova-placement's logging to files + +parameters: + DockerNovaPlacementImage: + description: image + type: string + +outputs: + config_settings: + description: Extra hieradata needed to log to files in the host. + value: null + volumes: + description: The volumes needed to log to files in the host. + value: &nova_placement_volumes + - /var/log/containers/nova:/var/log/nova + - /var/log/containers/httpd/nova-placement:/var/log/httpd + docker_config: + description: Extra containers needed for logging to files in the host. + value: + step_2: + nova_placement_init_log: + start_order: 1 + image: {get_param: DockerNovaPlacementImage} + user: root + command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova'] + volumes: *nova_placement_volumes + 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/nova + - /var/log/containers/httpd/nova-placement diff --git a/docker/services/logging/stdout/nova-api.yaml b/docker/services/logging/stdout/nova-api.yaml new file mode 100644 index 0000000000..de38a5f187 --- /dev/null +++ b/docker/services/logging/stdout/nova-api.yaml @@ -0,0 +1,60 @@ +heat_template_version: pike + +description: > + Template for nova-api's logging to stdout + +parameters: + DockerNovaApiImage: + description: image + type: string + +outputs: + config_settings: + description: Extra hieradata needed to log to stdout. + value: + nova::wsgi::apache_api::access_log_file: /var/log/httpd/access.log + nova::wsgi::apache_api::error_log_file: /var/log/httpd/error_log + volumes: + description: The volumes needed to log to stdout or a sidecar container. + value: + - NovaApiLogs:/var/log/ + docker_config: + description: Extra containers needed for logging to stdout or a sidecar container. + value: + step_2: + nova_api_apache_error_logs: + start_order: 1 + image: {get_param: DockerNovaApiImage} + user: root + privileged: false + restart: always + healthcheck: + test: '[ -p /var/log/httpd/error_log ]' + command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd && rm -f /var/log/httpd/error_log && mkfifo /var/log/httpd/error_log && while true; do cat /var/log/httpd/error_log; done'] + volumes: + - NovaApiLogs:/var/log/ + nova_api_apache_access_logs: + start_order: 1 + image: {get_param: DockerNovaApiImage} + user: root + privileged: false + restart: always + healthcheck: + test: '[ -p /var/log/httpd/access.log ]' + command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd && rm -f /var/log/httpd/access.log && mkfifo /var/log/httpd/access.log && while true; do cat /var/log/httpd/access.log; done'] + volumes: + - NovaApiLogs:/var/log/ + nova_api_logs: + start_order: 2 + image: {get_param: DockerNovaApiImage} + user: nova + privileged: false + restart: always + healthcheck: + test: '[ -p /var/log/nova/nova-api.log ]' + command: ['/bin/bash', '-c', 'mkdir -p /var/log/nova && rm -f /var/log/nova/nova-api.log && mkfifo /var/log/nova/nova-api.log && while true; do cat /var/log/nova/nova-api.log; done'] + volumes: + - NovaApiLogs:/var/log/ + host_prep_tasks: + description: Extra ansible tasks needed for logging to files in the host. + value: null diff --git a/docker/services/logging/stdout/nova-common.yaml b/docker/services/logging/stdout/nova-common.yaml new file mode 100644 index 0000000000..799bbccd70 --- /dev/null +++ b/docker/services/logging/stdout/nova-common.yaml @@ -0,0 +1,30 @@ +heat_template_version: pike + +description: > + Template for nova's logging to stdout + +parameters: + DockerNovaImage: + description: image + type: string + NovaServiceName: + description: service name + type: string + +outputs: + cmd_extra_args: + description: Extra command line arguments for running the service in the container. + value: "--log-dir= --log-file=" + config_settings: + description: Extra hieradata needed to log to stdout. + value: null + volumes: + description: The volumes needed to log to stdout. + value: null + docker_config: + description: Extra containers needed for logging to stdout. + value: + step_2: {} + host_prep_tasks: + description: Extra ansible tasks needed for logging to stdout. + value: null diff --git a/docker/services/logging/stdout/nova-placement.yaml b/docker/services/logging/stdout/nova-placement.yaml new file mode 100644 index 0000000000..d39bd6aca7 --- /dev/null +++ b/docker/services/logging/stdout/nova-placement.yaml @@ -0,0 +1,60 @@ +heat_template_version: pike + +description: > + Template for nova-placement's logging to stdout + +parameters: + DockerNovaPlacementImage: + description: image + type: string + +outputs: + config_settings: + description: Extra hieradata needed to log to stdout. + value: + nova::wsgi::apache_placement::access_log_file: /var/log/httpd/access.log + nova::wsgi::apache_placement::error_log_file: /var/log/httpd/error_log + volumes: + description: The volumes needed to log to stdout or a sidecar container. + value: + - NovaPlacementLogs:/var/log/ + docker_config: + description: Extra containers needed for logging to stdout or a sidecar container. + value: + step_2: + nova_placement_apache_error_logs: + start_order: 1 + image: {get_param: DockerNovaPlacementImage} + user: root + privileged: false + restart: always + healthcheck: + test: '[ -p /var/log/httpd/error_log ]' + command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd && rm -f /var/log/httpd/error_log && mkfifo /var/log/httpd/error_log && while true; do cat /var/log/httpd/error_log; done'] + volumes: + - NovaPlacementLogs:/var/log/ + nova_placement_apache_access_logs: + start_order: 1 + image: {get_param: DockerNovaPlacementImage} + user: root + privileged: false + restart: always + healthcheck: + test: '[ -p /var/log/httpd/access.log ]' + command: ['/bin/bash', '-c', 'mkdir -p /var/log/httpd && rm -f /var/log/httpd/access.log && mkfifo /var/log/httpd/access.log && while true; do cat /var/log/httpd/access.log; done'] + volumes: + - NovaPlacementLogs:/var/log/ + nova_placement_logs: + start_order: 2 + image: {get_param: DockerNovaPlacementImage} + user: nova + privileged: false + restart: always + healthcheck: + test: '[ -p /var/log/nova/nova-placement-api.log ]' + command: ['/bin/bash', '-c', 'mkdir -p /var/log/nova && rm -f /var/log/nova/nova-placement-api.log && mkfifo /var/log/nova/nova-placement-api.log && while true; do cat /var/log/nova/nova-placement-api.log; done'] + volumes: + - NovaPlacementLogs:/var/log/ + host_prep_tasks: + description: Extra ansible tasks needed for logging to files in the host. + value: null diff --git a/docker/services/nova-api.yaml b/docker/services/nova-api.yaml index 7f1b7a54db..b68474bef5 100644 --- a/docker/services/nova-api.yaml +++ b/docker/services/nova-api.yaml @@ -66,6 +66,9 @@ resources: RoleName: {get_param: RoleName} RoleParameters: {get_param: RoleParameters} + NovaApiLogging: + type: OS::TripleO::Services::Logging::NovaApi + outputs: role_data: description: Role data for the Nova API role. @@ -74,6 +77,7 @@ outputs: config_settings: map_merge: - get_attr: [NovaApiBase, role_data, config_settings] + - get_attr: [NovaApiLogging, config_settings] - apache::default_vhost: false logging_source: {get_attr: [NovaApiBase, role_data, logging_source]} logging_groups: {get_attr: [NovaApiBase, role_data, logging_groups]} @@ -114,31 +118,22 @@ outputs: owner: nova:nova recurse: true docker_config: - # db sync runs before permissions set by kolla_config step_2: - nova_init_logs: - image: &nova_api_image {get_param: DockerNovaApiImage} - privileged: false - user: root - volumes: - - /var/log/containers/nova:/var/log/nova - - /var/log/containers/httpd/nova-api:/var/log/httpd - command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova'] + get_attr: [NovaApiLogging, docker_config, step_2] step_3: nova_api_db_sync: start_order: 0 - image: *nova_api_image + image: &nova_api_image {get_param: DockerNovaApiImage} net: host detach: false user: root volumes: &nova_api_bootstrap_volumes list_concat: - {get_attr: [ContainersCommon, volumes]} + - {get_attr: [NovaApiLogging, volumes]} - - /var/lib/config-data/nova/etc/my.cnf.d/tripleo.cnf:/etc/my.cnf.d/tripleo.cnf:ro - /var/lib/config-data/nova/etc/nova/:/etc/nova/:ro - - /var/log/containers/nova:/var/log/nova - - /var/log/containers/httpd/nova-api:/var/log/httpd command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage api_db sync'" # FIXME: we probably want to wait on the 'cell_v2 update' in order for this # to be capable of upgrading a baremetal setup. This is to ensure the name @@ -182,11 +177,10 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, volumes]} + - {get_attr: [NovaApiLogging, volumes]} - - /var/lib/kolla/config_files/nova_api.json:/var/lib/kolla/config_files/config.json:ro - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro - - /var/log/containers/nova:/var/log/nova - - /var/log/containers/httpd/nova-api:/var/log/httpd - if: - internal_tls_enabled @@ -210,11 +204,10 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, volumes]} + - {get_attr: [NovaApiLogging, volumes]} - - /var/lib/kolla/config_files/nova_api_cron.json:/var/lib/kolla/config_files/config.json:ro - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro - - /var/log/containers/nova:/var/log/nova - - /var/log/containers/httpd/nova-api:/var/log/httpd environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS step_5: @@ -228,14 +221,7 @@ outputs: command: "/usr/bin/bootstrap_host_exec nova_api su nova -s /bin/bash -c '/usr/bin/nova-manage cell_v2 discover_hosts --verbose'" metadata_settings: get_attr: [NovaApiBase, role_data, metadata_settings] - host_prep_tasks: - - name: create persistent logs directory - file: - path: "{{ item }}" - state: directory - with_items: - - /var/log/containers/nova - - /var/log/containers/httpd/nova-api + host_prep_tasks: {get_attr: [NovaApiLogging, host_prep_tasks]} upgrade_tasks: - name: Stop and disable nova_api service tags: step2 diff --git a/docker/services/nova-conductor.yaml b/docker/services/nova-conductor.yaml index f15c3a6877..3d2b0600e8 100644 --- a/docker/services/nova-conductor.yaml +++ b/docker/services/nova-conductor.yaml @@ -64,12 +64,21 @@ resources: RoleName: {get_param: RoleName} RoleParameters: {get_param: RoleParameters} + NovaLogging: + type: OS::TripleO::Services::Logging::NovaCommon + properties: + DockerNovaImage: {get_param: DockerNovaConductorImage} + NovaServiceName: 'conductor' + outputs: role_data: description: Role data for the Nova Conductor service. value: service_name: {get_attr: [NovaConductorBase, role_data, service_name]} - config_settings: {get_attr: [NovaConductorBase, role_data, config_settings]} + config_settings: + map_merge: + - {get_attr: [NovaConductorBase, role_data, config_settings]} + - {get_attr: [NovaLogging, config_settings]} logging_source: {get_attr: [NovaConductorBase, role_data, logging_source]} logging_groups: {get_attr: [NovaConductorBase, role_data, logging_groups]} step_config: &step_config @@ -86,7 +95,11 @@ outputs: config_image: {get_param: DockerNovaConfigImage} kolla_config: /var/lib/kolla/config_files/nova_conductor.json: - command: /usr/bin/nova-conductor + command: + list_join: + - ' ' + - - /usr/bin/nova-conductor + - get_attr: [NovaLogging, cmd_extra_args] config_files: - source: "/var/lib/kolla/config_files/src/*" dest: "/" @@ -106,17 +119,13 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, volumes]} + - {get_attr: [NovaLogging, volumes]} - - /var/lib/kolla/config_files/nova_conductor.json:/var/lib/kolla/config_files/config.json:ro - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro - - /var/log/containers/nova:/var/log/nova environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - host_prep_tasks: - - name: create persistent logs directory - file: - path: /var/log/containers/nova - state: directory + host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} upgrade_tasks: - name: Set compute upgrade level to auto tags: step1 diff --git a/docker/services/nova-consoleauth.yaml b/docker/services/nova-consoleauth.yaml index 069b09bcb9..4a2f6b6210 100644 --- a/docker/services/nova-consoleauth.yaml +++ b/docker/services/nova-consoleauth.yaml @@ -59,12 +59,21 @@ resources: RoleName: {get_param: RoleName} RoleParameters: {get_param: RoleParameters} + NovaLogging: + type: OS::TripleO::Services::Logging::NovaCommon + properties: + DockerNovaImage: {get_param: DockerNovaConsoleauthImage} + NovaServiceName: 'consoleauth' + outputs: role_data: description: Role data for the Nova Consoleauth service. value: service_name: {get_attr: [NovaConsoleauthPuppetBase, role_data, service_name]} - config_settings: {get_attr: [NovaConsoleauthPuppetBase, role_data, config_settings]} + config_settings: + map_merge: + - {get_attr: [NovaConsoleauthPuppetBase, role_data, config_settings]} + - {get_attr: [NovaLogging, config_settings]} logging_source: {get_attr: [NovaConsoleauthPuppetBase, role_data, logging_source]} logging_groups: {get_attr: [NovaConsoleauthPuppetBase, role_data, logging_groups]} step_config: &step_config @@ -81,7 +90,11 @@ outputs: config_image: {get_param: DockerNovaConfigImage} kolla_config: /var/lib/kolla/config_files/nova_consoleauth.json: - command: /usr/bin/nova-consoleauth + command: + list_join: + - ' ' + - - /usr/bin/nova-consoleauth + - get_attr: [NovaLogging, cmd_extra_args] config_files: - source: "/var/lib/kolla/config_files/src/*" dest: "/" @@ -101,17 +114,13 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, volumes]} + - {get_attr: [NovaLogging, volumes]} - - /var/lib/kolla/config_files/nova_consoleauth.json:/var/lib/kolla/config_files/config.json:ro - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro - - /var/log/containers/nova:/var/log/nova environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - host_prep_tasks: - - name: create persistent logs directory - file: - path: /var/log/containers/nova - state: directory + host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} upgrade_tasks: - name: Stop and disable nova_consoleauth service tags: step2 diff --git a/docker/services/nova-metadata.yaml b/docker/services/nova-metadata.yaml index 54d9312b42..93eb08f0bb 100644 --- a/docker/services/nova-metadata.yaml +++ b/docker/services/nova-metadata.yaml @@ -52,6 +52,12 @@ resources: RoleName: {get_param: RoleName} RoleParameters: {get_param: RoleParameters} + NovaLogging: + type: OS::TripleO::Services::Logging::NovaCommon + properties: + DockerNovaImage: {get_param: DockerNovaMetadataImage} + NovaServiceName: 'metadata' + outputs: role_data: description: Role data for the Nova Metadata service. @@ -60,6 +66,7 @@ outputs: config_settings: map_merge: - get_attr: [NovaMetadataBase, role_data, config_settings] + - {get_attr: [NovaLogging, config_settings]} logging_source: {get_attr: [NovaMetadataBase, role_data, logging_source]} logging_groups: {get_attr: [NovaMetadataBase, role_data, logging_groups]} step_config: &step_config @@ -73,7 +80,11 @@ outputs: config_image: {get_param: DockerNovaConfigImage} kolla_config: /var/lib/kolla/config_files/nova_metadata.json: - command: /usr/bin/nova-api-metadata + command: + list_join: + - ' ' + - - /usr/bin/nova-api-metadata + - get_attr: [NovaLogging, cmd_extra_args] config_files: - source: "/var/lib/kolla/config_files/src/*" dest: "/" @@ -85,17 +96,11 @@ outputs: recurse: true docker_config: step_2: - nova_init_logs: - image: &nova_metadata_image {get_param: DockerNovaMetadataImage} - privileged: false - user: root - volumes: - - /var/log/containers/nova:/var/log/nova - command: ['/bin/bash', '-c', 'chown -R nova:nova /var/log/nova'] + get_attr: [NovaLogging, docker_config, step_2] step_4: nova_metadata: start_order: 2 - image: *nova_metadata_image + image: &nova_metadata_image {get_param: DockerNovaMetadataImage} net: host user: nova privileged: true @@ -103,19 +108,15 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, volumes]} + - {get_attr: [NovaLogging, volumes]} - - /var/lib/kolla/config_files/nova_metadata.json:/var/lib/kolla/config_files/config.json:ro - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro - - /var/log/containers/nova:/var/log/nova environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS metadata_settings: get_attr: [NovaMetadataBase, role_data, metadata_settings] - host_prep_tasks: - - name: create persistent logs directory - file: - path: /var/log/containers/nova - state: directory + host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} upgrade_tasks: - name: Stop and disable nova_api service tags: step2 diff --git a/docker/services/nova-placement.yaml b/docker/services/nova-placement.yaml index bd5ae73147..84e58f567a 100644 --- a/docker/services/nova-placement.yaml +++ b/docker/services/nova-placement.yaml @@ -66,6 +66,9 @@ resources: RoleName: {get_param: RoleName} RoleParameters: {get_param: RoleParameters} + NovaPlacementLogging: + type: OS::TripleO::Services::Logging::NovaPlacement + outputs: role_data: description: Role data for the Nova Placement API role. @@ -74,6 +77,7 @@ outputs: config_settings: map_merge: - get_attr: [NovaPlacementBase, role_data, config_settings] + - get_attr: [NovaPlacementLogging, config_settings] - apache::default_vhost: false logging_source: {get_attr: [NovaPlacementBase, role_data, logging_source]} logging_groups: {get_attr: [NovaPlacementBase, role_data, logging_groups]} @@ -102,6 +106,8 @@ outputs: owner: nova:nova recurse: true docker_config: + step_2: + get_attr: [NovaPlacementLogging, docker_config, step_2] # start this early so it is up before computes start reporting step_3: nova_placement: @@ -113,11 +119,10 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, volumes]} + - get_attr: [NovaPlacementLogging, volumes] - - /var/lib/kolla/config_files/nova_placement.json:/var/lib/kolla/config_files/config.json:ro - /var/lib/config-data/puppet-generated/nova_placement/:/var/lib/kolla/config_files/src:ro - - /var/log/containers/nova:/var/log/nova - - /var/log/containers/httpd/nova-placement:/var/log/httpd - if: - internal_tls_enabled @@ -132,14 +137,7 @@ outputs: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS metadata_settings: get_attr: [NovaPlacementBase, role_data, metadata_settings] - host_prep_tasks: - - name: create persistent logs directory - file: - path: "{{ item }}" - state: directory - with_items: - - /var/log/containers/nova - - /var/log/containers/httpd/nova-placement + host_prep_tasks: {get_attr: [NovaPlacementLogging, host_prep_tasks]} upgrade_tasks: - name: Stop and disable nova_placement service (running under httpd) tags: step2 diff --git a/docker/services/nova-scheduler.yaml b/docker/services/nova-scheduler.yaml index f8109b9651..45ecc80fab 100644 --- a/docker/services/nova-scheduler.yaml +++ b/docker/services/nova-scheduler.yaml @@ -59,12 +59,21 @@ resources: RoleName: {get_param: RoleName} RoleParameters: {get_param: RoleParameters} + NovaLogging: + type: OS::TripleO::Services::Logging::NovaCommon + properties: + DockerNovaImage: {get_param: DockerNovaSchedulerImage} + NovaServiceName: 'scheduler' + outputs: role_data: description: Role data for the Nova Scheduler service. value: service_name: {get_attr: [NovaSchedulerBase, role_data, service_name]} - config_settings: {get_attr: [NovaSchedulerBase, role_data, config_settings]} + config_settings: + map_merge: + - {get_attr: [NovaSchedulerBase, role_data, config_settings]} + - {get_attr: [NovaLogging, config_settings]} logging_source: {get_attr: [NovaSchedulerBase, role_data, logging_source]} logging_groups: {get_attr: [NovaSchedulerBase, role_data, logging_groups]} step_config: &step_config @@ -81,7 +90,11 @@ outputs: config_image: {get_param: DockerNovaConfigImage} kolla_config: /var/lib/kolla/config_files/nova_scheduler.json: - command: /usr/bin/nova-scheduler + command: + list_join: + - ' ' + - - /usr/bin/nova-scheduler + - get_attr: [NovaLogging, cmd_extra_args] config_files: - source: "/var/lib/kolla/config_files/src/*" dest: "/" @@ -101,18 +114,14 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, volumes]} + - {get_attr: [NovaLogging, volumes]} - - /var/lib/kolla/config_files/nova_scheduler.json:/var/lib/kolla/config_files/config.json:ro - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro - /run:/run - - /var/log/containers/nova:/var/log/nova environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - host_prep_tasks: - - name: create persistent logs directory - file: - path: /var/log/containers/nova - state: directory + host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} upgrade_tasks: - name: Stop and disable nova_scheduler service tags: step2 diff --git a/docker/services/nova-vnc-proxy.yaml b/docker/services/nova-vnc-proxy.yaml index b1da294baa..b99e2fc18a 100644 --- a/docker/services/nova-vnc-proxy.yaml +++ b/docker/services/nova-vnc-proxy.yaml @@ -59,12 +59,21 @@ resources: RoleName: {get_param: RoleName} RoleParameters: {get_param: RoleParameters} + NovaLogging: + type: OS::TripleO::Services::Logging::NovaCommon + properties: + DockerNovaImage: {get_param: DockerNovaVncProxyImage} + NovaServiceName: 'vncproxy' + outputs: role_data: description: Role data for the Nova Vncproxy service. value: service_name: {get_attr: [NovaVncProxyPuppetBase, role_data, service_name]} - config_settings: {get_attr: [NovaVncProxyPuppetBase, role_data, config_settings]} + config_settings: + map_merge: + - {get_attr: [NovaVncProxyPuppetBase, role_data, config_settings]} + - {get_attr: [NovaLogging, config_settings]} logging_source: {get_attr: [NovaVncProxyPuppetBase, role_data, logging_source]} logging_groups: {get_attr: [NovaVncProxyPuppetBase, role_data, logging_groups]} step_config: &step_config @@ -81,7 +90,11 @@ outputs: config_image: {get_param: DockerNovaConfigImage} kolla_config: /var/lib/kolla/config_files/nova_vnc_proxy.json: - command: /usr/bin/nova-novncproxy --web /usr/share/novnc/ + command: + list_join: + - ' ' + - - /usr/bin/nova-novncproxy --web /usr/share/novnc/ + - get_attr: [NovaLogging, cmd_extra_args] config_files: - source: "/var/lib/kolla/config_files/src/*" dest: "/" @@ -101,17 +114,13 @@ outputs: volumes: list_concat: - {get_attr: [ContainersCommon, volumes]} + - {get_attr: [NovaLogging, volumes]} - - /var/lib/kolla/config_files/nova_vnc_proxy.json:/var/lib/kolla/config_files/config.json:ro - /var/lib/config-data/puppet-generated/nova/:/var/lib/kolla/config_files/src:ro - - /var/log/containers/nova:/var/log/nova environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS - host_prep_tasks: - - name: create persistent logs directory - file: - path: /var/log/containers/nova - state: directory + host_prep_tasks: {get_attr: [NovaLogging, host_prep_tasks]} upgrade_tasks: - name: Stop and disable nova_vnc_proxy service tags: step2 diff --git a/environments/stdout-logging.yaml b/environments/stdout-logging.yaml index 0a3073e7fd..c00155eead 100644 --- a/environments/stdout-logging.yaml +++ b/environments/stdout-logging.yaml @@ -2,3 +2,6 @@ resource_registry: OS::TripleO::Services::Logging::GlanceApi: ../docker/services/logging/stdout/glance-api.yaml OS::TripleO::Services::Logging::Keystone: ../docker/services/logging/stdout/keystone.yaml + OS::TripleO::Services::Logging::NovaApi: ../docker/services/logging/stdout/nova-api.yaml + OS::TripleO::Services::Logging::NovaCommon: ../docker/services/logging/stdout/nova-common.yaml + OS::TripleO::Services::Logging::NovaPlacement: ../docker/services/logging/stdout/nova-placement.yaml diff --git a/overcloud-resource-registry-puppet.j2.yaml b/overcloud-resource-registry-puppet.j2.yaml index 515c2db7eb..8937dd9b11 100644 --- a/overcloud-resource-registry-puppet.j2.yaml +++ b/overcloud-resource-registry-puppet.j2.yaml @@ -301,6 +301,9 @@ resource_registry: # Logging OS::TripleO::Services::Logging::GlanceApi: docker/services/logging/files/glance-api.yaml OS::TripleO::Services::Logging::Keystone: docker/services/logging/files/keystone.yaml + OS::TripleO::Services::Logging::NovaApi: docker/services/logging/files/nova-api.yaml + OS::TripleO::Services::Logging::NovaCommon: docker/services/logging/files/nova-common.yaml + OS::TripleO::Services::Logging::NovaPlacement: docker/services/logging/files/nova-placement.yaml parameter_defaults: EnablePackageInstall: false