Hello
I've searched the other topics but there doesn't seem to be a definitive answer and as far as i saw, noone mentioned the fqdn entry.
i've configured a cloud-init ready image on rocky linux 8 (rhel8 clone)
the network, public key and user work fine. when I mount the /dev/sr0 and have a look at the cloud init files, the hostname is set aswell:
as far as i can see, the hostname is set correctly (the name i gave the vm).
there is nothing special in the network-data and meta-data
but when i start the vm, the hostname is not really the hostname.
it just keeps whatever was set before. when I change the hostname (hostnamectl set-hostname XYZ) then it persists...
what i found was in the /var/lib/cloud/data/set-hostname
but I have no idea where this XYZ is saved..
I tried putting the following lines in /etc/cloud/config.cfg
the hostname variable is definitly set correct as it gets applied to the /etc/hosts file (this is done via the /etc/cloud/tempaltes/hosts.rhel.tmpl template)
so my question is: is there a way to find out where this fqdn entry comes from?
can we somehow change the behavior to set the fqdn instead of hostname / extend the config in the ui to change that?
I've searched the other topics but there doesn't seem to be a definitive answer and as far as i saw, noone mentioned the fqdn entry.
i've configured a cloud-init ready image on rocky linux 8 (rhel8 clone)
the network, public key and user work fine. when I mount the /dev/sr0 and have a look at the cloud init files, the hostname is set aswell:
YAML:
[root@judihui sr0]
$ cat user-data
#cloud-config
hostname: SRVRLRCLB01
manage_etc_hosts: true
user: root
disable_root: False
password: VALUE HIDDEN
ssh_authorized_keys:
- ssh-rsa VALUE HIDDEN
chpasswd:
expire: False
package_upgrade: true
as far as i can see, the hostname is set correctly (the name i gave the vm).
there is nothing special in the network-data and meta-data
but when i start the vm, the hostname is not really the hostname.
it just keeps whatever was set before. when I change the hostname (hostnamectl set-hostname XYZ) then it persists...
what i found was in the /var/lib/cloud/data/set-hostname
YAML:
{
"fqdn": "XYZ",
"hostname": "SRVRLRCLB01"
}
but I have no idea where this XYZ is saved..
I tried putting the following lines in /etc/cloud/config.cfg
YAML:
preserve_hostname: false
prefer_fqdn_over_hostname: false
the hostname variable is definitly set correct as it gets applied to the /etc/hosts file (this is done via the /etc/cloud/tempaltes/hosts.rhel.tmpl template)
so my question is: is there a way to find out where this fqdn entry comes from?
can we somehow change the behavior to set the fqdn instead of hostname / extend the config in the ui to change that?