get-occ-config.sh counts "wrong" cause of missing tonumber messing up the deployment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
Fix Released
|
High
|
James Slagle |
Bug Description
When using the get-occ-config.sh on a deployment with more than 10 nodes, we noticed that it mixed up the metadata urls. So we had a few nodes configured correctly, and some had the wrong IPs deployed in the configs (split-stack), for example my_ip was wrong.
How reproducible:
deploy a split stack environment with more than 10 nodes.
Actual results:
Deployment sometimes got stuck because one node was missing (didn't get its
config because of wrong meta data) or deployment went fine but instead of 11 different nodes you see one node twice.
Expected results:
11 different nodes deployed and configured correctly
Additional info:
I checked how and why this would happen and i think i found the issue. In line
67 there is a sort_by on resource_name. If you check what it generates, you'll
notice that the sorting is *not* done as expected. This is cause it does string
sorting instead of integer sorting. The easy fix was to add a "tonumber" to
the sort_by: sort_by(
That way node 11 (10 is the number of the node in the resource list) will end
up at the very end of the list, otherwise it showed up as 3rd node (0, 1, 10, 2).
Demo:
(undercloud) [stack@director ~]$ openstack stack resource list 55a9e155-
+------
| resource_name | physical_
+------
| 10 | e4ee76de-
| 1 | 46f3d8f0-
| 0 | ddf8db32-
| 3 | 48745fa1-
| 2 | f4a586f8-
| 5 | 137a14db-
| 4 | afe87089-
| 7 | bc84c066-
| 6 | f80f41b9-
| 9 | c0df0d59-
| 8 | da466290-
+------
(undercloud) [stack@director ~]$ openstack stack resource list 55a9e155-
ddf8db32-
46f3d8f0-
e4ee76de-
f4a586f8-
48745fa1-
afe87089-
137a14db-
f80f41b9-
bc84c066-
da466290-
c0df0d59-
(undercloud) [stack@director ~]$ openstack stack resource list 55a9e155-
ddf8db32-
46f3d8f0-
f4a586f8-
48745fa1-
afe87089-
137a14db-
f80f41b9-
bc84c066-
da466290-
c0df0d59-
e4ee76de-
So you can clearly see the difference with and without "tonumber".
Changed in tripleo: | |
status: | New → Confirmed |
importance: | Undecided → High |
assignee: | nobody → James Slagle (james-slagle) |
milestone: | none → rocky-2 |
tags: | added: pike-backport-potential queens-backport-potential |
tags: | added: ocata-backport-potential |
tags: | added: newton-backport-potential |
Fix proposed to branch: master /review. openstack. org/565369
Review: https:/