action #76786
closedopenQA Project (public) - coordination #80142: [saga][epic] Scale out: Redundant/load-balancing deployments of openQA, easy containers, containers on kubernetes
Configure static hostnames with salt for all salt nodes
0%
Description
Motivation¶
See https://progress.opensuse.org/issues/75445#note-5 . As a fallback if the initial network configuration takes a bit we should have the static hostnames properly configured. This likely also makes logs a bit more readable when the hostname in the log is something we "know"
Acceptance criteria¶
- AC1: All salt nodes currently covered by gitlab.suse.de/openqa/salt-states-openqa and gitlab.suse.de/openqa/salt-pillars-openqa have a static hostname configured with salt
Suggestions¶
- Read https://progress.opensuse.org/issues/75445#note-5 and research how a static hostname can be configured with salt, e.g. https://docs.saltstack.com/en/latest/ref/states/all/salt.states.network.html#retain-settings
- Apply it as rule for all our hosts, at least for all osd workers, probably based on grains or pillar data
Further details¶
Currently some hosts have a static hostname defined that can interfer with operations
openqa:~ # salt -l error -C '*' cmd.run 'hostnamectl | grep "suse$"'
openqaworker8.suse.de:
openqaworker3.suse.de:
Static hostname: linux-5h37.suse
openqaworker5.suse.de:
openqaworker6.suse.de:
openqaworker2.suse.de:
Static hostname: linux-1nn1.suse
openqaworker9.suse.de:
Static hostname: linux-q6bp.suse
grenache-1.qa.suse.de:
openqa-monitor.qa.suse.de:
openqaworker10.suse.de:
QA-Power8-4-kvm.qa.suse.de:
openqaworker13.suse.de:
openqaworker-arm-3.suse.de:
openqaworker-arm-1.suse.de:
openqa.suse.de:
openqaworker-arm-2.suse.de:
QA-Power8-5-kvm.qa.suse.de:
Updated by okurz about 4 years ago
- Copied from action #75445: unknown dashboards for "linux-fwcx" and "localhost" reappearing on monitor.qa added
Updated by okurz about 4 years ago
- Related to action #76783: research how hostnames with systemd work and make them static for all OSD related machines added
Updated by okurz about 4 years ago
- Priority changed from Low to High
- Target version changed from future to Ready
reappeared as a problem, see #75445#note-13 , and #78218#note-12
Updated by okurz about 4 years ago
- Status changed from Workable to In Progress
- Assignee set to okurz
I looked for these transient hostnames with grep -R … /etc/
on workers and found that this name is set in /etc/HOSTNAME which is a symlink to /etc/hostname which is owned by package netcfg
. I think hostnamectl reads from there. To try to set the correct hostname again I did:
sudo salt -l error -C '*' cmd.run 'hostnamectl | grep -q "suse$" && hostname > /etc/hostname ; hostnamectl'
Updated by okurz about 4 years ago
Following https://docs.saltstack.com/en/latest/ref/states/all/salt.states.network.html it should be very much possible to set the hostname with something like
system:
network.system:
- hostname: {{ grains['host'] }}
- apply_hostname: True
- retain_settings: True
but this showed an error:
ID: system
Function: network.system
Result: False
Comment: 'ip.get_network_settings'
Started: 16:30:30.656685
Duration: 0.928 ms
Changes:
so I am just doing:
/etc/hostname:
file.managed:
- contents: {{ grains['host'] }}
instead which seems to not apply the change immediately but some seconds after hostnamectl
reports the right hostname.
https://gitlab.suse.de/openqa/salt-states-openqa/-/merge_requests/403
Updated by okurz about 4 years ago
Updated by okurz about 4 years ago
- Status changed from In Progress to Resolved
Last one merged and crosschecked again with the mentioned salt commands that everything is fine.