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

    XO + cloud-init appending 0 to hostname

    Scheduled Pinned Locked Moved Xen Orchestra
    9 Posts 4 Posters 609 Views 3 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.
    • B Offline
      bradk
      last edited by olivierlambert

      Wondering if anyone has come across this issue...
      I created a template for use with XO/Cloud-init. It works fine for everything.. alsmost.

      When creating a VM from XO and selecting the template and then I choose a custom cloud-config. This has the following:

      #cloud-config
      hostname: {name}%
      

      Now when I build the VM I get the following:

      $ hostname
      test.domain.com0
      

      It appends a zero to the end of the hostname.

      If however, I set the cloud config to:

      #cloud-config
      hostname: test.domain.com
      

      And build the VM, the hostname is set correctly!

      Thoughts?

      Cheers,

      fohdeeshaF 1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by olivierlambert

        Hmm weird 🤔 Have you already seeing this @fohdeesha ?

        Also, we need more info on your XO: XOA or XO from the sources? Are you fully up-to-date?

        1 Reply Last reply Reply Quote 0
        • fohdeeshaF Offline
          fohdeesha Vates 🪐 Pro Support Team @bradk
          last edited by

          @bradk that's working as expected, the number of the VM is the % in the hostname variable. If you want the hostname to be set to the name of the VM, without numbering, just use hostname: {name}

          B 1 Reply Last reply Reply Quote 0
          • B Offline
            bradk @fohdeesha
            last edited by

            @fohdeesha Thanks! Wow that works fine. How did I miss that one.. 😉

            Cheers,

            Brad

            1 Reply Last reply Reply Quote 1
            • olivierlambertO Offline
              olivierlambert Vates 🪐 Co-Founder CEO
              last edited by

              If it's not clear in our doc, we should probably update it 🙂

              fohdeeshaF 1 Reply Last reply Reply Quote 0
              • fohdeeshaF Offline
                fohdeesha Vates 🪐 Pro Support Team @olivierlambert
                last edited by

                @olivierlambert thinking further it should probably just be completely removed from the example/default, when creating multiple VMs from our "create "VM" page, numbering of all the VM names directly is already achieved, so having another number variable on top of those numbered VM names inside the cloud init config will just end up with the multiple VMs having hostnames like "test00", "test11", "test22", etc

                1 Reply Last reply Reply Quote 0
                • olivierlambertO Offline
                  olivierlambert Vates 🪐 Co-Founder CEO
                  last edited by

                  What do you think @pdonias ?

                  pdoniasP 1 Reply Last reply Reply Quote 0
                  • pdoniasP Offline
                    pdonias Vates 🪐 XO Team @olivierlambert
                    last edited by

                    @olivierlambert No, because {name} will be replaced by the main name input (at the top of the form), not the individual names in case of bulk creation. So you should get "test1", "test2", as expected.

                    fohdeeshaF 1 Reply Last reply Reply Quote 0
                    • fohdeeshaF Offline
                      fohdeesha Vates 🪐 Pro Support Team @pdonias
                      last edited by

                      @pdonias yep I can confirm that works as expected, cloud-init uses the base VM name specified in the top of the create VM page, not the numbered VM names that result after creation. Nevermind!

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post