cloud-init does not use search domain as fqdn

jimmymcheung

New Member
Apr 21, 2023
23
1
3
I have a VM provisioned with qcow2 image, and have set in the cloud-init a search domain. However, the cloud init is using vmName + search domain as the FQDN, which is not as expected. An earlier VM created with the same image and cloud-init settings (except with a different search domain) produces current FQDN. Does anyone have an idea on how to fix this?

For clarity, here is list of current/expected setting:
Code:
new VM (current: wrong config):
host name: vm-1
search domain: vm-1.node1.pve.example.com
fqdn: vm-1.vm-1.node1.pve.example.com

new VM (expected: correct config):
host name: vm-1
search domain: vm-1.node1.pve.example.com
fqdn: vm-1.node1.pve.example.com

existing VM from same template (current: correct config):
host name: vm-0
search domain: vm-0.pve.example.com
fqdn: vm-1.pve.example.com

I understand that search domain is not FQDN, but since my research on how to specify FQDN with cloud-init does not come a result, and since the previous VM that take search domain as FQDN (maybe a bug?), I was expecting a consistent behaviour.
 
Last edited: