Bug 1902142

Summary: Drop erroneous double quotes from virt plugin template
Product: Red Hat OpenStack Reporter: Leif Madsen <lmadsen>
Component: puppet-collectdAssignee: Leif Madsen <lmadsen>
Status: CLOSED ERRATA QA Contact: Leonid Natapov <lnatapov>
Severity: high Docs Contact:
Priority: medium    
Version: 16.1 (Train)CC: igallagh, jbadiapa, jjoyce, jschluet, mmagr, mrunge, rmccabe, slinaber, tvignaud
Target Milestone: z4Keywords: Triaged, ZStream
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: puppet-collectd-12.0.1-2.20201113222723.el8ost Doc Type: Bug Fix
Doc Text:
Before this update, when you configured the `collectd::plugin::virt::hostname_format` parameter with multiple values, director wrapped the values in double quotes. This caused the virt plugin to fail to load. With this update, when configuring `collectd::plugin::virt::hostname_format`, director no longer wraps multiple values in double quotes.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-17 15:36:09 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:

Description Leif Madsen 2020-11-27 04:36:09 UTC
Use of double-quotes around the HostnameFormat field in the virt plugin erb
template is wrong when using multiple names. Error generated will be
[2020-09-04 03:17:04] virt plugin: unknown HostnameFormat field: name metadata uuid
when setting the configuration to

HostnameFormat "name metadata uuid"

Simply removing the double quotes allows for a successful virt plugin load. Source
in collectd justifying this change is at: https://github.com/collectd/collectd/blob/main/src/virt.c#L834

Comment 1 Leif Madsen 2020-12-01 15:15:51 UTC
Code submitted upstream and all unit tests have been added and are passing CI.

Comment 2 Leif Madsen 2021-01-05 20:30:04 UTC
Merged upstream

Comment 3 Leif Madsen 2021-01-05 22:49:18 UTC
Oops not MODIFIED... POST...

Comment 4 Leif Madsen 2021-01-11 20:14:00 UTC
Testing should be as simple as performing an STF deployment and setting the `HostnameFormat: name metdata uuid` for collectd virt plugin.

```
ExtraConfig:
    collectd::plugin::virt::hostname_format: name metadata uuid
```

Deployment should not fail and the collectd virt plugin should be loaded successfully. Stats from collectd virt plugin should result in more information in (I believe) the `host` label of the virt plugin. Feel free to ping Leif to validate the information looks as it should, but no failure to load the virt plugin is a good first validation.

Comment 5 Leif Madsen 2021-01-11 20:19:55 UTC
Also noting that a virtual machine must be created on the OpenStack project for metrics to be returned.

Comment 11 Leonid Natapov 2021-01-27 21:13:53 UTC
From Prometheus:

collectd_virt_if_packets_rx_total{endpoint="prom-http",host="instance-00000005:StfInstance:a48dcb79-deb5-4844-8bd7-89d5b0b7ed2a",plugin_instance="instance-00000005",service="default-cloud1-coll-meter-smartgateway",type_instance="tap10491ab2-2b"}

Comment 19 errata-xmlrpc 2021-03-17 15:36:09 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.4 director bug fix 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-2021:0817