Skip to content
Snippets Groups Projects

Set hostname explicitly in user data during cloud-init for proxy nodes

Closes #244 (closed)

Issue: When we query the node exporter endpoint, we noticed that the nodename from http-proxy and ood-gpfs5 have hash at the end which is different from ssh-proxy.

172.20.10.32 ssh-proxy

172.20.10.6 http-proxy-edbc74b

Fix: We've seen that cloud_init tries to overwrite the nodename with the nodename provided by the user as a CI argument, however after multiple attempts, it still fails.

Issue stems from packer adding a tag to the build image name as an artifact which does not seem to be overwritten by cloud_init, hence the proposed solution fixes the packer build image name by forcing/overwriting it with the hostnamectl command

Edited by Krish Moodbidri

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • assigned to @krish94

  • Author Maintainer

    I used hostnamectl instead of hostname because hostnamectl updates the persistent system hostname by modifying the appropriate configuration files, ensuring the change remains after a reboot

    The --static flag ensures that only the static (persistent) hostname is updated, without affecting the pretty or transient hostnames.

  • Author Maintainer

    resolves #244 (closed)

    we've seen that cloud_init tries to overwrite the nodename with the nodename provided by the user as a CI argument, however after multiple attempts, it still fails.

    Issue stems from packer adding a tag to the build image name as an artifact which does not seem to be overwritten by cloud_init, hence the proposed solution fixes the packer build image name by forcing/overwriting it with the hostnamectl command

  • mentioned in issue #244 (closed)

  • Bo-Chun Chen changed title from Set hostname explicitly in cloud-init for proxy nodes to Set hostname explicitly in user data during cloud-init for proxy nodes

    changed title from Set hostname explicitly in cloud-init for proxy nodes to Set hostname explicitly in user data during cloud-init for proxy nodes

  • Bo-Chun Chen changed the description

    changed the description

  • Krish Moodbidri changed the description

    changed the description

  • mentioned in issue devops#641

  • added 1 commit

    • 10b1be98 - use dedicated variable HOSTNAME vars for proxy nodes

    Compare with previous version

  • Author Maintainer

    Issue: Cloud-init repeatedly fails to apply the intended hostname:

    [   11.513093] cloud-init[785]: util.py[WARNING]: Failed to set the hostname to http-proxy.openstack.internal. (http-proxy)
    [   12.423808] cloud-init[869]: util.py[WARNING]: Failed to set the hostname to http-proxy.openstack.internal. (http-proxy)
    [   14.037461] cloud-init[869]: util.py[WARNING]: Running module set_hostname (...) failed

    Despite passing hostname=http-proxy in our user-data (CI argument), the image’s name tag (e.g. “http-proxy-edbc74b”) persists.

    Packer image tagging: During the build, Packer appends a random build ID to the image name for artifact tracking.

    Proposed fix: Force a persistent hostname override after cloud-init’s built-in steps

  • Author Maintainer

    closing, follow up in !211 (closed)

Please register or sign in to reply
Loading