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
Code submitted upstream and all unit tests have been added and are passing CI.
Merged upstream
Oops not MODIFIED... POST...
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.
Also noting that a virtual machine must be created on the OpenStack project for metrics to be returned.
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"}
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