Hostname getting set to fqdn after upgrading to cloud-init-22.2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
High
|
Unassigned |
Bug Description
Hi All,
Environment details:
cloud-init-22.2
Photon OS 3.0 and above
I am seeing something weird after upgrading to cloud-init-22.2
My /etc/hosts looks like this:
$ cat /etc/hosts
127.0.1.1 ph3dev.local ph3dev
127.0.0.1 localhost
And my /etc/hostname
$ cat /etc/hostname
ph3dev
Now if I do systemctl restart cloud-init , /etc/hostname is getting changed.
$ cat /etc/hostname
ph3dev.local
And hostname command return fqdn instead of short name. Isn't it incorrect to have fqdn in /etc/hostname?
I have prefer_
I changed frequency = PER_ONCE in cc_set_hostname.py and it doesn't modify /etc/hostname after that and this is how it was in cloud-init <= v22.1 and even in v22.1 we have prefer_
I doubt that https:/
We discussed a bit about this issue in https:/
If it helps, I see the follwing entries in cloud-init-22.1 logs:
```
2022-08-08 06:58:38,498 - stages.py[DEBUG]: Running module set_hostname (<module 'cloudinit.
```
And in cloud-init-22.2:
```
2022-08-08 07:00:38,512 - modules.py[DEBUG]: Running module set_hostname (<module 'cloudinit.
```
```
Changed in cloud-init: | |
status: | Triaged → Fix Committed |
Thanks for the detailed bug report. Yes, running always rather than once-per-instance does represent a regression.