I re-ran everything using the latest 22.04 Ubuntu ISO instead of 20.04. Hostname templating is now working properly. Must have read too fast the first time when I went for 20.04. There must be some critical difference between the cloud init or distribution versions that caused my issue.
Posts
-
RE: cloud-init does not set hostname
-
cloud-init does not set hostname
Howdy folks, I saw a couple posts similar to this but not quite what I've experienced.
I'm trying to create a cloud config template for Ubuntu 20.04 (haven't done this before). Using the standard 20.04 ISO image, I followed the instructions to setup a template VM with the guest tools and cloud config stuff installed. It generally works great to deploy with, but whenever I create a new VM from this template using the below cloud config, the hostname is not updated (it stays with the original template VM hostname). I know I'm doing something right, because the ssh keys are being set properly.
I've tried some variations of the following Cloud config (even tried a hardcoded hostname to no effect).
#cloud-config hostname: {name}% ssh_authorized_keys: - ssh-rsa <pubkey here>
The only difference I can see is I'm on Ubuntu 20.04 instead of 22.04 - would that really make the difference? I also saw some chatter about having to set a network config and that it breaks if blank, but that didn't seem to make a difference for me.
Versions (XOCE):
Xen Orchestra, commit dfc62
xo-server 5.106.1
xo-web 5.107.0