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 -
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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login