[zabbix plugin] Error when deploying on MOS 9.0 env with modified hostnames

Bug #1633701 reported by tontinme on 2016-10-15
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Medium
Olivier Bourdon

Bug Description

Detailed bug description:
When I try to deploy MOS9.0 with fuel-plugin-external-zabbix(latest version, build by mysels), I met error:

2016-10-14 07:32:25 +0000 Puppet (err): hostinfo is not a hash or array when accessing it with network_roles at /etc/fuel/plugins/zabbix_monitoring-2.5/puppet/manifests/agent.pp:23 on node cmp-01.domain.tld
/usr/lib/ruby/vendor_ruby/puppet/parser/ast/leaf.rb:157:in `evaluate'
/usr/lib/ruby/vendor_ruby/puppet/parser/ast.rb:61:in `safeevaluate'

Steps to reproduce:
1. Download latest version of plugin from master:
https://github.com/openstack/fuel-plugin-external-zabbix.git
2. Build it:
fpb --debug --build fuel-plugin-external-zabbix/
3. Install it with MOS 9.0
4. In MOS, crete an environment, add nodes, set hostname and name for all nodes.
NOTE: modify hostname replace node-XXX(default). Example, I set cmopute-01 with hostname cmp-01, instead of node-18.
+----+---------------+-----------+-------------+----------------------------------------------------------------------------+------------+-------------------+---------+---------------+--------+
| id | name | status | os_platform | roles | ip | mac | cluster | platform_name | online |
+----+---------------+-----------+-------------+----------------------------------------------------------------------------+------------+-------------------+---------+---------------+--------+
| 15 | controller-03 | deploying | ubuntu | [u'controller'] | 10.10.0.54 | 52:54:00:36:7e:de | 2 | None | True |
| 13 | compute-02 | deploying | ubuntu | [u'compute'] | 10.10.0.55 | 52:54:00:ab:cc:6a | 2 | KVM | True |
| 18 | compute-01 | deploying | ubuntu | [u'compute'] | 10.10.0.52 | 52:54:00:27:5b:51 | 2 | KVM | True |
| 16 | controller-01 | deploying | ubuntu | [u'controller'] | 10.10.0.51 | 42:6f:43:5e:3e:8b | 2 | None | True |
| 11 | lma-03 | deploying | ubuntu | [u'infrastructure_alerting', u'elasticsearch_kibana', u'influxdb_grafana'] | 10.10.0.58 | 52:54:00:6c:39:a3 | 2 | None | True |
| 12 | lma-01 | deploying | ubuntu | [u'infrastructure_alerting', u'elasticsearch_kibana', u'influxdb_grafana'] | 10.10.0.56 | 52:54:00:16:4a:d9 | 2 | None | True |
| 14 | controller-02 | deploying | ubuntu | [u'controller'] | 10.10.0.53 | 52:54:00:0c:33:8f | 2 | None | True |
| 17 | lma-02 | deploying | ubuntu | [u'infrastructure_alerting', u'elasticsearch_kibana', u'influxdb_grafana'] | 10.10.0.57 | 52:54:00:05:83:61 | 2 | None | True |
+----+---------------+-----------+-------------+----------------------------------------------------------------------------+------------+-------------------+---------+---------------+--------+

Expected results:
Deploy successfully.

Actual result:
it fails

Reproducability:
always

Workaround:
MOS create /etc/hiera/astute.yaml like:

...
nodes:
   node-18:
      fqdn: cmp-01.domain.tld
      name: cmp-01
...

but in agent.pp, we define hostinfo with:
$hostinfo = $network_metadata['nodes'][$::hostname]

In my environment, $::hostname is cmp-01, not node-18. So agent.pp can not find hostinfo in astute.yaml.

agent.pp should get host node name by get_node_key_name($::hostname) first. then
$hostnode = get_node_key_name($::hostname)
$hostinfo = $network_metadata['nodes'][$hostnode]

tontinme (tontinme-m) on 2016-10-15
description: updated
Changed in fuel:
assignee: nobody → tontinme (tontinme-m)
status: New → In Progress
Changed in fuel:
importance: Undecided → Medium
milestone: none → 9.2
tontinme (tontinme-m) wrote :
Changed in fuel:
status: In Progress → Fix Committed
summary: - fuel for openstack zabbix plugin
+ [zabbix plugin] Error when deploying on MOS 9.0 env with modified
+ hostnames
tags: added: on-verification
tags: added: dev-to-verify
tags: removed: dev-to-verify on-verification
Changed in fuel:
status: Fix Committed → Confirmed
Changed in fuel:
assignee: tontinme (tontinme-m) → Olivier Bourdon (olivierbourdon38)
status: Confirmed → In Progress
Changed in fuel:
status: In Progress → Fix Committed
Changed in fuel:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers