As per title.. have set up cloud-init for rapid VM creation, however the hostname change is occurring after the machine registers with the DNS server, resulting in the IP/MAC being associated with the template name instead of the VMs new name.
I realise this is the DNS being bad at updating, but is there a way to have the hostname updated prior to the network connection being established?
In the meantime I've "solved" it by adding the following to my template:
But it's not exactly elegant. It works, so it's fine, but if I've missed a better solution I'd love to know.
I realise this is the DNS being bad at updating, but is there a way to have the hostname updated prior to the network connection being established?
In the meantime I've "solved" it by adding the following to my template:
Code:
/etc/cloud/cloud.cfg.d/99_dnsfix.cfg
runcmd:
- '/usr/sbin/dhclient'
But it's not exactly elegant. It works, so it's fine, but if I've missed a better solution I'd love to know.