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
Merge request reports
Activity
assigned to @krish94
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.
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)
mentioned in issue devops#641
added 1 commit
- 10b1be98 - use dedicated variable HOSTNAME vars for proxy nodes
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
closing, follow up in !211 (closed)