overcloud deploy can add undercloud hosts entries that keep growing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
Fix Released
|
High
|
Michele Baldessari |
Bug Description
First seen via https:/
1) Undercloud is deployed successfully and has the following in /etc/hosts:
[stack@undercloud-0 ~]$ grep undercloud-0 /etc/hosts
192.168.24.1 undercloud-
127.0.0.1 undercloud-
192.168.24.1 undercloud-
Let's leave out for a second that there are two identical lines.
2) User calls overcloud deploy
3) The parameter 'UndercloudHost
4) UndercloudHosts
getent hosts "$(hostname -s).ctlplane"
Now the output of that command is actually the following:
192.168.24.1 undercloud-
192.168.24.1 undercloud-
Notice how getent hosts adds another undercloud-
5) The overcloud deploy uses UndercloudHosts
As an additional test I manually added another undercloud-
[stack@undercloud-0 ~]$ grep undercloud-
192.168.24.1 undercloud-
192.168.24.1 undercloud-
Now look at getent hosts:
[stack@undercloud-0 ~]$ getent hosts "$(hostname -s).ctlplane"
192.168.24.1 undercloud-
192.168.24.1 undercloud-
So two undercloud-
Now the reason for getent hosts to keep adding host entries is due to the duplicate line in /etc/hosts.
Here is the proof:
[root@undercloud ~]# echo '1.2.3.4 pippo.localdomain pippo.ctlplane' >> /etc/hosts
[root@undercloud ~]# getent hosts pippo.ctlplane
# Normal
1.2.3.4 pippo.localdomain pippo.ctlplane
[root@undercloud ~]# echo '1.2.3.4 pippo.localdomain pippo.ctlplane' >> /etc/hosts
# Two lines automatically add the hosts
[root@undercloud ~]# getent hosts pippo.ctlplane
1.2.3.4 pippo.localdomain pippo.ctlplane pippo.ctlplane
1.2.3.4 pippo.localdomain pippo.ctlplane pippo.ctlplane
I think a few things need to happen to fix this properly. Namely we need to:
A) in 3) we should prune identical multiple lines
B) in 3) we should also prune identical entries
C) We should ideally also figure out who/what on earth adds 192.168.24.1 undercloud-
Now even though C) is not ideal, we should still be more robust in the face of an /etc/hosts file that has duplicate entries.
Changed in tripleo: | |
milestone: | victoria-1 → victoria-3 |
Fix proposed to branch: master /review. opendev. org/740457
Review: https:/