Bug 1984095

Summary: [RHOSP16.1] Smart plugin doesn't work for CAP_SYS_RAWIO capability missing.
Product: Red Hat OpenStack Reporter: Luigi Tamagnone <ltamagno>
Component: openstack-tripleo-heat-templatesAssignee: Matthias Runge <mrunge>
Status: CLOSED ERRATA QA Contact: Leonid Natapov <lnatapov>
Severity: medium Docs Contact:
Priority: medium    
Version: 16.1 (Train)CC: augol, jbadiapa, lars, lmadsen, mburns, mmagr, moddi, mrunge, rheslop, rmccabe
Target Milestone: z8Keywords: Triaged, ZStream
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-11.3.2-1.20211007073513.29a02c1.el8ost Doc Type: Release Note
Doc Text:
With this update the `CollectdContainerAdditionalCapAdd` variable is added to the deployment tool. This variable is a comma separated list of additional collectd container capabilities.
Story Points: ---
Clone Of:
: 1984544 1984555 (view as bug list) Environment:
Last Closed: 2022-03-24 11:00:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1984544, 1984555, 1984556    

Description Luigi Tamagnone 2021-07-20 16:41:39 UTC
Description of problem:
Smart plugin could be configured via TripleO but doesn't work because CAP_SYS_RAWIO capability missing.


Version-Release number of selected component (if applicable):
Red Hat Openstack Platform 16.1 (RHOSP16.1)

How reproducible:
1. Configure YAML to have collecd with smart plugin
~~~
parameter_defaults:
    ExtraConfig:
      ceilometer::agent::polling::polling_interval: 5
      collectd::plugin::smart::disks: ['sda', 'sdb', 'sdc', 'sdd', 'sde']
      collectd::plugin::smart::ignoreselected: true
    EventPipelinePublishers:
      - gnocchi://?archive_policy=high
      - panko://
    CeilometerQdrPublishEvents: true
    CeilometerEnablePanko: true
    CollectdEnableLibpodstats: false
    PankoEventTTL: 604800
    MetricsQdrConnectors:
    - host: default-interconnect-5671-service-telemetry.apps.openshift-dev.ugent.be
      port: 443
      role: edge
      sslProfile: sslProfile
      verifyHostname: false
    CollectdExtraPlugins:
      - cgroups
      - smart
~~~

2. Deploy Openstack


Actual results:
The smart plugin is configured but through error for missing capability[1]

Expected results:
The smart plugin is configured

Additional info:
[1] 
collectd.log:
[2021-07-14 13:35:08] smart plugin: Running collectd as root, but the CAP_SYS_RAWIO capability is missing. The plugin's read function will probably fail. Is your init system dropping capabilities?
[2021-07-14 13:35:08] smart plugin: unable to open /dev/sda.

Comment 5 Leif Madsen 2021-07-22 16:07:15 UTC
*** Bug 1984544 has been marked as a duplicate of this bug. ***

Comment 6 Matthias Runge 2021-10-06 16:24:55 UTC
https://review.opendev.org/c/openstack/tripleo-heat-templates/+/809138

is merged in train now.

Comment 12 Matthias Runge 2022-02-23 06:52:02 UTC

To test this:

parameter_defaults:
    CollectdContainerAdditionalCapAdd: "CAP_SYS_RAWIO"

Comment 13 Leonid Natapov 2022-03-15 17:51:44 UTC
smart plugin successfully loaded
[2022-03-15 17:49:20] plugin_load: plugin "smart" successfully loaded.

Comment 18 errata-xmlrpc 2022-03-24 11:00:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 16.1.8 bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:0986