Bug 1736786 - It appears to be enabled by default and setting enable_telemetry = false doesn't appear to disable telemetry at
Summary: It appears to be enabled by default and setting enable_telemetry = false does...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: instack-undercloud
Version: 10.0 (Newton)
Hardware: All
OS: All
medium
medium
Target Milestone: z12
: 10.0 (Newton)
Assignee: Martin Magr
QA Contact: Leonid Natapov
URL:
Whiteboard:
Depends On: 1736782
Blocks: 1747156
TreeView+ depends on / blocked
 
Reported: 2019-08-02 02:12 UTC by David Hill
Modified: 2020-11-09 08:14 UTC (History)
13 users (show)

Fixed In Version: instack-undercloud-5.3.7-14.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1736782
: 1747156 (view as bug list)
Environment:
Last Closed: 2020-09-02 15:16:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to fix enable_telemetry in newton. (2.65 KB, patch)
2019-08-02 02:49 UTC, David Hill
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1838828 0 None None None 2019-08-02 22:34:06 UTC
OpenStack gerrit 674160 0 'None' MERGED Set notification driver to noop when enable_telemetry=false 2020-11-09 08:12:54 UTC
Red Hat Knowledge Base (Solution) 4319341 0 None None None 2019-08-02 02:56:25 UTC

Description David Hill 2019-08-02 02:12:55 UTC
enable_telemetry appears to be enabled by default and setting enable_telemetry = false doesn't appear to disable telemetry at all ... I've setted it to enable_telemetry = false , set the messaging driver to noop and re-ran undercloud install ... it reverted the driver to messaging !  

+++ This bug was initially created as a clone of Bug #1736782 +++

It appears to be enabled by default and setting enable_telemetry = false doesn't appear to disable telemetry at all.

Reported by: rhn-support-dhill

https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/10/html/director_installation_and_usage/chap-installing_the_undercloud#annotations:64c99c3c-5e08-43d8-a57c-15cccfb4a0cf

--- Additional comment from David Hill on 2019-08-02 01:51:14 UTC ---

And it looks like it's enabled by default instead of being disabled by default.

Comment 1 David Hill 2019-08-02 02:23:27 UTC
For neutron, the fix is quite simple:

/usr/share/instack-undercloud/puppet-stack-config/puppet-stack-config.pp:

Replace:
  neutron_config {
    'DEFAULT/notification_driver': value => 'messaging';
  }

for:
if str2bool(hiera('enable_telemetry', true)) {
  neutron_config {
    'DEFAULT/notification_driver': value => 'messaging';
  }
} else {
  neutron_config {
    'DEFAULT/notification_driver': value => 'noop';
  }
}


... I tried looking at the other services but they are hardcoded here:

/usr/share/instack-undercloud/puppet-stack-config/puppet-stack-config.yaml.template:heat::notification_driver: 'messaging'
/usr/share/instack-undercloud/puppet-stack-config/puppet-stack-config.yaml.template:keystone::notification_driver: messaging
/usr/share/instack-undercloud/puppet-stack-config/puppet-stack-config.yaml.template:nova::notification_driver: messaging

and the result:
heat/heat.conf:driver =messaging
keystone/keystone.conf:driver =messaging
nova/nova.conf:driver=messaging

Comment 2 David Hill 2019-08-02 02:34:08 UTC
/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py:


    cfg.BoolOpt('enable_telemetry',
                default=True,
                help=('Whether to install Telemetry services '
                      '(ceilometer, aodh) in the Undercloud.')
                ),
    cfg.StrOpt('messaging_driver',
                default="messaging",
                help=('Whether to install Telemetry services '
                      '(ceilometer, aodh) in the Undercloud.')
                ),


and:

[root@undercloud-3 /]# grep -r MESSAGING /usr/share/instack-undercloud/puppet-stack-config/puppet-stack-config.yaml.template 
heat::notification_driver: '{{MESSAGING_DRIVER}}'
keystone::notification_driver: {{MESSAGING_DRIVER}}
nova::notification_driver: {{MESSAGING_DRIVER}}

Comment 3 David Hill 2019-08-02 02:35:22 UTC
But perhaps it would be cleaner to simply remove the notification_driver from the puppet-stack-config.yaml.template and do the same as neutron.

Comment 4 David Hill 2019-08-02 02:40:10 UTC
Something likes (didn't test it):

if str2bool(hiera('enable_telemetry', true)) {
  neutron_config {
    'DEFAULT/notification_driver': value => 'messaging';
  }
  heat_config {
    'DEFAULT/notification_driver': value => 'messaging';
  }
  keystone_config {
    'DEFAULT/notification_driver': value => 'messaging';
  }
  nova_config {
    'DEFAULT/notification_driver': value => 'messaging';
  }
} else {
  neutron_config {
    'DEFAULT/notification_driver': value => 'noop';
  }
  heat_config {
    'DEFAULT/notification_driver': value => 'noop';
  }
  keystone_config {
    'DEFAULT/notification_driver': value => 'noop';
  }
  nova_config {
    'DEFAULT/notification_driver': value => 'noop';
  }
}


and remove from /usr/share/instack-undercloud/puppet-stack-config/puppet-stack-config.yaml.template the following lines:
heat::notification_driver: 'messaging'
keystone::notification_driver: messaging
nova::notification_driver: messaging

Comment 5 David Hill 2019-08-02 02:43:09 UTC
The last comment works:

[root@undercloud-3 etc]# grep driver.*=.*noop */*.conf
heat/heat.conf:notification_driver=noop
keystone/keystone.conf:notification_driver=noop
neutron/neutron.conf:notification_driver=noop
nova/nova.conf:notification_driver=noop

Comment 6 David Hill 2019-08-02 02:49:21 UTC
Created attachment 1599481 [details]
Patch to fix enable_telemetry in newton.

Comment 7 David Hill 2019-08-02 03:04:57 UTC
I pushed https://review.opendev.org/#/c/674160/ upstream for the rocky branch .

Comment 8 Matthew Secaur 2019-08-06 20:49:02 UTC
I found this bug in OSP14, as well.  In an environment with "enable_telemetry = true" set in undercloud.conf, the various processes (e.g. heat, keystone, nova, etc.) all get "driver=messagingv2" set in the configuration files. Therefore, they all send messages to notifications.info. But there are processes listening to that queue, so the queue stays empty.

In an environment with "enable_telemetry = false" set in undercloud.conf, those processes still have "driver=messagingv2" set in the configuration files, so they still send messages to notification.info, but there are no consumers on that queue, leading to a situation where the queue gets bigger and bigger forever.


With enable_telemetry = false (this environment had only been running for about 20 minutes, so there are not many messages in the queue):

$ grep telemetry undercloud.conf 
enable_telemetry = false

# grep ^driver=messa /var/lib/config-data/*/etc/*/*.conf
/var/lib/config-data/glance_api/etc/glance/glance-api.conf:driver=messagingv2
/var/lib/config-data/heat_api_cfn/etc/heat/heat.conf:driver=messagingv2
/var/lib/config-data/heat_api/etc/heat/heat.conf:driver=messagingv2
/var/lib/config-data/heat/etc/heat/heat.conf:driver=messagingv2
/var/lib/config-data/keystone/etc/keystone/keystone.conf:driver=messagingv2
/var/lib/config-data/mistral/etc/mistral/mistral.conf:driver=messagingv2
/var/lib/config-data/neutron/etc/neutron/neutron.conf:driver=messagingv2
/var/lib/config-data/nova/etc/nova/nova.conf:driver=messagingv2
/var/lib/config-data/nova_metadata/etc/nova/nova.conf:driver=messagingv2
/var/lib/config-data/nova_placement/etc/nova/nova.conf:driver=messagingv2

# docker exec -it rabbitmq bash
()[rabbitmq@osp14-undercloud /]$ rabbitmqctl list_queues name consumers messages | grep notifications
notifications.info	0	45


With enable_telemetry = true:

$ grep telemetry undercloud.conf 
enable_telemetry = true

# grep ^driver=messa /var/lib/config-data/*/etc/*/*.conf
/var/lib/config-data/aodh/etc/aodh/aodh.conf:driver=messagingv2
/var/lib/config-data/ceilometer/etc/ceilometer/ceilometer.conf:driver=messagingv2
/var/lib/config-data/glance_api/etc/glance/glance-api.conf:driver=messagingv2
/var/lib/config-data/heat_api_cfn/etc/heat/heat.conf:driver=messagingv2
/var/lib/config-data/heat_api/etc/heat/heat.conf:driver=messagingv2
/var/lib/config-data/heat/etc/heat/heat.conf:driver=messagingv2
/var/lib/config-data/keystone/etc/keystone/keystone.conf:driver=messagingv2
/var/lib/config-data/mistral/etc/mistral/mistral.conf:driver=messagingv2
/var/lib/config-data/neutron/etc/neutron/neutron.conf:driver=messagingv2
/var/lib/config-data/nova/etc/nova/nova.conf:driver=messagingv2
/var/lib/config-data/nova_metadata/etc/nova/nova.conf:driver=messagingv2
/var/lib/config-data/nova_placement/etc/nova/nova.conf:driver=messagingv2

()[rabbitmq@undercloud /]$ rabbitmqctl list_queues name consumers messages | grep notifications
notifications.warn	1	0
notifications.error	1	0
notifications.sample	1	0
notifications.debug	1	0
notifications.audit	1	0
notifications.critical	1	0
notifications.info	1	0


Note You need to log in before you can comment on or make changes to this bug.