diff options
| author | Daneyon Hansen <danehans@cisco.com> | 2015-04-01 18:38:46 +0000 |
|---|---|---|
| committer | Daneyon Hansen <danehans@cisco.com> | 2015-04-07 19:13:29 +0000 |
| commit | 0b671ad58d31dc3c3704a35a9ef0c17af0834e72 (patch) | |
| tree | 726964e5a0810383b908c0413943702a998e916d | |
| parent | 5ea37557cf1d5600e0bb141e010a4bcdbd967162 (diff) | |
| download | kolla-0b671ad58d31dc3c3704a35a9ef0c17af0834e72.tar.gz kolla-0b671ad58d31dc3c3704a35a9ef0c17af0834e72.zip | |
Adds Initial Logging Support
Previously, logging was hard coded into the nova and neutron
containers. This patch creates two common params for logging:
DEBUG_LOGGING
VERBOSE_LOGGING
and sets default values of verbose=true and debug=false. This patch
implements logging for Nova and Neutron. Add'l OS service config
scripts and images will need to be updated to use the logging
params.
Change-Id: I03d48005d5b4789aa3c519879a20d963ef1cbaa3
| -rwxr-xr-x | docker/neutron/agents/dhcp/start.sh | 9 | ||||
| -rwxr-xr-x | docker/neutron/agents/l3/start.sh | 9 | ||||
| -rwxr-xr-x | docker/neutron/agents/linux-bridge/start.sh | 9 | ||||
| -rwxr-xr-x | docker/neutron/agents/metadata/start.sh | 10 | ||||
| -rw-r--r-- | docker/neutron/neutron-base/config-neutron.sh | 4 | ||||
| -rwxr-xr-x | docker/neutron/neutron-server/start.sh | 8 | ||||
| -rwxr-xr-x | docker/nova-base/config-nova.sh | 12 | ||||
| -rwxr-xr-x | docker/nova-compute/nova-compute/config-nova-compute.sh | 5 | ||||
| -rwxr-xr-x | docker/nova-compute/nova-network/config-nova-network.sh | 7 | ||||
| -rwxr-xr-x | docker/nova-controller/nova-api/start.sh | 8 | ||||
| -rwxr-xr-x | docker/nova-controller/nova-conductor/start.sh | 8 | ||||
| -rwxr-xr-x | docker/nova-controller/nova-scheduler/start.sh | 7 | ||||
| -rw-r--r-- | docs/integration-guide.md | 12 | ||||
| -rw-r--r-- | docs/minimal-environment-vars.md | 15 | ||||
| -rwxr-xr-x | tools/genenv | 26 |
15 files changed, 134 insertions, 15 deletions
diff --git a/docker/neutron/agents/dhcp/start.sh b/docker/neutron/agents/dhcp/start.sh index 7754532a6..70c846526 100755 --- a/docker/neutron/agents/dhcp/start.sh +++ b/docker/neutron/agents/dhcp/start.sh @@ -9,9 +9,16 @@ set -e : ${DHCP_DRIVER:=neutron.agent.linux.dhcp.Dnsmasq} : ${USE_NAMESPACES:=false} -check_required_vars VERBOSE_LOGGING DEBUG_LOGGING +check_required_vars VERBOSE_LOGGING DEBUG_LOGGING NEUTRON_DHCP_AGENT_LOG_FILE cfg=/etc/neutron/dhcp_agent.ini +neutron_conf=/etc/neutron/neutron.conf + +# Logging +crudini --set $neutron_conf \ + DEFAULT \ + log_file \ + "${NEUTRON_DHCP_AGENT_LOG_FILE}" # Configure dhcp_agent.ini crudini --set $cfg \ diff --git a/docker/neutron/agents/l3/start.sh b/docker/neutron/agents/l3/start.sh index 17a09ad65..0ad112165 100755 --- a/docker/neutron/agents/l3/start.sh +++ b/docker/neutron/agents/l3/start.sh @@ -8,9 +8,16 @@ set -e : ${INTERFACE_DRIVER:=neutron.agent.linux.interface.BridgeInterfaceDriver} : ${USE_NAMESPACES:=false} -check_required_vars VERBOSE_LOGGING DEBUG_LOGGING +check_required_vars VERBOSE_LOGGING DEBUG_LOGGING NEUTRON_L3_AGENT_LOG_FILE cfg=/etc/neutron/l3_agent.ini +neutron_conf=/etc/neutron/neutron.conf + +# Logging +crudini --set $neutron_conf \ + DEFAULT \ + log_file \ + "${NEUTRON_L3_AGENT_LOG_FILE}" # Configure l3_agent.ini crudini --set $cfg \ diff --git a/docker/neutron/agents/linux-bridge/start.sh b/docker/neutron/agents/linux-bridge/start.sh index 1aeea4cf5..2ff5a05ed 100755 --- a/docker/neutron/agents/linux-bridge/start.sh +++ b/docker/neutron/agents/linux-bridge/start.sh @@ -8,9 +8,16 @@ set -e : ${NEUTRON_FLAT_NETWORK_NAME:=physnet1} : ${NEUTRON_FLAT_NETWORK_INTERFACE:=eth1} -check_required_vars PUBLIC_IP +check_required_vars PUBLIC_IP NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE cfg=/etc/neutron/plugins/ml2/ml2_conf.ini +neutron_conf=/etc/neutron/neutron.conf + +# Logging +crudini --set $neutron_conf \ + DEFAULT \ + log_file \ + "${NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE}" # Configure ml2_conf.ini crudini --set $cfg \ diff --git a/docker/neutron/agents/metadata/start.sh b/docker/neutron/agents/metadata/start.sh index 9eef79a31..a99574152 100755 --- a/docker/neutron/agents/metadata/start.sh +++ b/docker/neutron/agents/metadata/start.sh @@ -10,9 +10,17 @@ set -e check_required_vars VERBOSE_LOGGING DEBUG_LOGGING KEYSTONE_AUTH_PROTOCOL \ KEYSTONE_PUBLIC_SERVICE_HOST ADMIN_TENANT_NAME \ NEUTRON_KEYSTONE_USER NEUTRON_KEYSTONE_PASSWORD \ - NEUTRON_SHARED_SECRET NOVA_API_SERVICE_HOST + NEUTRON_SHARED_SECRET NOVA_API_SERVICE_HOST \ + NEUTRON_METADATA_AGENT_LOG_FILE cfg=/etc/neutron/metadata_agent.ini +neutron_conf=/etc/neutron/neutron.conf + +# Logging +crudini --set $neutron_conf \ + DEFAULT \ + log_file \ + "${NEUTRON_METADATA_AGENT_LOG_FILE}" # Configure metadata_agent.ini crudini --set $cfg \ diff --git a/docker/neutron/neutron-base/config-neutron.sh b/docker/neutron/neutron-base/config-neutron.sh index 35a1375ff..6cbbc74ac 100644 --- a/docker/neutron/neutron-base/config-neutron.sh +++ b/docker/neutron/neutron-base/config-neutron.sh @@ -15,7 +15,7 @@ set -e : ${VERBOSE_LOGGING:=true} : ${DEBUG_LOGGING:=false} -check_required_vars NEUTRON_KEYSTONE_PASSWORD \ +check_required_vars NEUTRON_KEYSTONE_PASSWORD NEUTRON_LOG_DIR \ KEYSTONE_PUBLIC_SERVICE_HOST RABBITMQ_SERVICE_HOST dump_vars @@ -34,7 +34,7 @@ ml2_cfg=/etc/neutron/plugins/ml2/ml2_conf.ini crudini --set $core_cfg \ DEFAULT \ log_dir \ - "/var/log/neutron" + "${NEUTRON_LOG_DIR}" crudini --set $core_cfg \ DEFAULT \ verbose \ diff --git a/docker/neutron/neutron-server/start.sh b/docker/neutron/neutron-server/start.sh index b121b6f95..f6c64f2a2 100755 --- a/docker/neutron/neutron-server/start.sh +++ b/docker/neutron/neutron-server/start.sh @@ -10,7 +10,7 @@ check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ NOVA_ADMIN_PASSWORD NEUTRON_DB_NAME NEUTRON_DB_USER \ NEUTRON_KEYSTONE_USER NEUTRON_KEYSTONE_PASSWORD \ ADMIN_TENANT_NAME NEUTRON_SERVER_SERVICE_HOST \ - PUBLIC_IP NEUTRON_DB_PASSWORD + PUBLIC_IP NEUTRON_DB_PASSWORD NEUTRON_SERVER_LOG_FILE fail_unless_os_service_running keystone fail_unless_db @@ -35,6 +35,12 @@ crux endpoint-create -n neutron -t network \ -P "${KEYSTONE_AUTH_PROTOCOL}://${PUBLIC_IP}:9696" \ -A "${KEYSTONE_AUTH_PROTOCOL}://${NEUTRON_SERVER_SERVICE_HOST}:9696" +# Logging +crudini --set /etc/neutron/neutron.conf \ + DEFAULT \ + log_file \ + "${NEUTRON_SERVER_LOG_FILE}" + # Database crudini --set /etc/neutron/neutron.conf \ database \ diff --git a/docker/nova-base/config-nova.sh b/docker/nova-base/config-nova.sh index 0764964d5..6350ed695 100755 --- a/docker/nova-base/config-nova.sh +++ b/docker/nova-base/config-nova.sh @@ -18,7 +18,8 @@ check_required_vars KEYSTONE_ADMIN_TOKEN NOVA_DB_PASSWORD \ RABBITMQ_SERVICE_HOST GLANCE_API_SERVICE_HOST \ KEYSTONE_PUBLIC_SERVICE_HOST PUBLIC_IP \ - PUBLIC_INTERFACE FLAT_INTERFACE + PUBLIC_INTERFACE FLAT_INTERFACE DEBUG_LOGGING \ + VERBOSE_LOGGING NOVA_LOG_DIR cfg=/etc/nova/nova.conf @@ -60,10 +61,11 @@ crudini --set $cfg DEFAULT volume_api_class nova.volume.cinder.API crudini --set $cfg DEFAULT image_service nova.image.glance.GlanceImageService crudini --set $cfg DEFAULT osapi_volume_listen 0.0.0.0 -# configure logging to stderr -crudini --del $cfg DEFAULT log_dir -crudini --set $cfg DEFAULT log_file "" -crudini --set $cfg DEFAULT use_stderr True +# configure logging +crudini --set $cfg DEFAULT log_dir "${NOVA_LOG_DIR}" +crudini --set $cfg DEFAULT debug "${DEBUG_LOGGING}" +crudini --set $cfg DEFAULT verbose "${VERBOSE_LOGGING}" + crudini --set $cfg DEFAULT admin_token "${KEYSTONE_ADMIN_TOKEN}" crudini --set $cfg conductor workers 8 diff --git a/docker/nova-compute/nova-compute/config-nova-compute.sh b/docker/nova-compute/nova-compute/config-nova-compute.sh index b0f20d9fc..62e40701f 100755 --- a/docker/nova-compute/nova-compute/config-nova-compute.sh +++ b/docker/nova-compute/nova-compute/config-nova-compute.sh @@ -5,6 +5,11 @@ cfg=/etc/nova/nova.conf +check_required_vars NOVA_COMPUTE_LOG_FILE + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_COMPUTE_LOG_FILE}" + # set qmeu emulation if no hardware acceleration found if [[ `egrep -c '(vmx|svm)' /proc/cpuinfo` == 0 ]] then diff --git a/docker/nova-compute/nova-network/config-nova-network.sh b/docker/nova-compute/nova-network/config-nova-network.sh index f26bb66d1..05013bde2 100755 --- a/docker/nova-compute/nova-network/config-nova-network.sh +++ b/docker/nova-compute/nova-network/config-nova-network.sh @@ -2,6 +2,13 @@ . /opt/kolla/config-nova.sh +check_required_vars NOVA_NETWORK_LOG_FILE + +cfg=/etc/nova/nova.conf + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_NETWORK_LOG_FILE}" + # Configure eth1 as a physcial interface for nova flat network cat > /etc/sysconfig/network-scripts/ifcfg-$FLAT_INTERFACE <<EOF DEVICE="$FLAT_INTERFACE" diff --git a/docker/nova-controller/nova-api/start.sh b/docker/nova-controller/nova-api/start.sh index 90cc62976..eab97474c 100755 --- a/docker/nova-controller/nova-api/start.sh +++ b/docker/nova-controller/nova-api/start.sh @@ -7,13 +7,19 @@ set -e check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ NOVA_KEYSTONE_USER NOVA_KEYSTONE_PASSWORD \ ADMIN_TENANT_NAME NOVA_API_SERVICE_HOST \ - NOVA_EC2_API_SERVICE_HOST PUBLIC_IP NOVA_DB_NAME + NOVA_EC2_API_SERVICE_HOST PUBLIC_IP NOVA_DB_NAME \ + NOVA_API_LOG_FILE fail_unless_os_service_running keystone fail_unless_db $NOVA_DB_NAME export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" export SERVICE_ENDPOINT="http://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0" +cfg=/etc/nova/nova.conf + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_API_LOG_FILE}" + crux user-create --update \ -n "${NOVA_KEYSTONE_USER}" \ -p "${NOVA_KEYSTONE_PASSWORD}" \ diff --git a/docker/nova-controller/nova-conductor/start.sh b/docker/nova-controller/nova-conductor/start.sh index 599fb0246..a1b5957e8 100755 --- a/docker/nova-controller/nova-conductor/start.sh +++ b/docker/nova-controller/nova-conductor/start.sh @@ -4,9 +4,15 @@ set -e . /opt/kolla/config-nova.sh -check_required_vars NOVA_DB_NAME NOVA_DB_USER NOVA_DB_PASSWORD +check_required_vars NOVA_DB_NAME NOVA_DB_USER NOVA_DB_PASSWORD \ + NOVA_CONDUCTOR_LOG_FILE fail_unless_db +cfg=/etc/nova/nova.conf + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_CONDUCTOR_LOG_FILE}" + mysql -h ${MARIADB_SERVICE_HOST} -u root \ -p${DB_ROOT_PASSWORD} mysql <<EOF CREATE DATABASE IF NOT EXISTS ${NOVA_DB_NAME}; diff --git a/docker/nova-controller/nova-scheduler/start.sh b/docker/nova-controller/nova-scheduler/start.sh index 087d477fe..5be5e4e80 100755 --- a/docker/nova-controller/nova-scheduler/start.sh +++ b/docker/nova-controller/nova-scheduler/start.sh @@ -4,7 +4,12 @@ set -e . /opt/kolla/config-nova.sh -check_required_vars NOVA_DB_NAME +check_required_vars NOVA_DB_NAME NOVA_SCHEDULER_LOG_FILE fail_unless_db $NOVA_DB_NAME +cfg=/etc/nova/nova.conf + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_SCHEDULER_LOG_FILE}" + exec /usr/bin/nova-scheduler diff --git a/docs/integration-guide.md b/docs/integration-guide.md index 9a06a57ed..409c47207 100644 --- a/docs/integration-guide.md +++ b/docs/integration-guide.md @@ -41,6 +41,18 @@ all containers. This allows a simple method of ensuring every type of node ### Environment Variable KEY/VALUE pairs + DEBUG_LOGGING=<true|false> - Defaults to false. Enable/disable debug level logging for all OpenStack services. + VERBOSE_LOGGING=<true|false> - Defaults to true. Enable/disable verbose level logging for all OpenStack services. + NOVA_LOG_DIR=<none> - Defaults to none. The base directory used for relative Nova --log-file paths. + NEUTRON_LOG_DIR<none> - Defaults to none. The base directory used for relative Neutron --log-file paths. + NOVA_API_LOG_FILE=<none> Defaults to none. Name of Nova API log file to output to. If no default is set, logging will go to stdout. + NOVA_CONDUCTOR_LOG_FILE=<none> Defaults to none. Name of Nova Conductor log file to output to. If no default is set, logging will go to stdout. + NOVA_SCHEDULER_LOG_FILE=<none> Defaults to none. Name of Nova Scheduler log file to output to. If no default is set, logging will go to stdout. + NOVA_COMPUTE_LOG_FILE=<none> Defaults to none. Name of Nova Compute log file to output to. If no default is set, logging will go to stdout. + NEUTRON_SERVER_LOG_FILE=<none> Defaults to none. Name of Neutron Server log file to output to. If no default is set, logging will go to stdout. + NEUTRON_L3_AGENT_LOG_FILE=<none> Defaults to none. Name of Neutron L3 Agent log file to output to. If no default is set, logging will go to stdout. + NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE=<none> Defaults to none. Name of Neutron Linux Bridge Agent log file to output to. If no default is set, logging will go to stdout. + NEUTRON_METADATA_AGENT_LOG_FILE=<none> Defaults to none. Name of Neutron Metadata Agent log file to output to. If no default is set, logging will go to stdout. ADMIN_USER_PASSWORD=<steakfordinner> - The admin user password ADMIN_TENANT_NAME=<admin> - tenant name FLAT_INTERFACE=<eth1> - nova networking flat interface device name diff --git a/docs/minimal-environment-vars.md b/docs/minimal-environment-vars.md index f610f6cc3..713507f79 100644 --- a/docs/minimal-environment-vars.md +++ b/docs/minimal-environment-vars.md @@ -2,6 +2,21 @@ In order for each service to function, there is a minimum set of required variables that need to be plugged into the environment. Below is the list of variables that is needed for each service to run in a minimal setting. +# Logging + + DEBUG_LOGGING + VERBOSE_LOGGING + NOVA_LOG_DIR + NEUTRON_LOG_DIR + NOVA_API_LOG_FILE + NOVA_CONDUCTOR_LOG_FILE + NOVA_SCHEDULER_LOG_FILE + NOVA_COMPUTE_LOG_FILE + NEUTRON_SERVER_LOG_FILE + NEUTRON_L3_AGENT_LOG_FILE + NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE + NEUTRON_METADATA_AGENT_LOG_FILE + # Mariadb MARIADB_SERVICE_HOST diff --git a/tools/genenv b/tools/genenv index 5484cb8f7..bb349b5b0 100755 --- a/tools/genenv +++ b/tools/genenv @@ -31,6 +31,20 @@ PASSWORD=12345 ADMIN_TENANT_NAME=admin PUBLIC_IP=$HOST_IP +# Logging +DEBUG_LOGGING=false +VERBOSE_LOGGING=true +NOVA_LOG_DIR= +NEUTRON_LOG_DIR= +NOVA_API_LOG_FILE= +NOVA_CONDUCTOR_LOG_FILE= +NOVA_SCHEDULER_LOG_FILE= +NOVA_COMPUTE_LOG_FILE= +NEUTRON_SERVER_LOG_FILE= +NEUTRON_L3_AGENT_LOG_FILE= +NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE= +NEUTRON_METADATA_AGENT_LOG_FILE= + # RabbitMQ RABBITMQ_SERVICE_HOST=$HOST_IP RABBIT_USER=guest @@ -86,6 +100,18 @@ export OS_TENANT_NAME=$ADMIN_TENANT_NAME EOF cat > ./compose/openstack.env <<EOF +DEBUG_LOGGING=$DEBUG_LOGGING +VERBOSE_LOGGING=$VERBOSE_LOGGING +NOVA_LOG_DIR=$NOVA_LOG_DIR +NEUTRON_LOG_DIR=$NEUTRON_LOG_DIR +NOVA_API_LOG_FILE=$NOVA_API_LOG_FILE +NOVA_CONDUCTOR_LOG_FILE=$NOVA_CONDUCTOR_LOG_FILE +NOVA_SCHEDULER_LOG_FILE=$NOVA_SCHEDULER_LOG_FILE +NOVA_COMPUTE_LOG_FILE=$NOVA_COMPUTE_LOG_FILE +NEUTRON_SERVER_LOG_FILE=$NEUTRON_SERVER_LOG_FILE +NEUTRON_L3_AGENT_LOG_FILE=$NEUTRON_L3_AGENT_LOG_FILE +NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE=$NEUTRON_LINUXBRIDGE_AGENT_LOG_FILE +NEUTRON_METADATA_AGENT_LOG_FILE=$NEUTRON_METADATA_AGENT_LOG_FILE ADMIN_USER_PASSWORD=$ADMIN_USER_PASSWORD ADMIN_TENANT_NAME=$ADMIN_TENANT_NAME CONFIG_NETWORK=$CONFIG_NETWORK |
