contrail 4.0: fix missing logs

Turns out zookeeper and cassandra logs
were present only in controller and analyticsdb
containers and not on host. This patch
addresses the issue by mounting log directories
as volumes.
Changed for both cluster and control/analytics
model following the approach for kafka logs.

PROD-23971

Change-Id: I97ff3b8418c02dc1036aef468cc5195991d66196
(cherry picked from commit bd0a0ddf467f28f8c4e09f09d1b7e04e4433bd1a)
diff --git a/opencontrail/control/analytics4_0.yml b/opencontrail/control/analytics4_0.yml
index 8889a8b..f18babb 100644
--- a/opencontrail/control/analytics4_0.yml
+++ b/opencontrail/control/analytics4_0.yml
@@ -9,6 +9,9 @@
     opencontrail_kafka_config_dir: '/usr/share/kafka/config'
     opencontrail_kafka_log_cleanup_mtime: '+7'
     opencontrail_kafka_log_dir: '/usr/share/kafka/logs'
+    opencontrail_host_analyticsdb_log_dir: '/var/log/analyticsdb'
+    opencontrail_cassandra_log_dir: '/var/log/cassandra'
+    opencontrail_zookeeper_log_dir: '/var/log/zookeeper'
     opencontrail_version: 4.0
     linux_repo_contrail_component: oc40
     opencontrail_image_tag: latest
@@ -65,6 +68,7 @@
         - host: ${_param:opencontrail_control_node02_address}
         - host: ${_param:opencontrail_control_node03_address}
     database:
+      analyticsdb_log_dir: ${_param:opencontrail_host_analyticsdb_log_dir}
       config_only: true
       discovery:
         host: None
@@ -112,6 +116,8 @@
                 - /etc/zookeeper/conf/log4j.properties:/etc/zookeeper/conf/log4j.properties
                 - /var/log/contrail:/var/log/contrail
                 - /var/log/journal/contrail-analyticsdb:/var/log/journal
+                - ${_param:opencontrail_host_analyticsdb_log_dir}/cassandra:${_param:opencontrail_cassandra_log_dir}
+                - ${_param:opencontrail_host_analyticsdb_log_dir}/zookeeper:${_param:opencontrail_zookeeper_log_dir}
               network_mode: "host"
               privileged: true
               restart: always
diff --git a/opencontrail/control/cluster4_0.yml b/opencontrail/control/cluster4_0.yml
index 1409a65..21d27f7 100644
--- a/opencontrail/control/cluster4_0.yml
+++ b/opencontrail/control/cluster4_0.yml
@@ -9,6 +9,10 @@
     opencontrail_kafka_config_dir: '/usr/share/kafka/config'
     opencontrail_kafka_log_cleanup_mtime: '+7'
     opencontrail_kafka_log_dir: '/usr/share/kafka/logs'
+    opencontrail_host_analyticsdb_log_dir: '/var/log/analyticsdb'
+    opencontrail_host_configdb_log_dir: '/var/log/configdb'
+    opencontrail_cassandra_log_dir: '/var/log/cassandra'
+    opencontrail_zookeeper_log_dir: '/var/log/zookeeper'
     opencontrail_version: 4.0
     linux_repo_contrail_component: oc40
     opencontrail_image_tag: latest
@@ -66,6 +70,8 @@
         - host: ${_param:cluster_node02_address}
         - host: ${_param:cluster_node03_address}
     database:
+      analyticsdb_log_dir: ${_param:opencontrail_host_analyticsdb_log_dir}
+      configdb_log_dir: ${_param:opencontrail_host_configdb_log_dir}
       config_only: true
       discovery:
         host: None
@@ -155,6 +161,8 @@
                 - /etc/zookeeper/conf/log4j.properties:/etc/zookeeper/conf/log4j.properties
                 - /var/log/contrail:/var/log/contrail
                 - /var/log/journal/contrail-controller:/var/log/journal
+                - ${_param:opencontrail_host_configdb_log_dir}/cassandra:${_param:opencontrail_cassandra_log_dir}
+                - ${_param:opencontrail_host_configdb_log_dir}/zookeeper:${_param:opencontrail_zookeeper_log_dir}
               network_mode: "host"
               privileged: true
               restart: always
@@ -192,6 +200,8 @@
                 - /etc/zookeeper/conf/log4j.properties:/etc/zookeeper/conf/log4j.properties
                 - /var/log/contrail:/var/log/contrail
                 - /var/log/journal/contrail-analyticsdb:/var/log/journal
+                - ${_param:opencontrail_host_analyticsdb_log_dir}/cassandra:${_param:opencontrail_cassandra_log_dir}
+                - ${_param:opencontrail_host_analyticsdb_log_dir}/zookeeper:${_param:opencontrail_zookeeper_log_dir}
               network_mode: "host"
               privileged: true
               restart: always
diff --git a/opencontrail/control/control4_0.yml b/opencontrail/control/control4_0.yml
index 716088c..8a02847 100644
--- a/opencontrail/control/control4_0.yml
+++ b/opencontrail/control/control4_0.yml
@@ -8,6 +8,9 @@
     opencontrail_version: 4.0
     linux_repo_contrail_component: oc40
     opencontrail_image_tag: latest
+    opencontrail_host_configdb_log_dir: '/var/log/configdb'
+    opencontrail_cassandra_log_dir: '/var/log/cassandra'
+    opencontrail_zookeeper_log_dir: '/var/log/zookeeper'
     opencontrail_message_queue_node01_address: ${_param:openstack_message_queue_node01_address}
     opencontrail_message_queue_node02_address: ${_param:openstack_message_queue_node02_address}
     opencontrail_message_queue_node03_address: ${_param:openstack_message_queue_node03_address}
@@ -83,6 +86,7 @@
         host: ${_param:openstack_control_address}
     database:
       config_only: true
+      configdb_log_dir: ${_param:opencontrail_host_configdb_log_dir}
       analytics:
         members:
         - host: ${_param:opencontrail_analytics_node01_address}
@@ -115,6 +119,8 @@
                 - /etc/zookeeper/conf/log4j.properties:/etc/zookeeper/conf/log4j.properties
                 - /var/log/contrail:/var/log/contrail
                 - /var/log/journal/contrail-controller:/var/log/journal
+                - ${_param:opencontrail_host_configdb_log_dir}/cassandra:${_param:opencontrail_cassandra_log_dir}
+                - ${_param:opencontrail_host_configdb_log_dir}/zookeeper:${_param:opencontrail_zookeeper_log_dir}
               network_mode: "host"
               privileged: true
               restart: always