XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    cloud-init does not set hostname

    Scheduled Pinned Locked Moved Advanced features
    2 Posts 1 Posters 953 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jon
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • J Offline
        jon
        last edited by

        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.

        1 Reply Last reply Reply Quote 0

        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
        • First post
          Last post