Project

General

Profile

Actions

action #76786

closed

openQA Project - 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

Added by okurz over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
-
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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

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:

Related issues 2 (0 open2 closed)

Related to openQA Infrastructure - action #76783: research how hostnames with systemd work and make them static for all OSD related machinesResolvedokurz2020-10-29

Actions
Copied from openQA Infrastructure - action #75445: unknown dashboards for "linux-fwcx" and "localhost" reappearing on monitor.qaResolvedokurz2020-10-28

Actions
Actions #1

Updated by okurz over 3 years ago

  • Copied from action #75445: unknown dashboards for "linux-fwcx" and "localhost" reappearing on monitor.qa added
Actions #2

Updated by okurz over 3 years ago

  • Related to action #76783: research how hostnames with systemd work and make them static for all OSD related machines added
Actions #3

Updated by okurz over 3 years ago

  • Target version changed from Ready to future
Actions #4

Updated by okurz over 3 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

Actions #5

Updated by okurz over 3 years ago

  • Description updated (diff)
Actions #6

Updated by okurz over 3 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'
Actions #7

Updated by okurz over 3 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

Actions #8

Updated by okurz over 3 years ago

  • Estimated time set to 80142.00 h
Actions #9

Updated by okurz over 3 years ago

  • Estimated time deleted (80142.00 h)
Actions #10

Updated by okurz over 3 years ago

  • Parent task set to #80142
Actions #12

Updated by okurz over 3 years ago

  • Status changed from In Progress to Resolved

Last one merged and crosschecked again with the mentioned salt commands that everything is fine.

Actions

Also available in: Atom PDF