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

    Cloud Config success

    Scheduled Pinned Locked Moved Xen Orchestra
    cloudinitconfig
    7 Posts 5 Posters 1.7k Views 7 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.
    • F Offline
      fataugie
      last edited by

      While I was waiting on a fix for the OVA import issues I was experiencing, I decided to work on a solution myself to getting a template I could use Cloud Configs on.

      Through much trial and error, I managed to figure out a build template that works for Ubuntu 22.04 LTS that gets you a base image that will recognize standard Cloud Configs in XOCE and apply them successfully. I thought I'd write it up for anyone else who may be banging their heads against the wall like I was.

      ***Note: almost ALL of this was knowledge gleaned from other users in other posts, comments and various forum posts here and on other websites. All I did was figure out what worked, in a repeatable fashion, so I could actually use the configs as intended.

      How I built my cloud disk and used Cloud Config ;

      • Installed Ubuntu 22.04 LTS as VM, (I used 2 cpu, 8G ram, 10G drive)

      • Upon reboot, I updated/upgraded w/apt

      • Installed Guest Tools

      • Ran sudo apt install cloud-initramfs-growroot

        • (an absolute MUST if you want your VM to apply a Cloud Config...took me 4 or 5 times reinstalling and trying various things not realizing how important this was for success. I thought it was automatically installed with the Cloud-Init package.....it is not).
      • Ran sudo cloud-init clean

      • Ran sudo truncate -s 0 /etc/machine-id /var/lib/dbus/machine-id

        • Used to clear out machine-id for regeneration. Found that if you deleted the file, it would not be regenerated during the reboot but if you zeroed it out, it would.

      Shutdown VM and created a template from that image.

      Doing this allowed me to apply Cloud Configs and have them actually stick to any new VM created from that image.

      One thing...the configs MUST be in perfect YAML format so running through a verifier helps spot issues. I was missing a space between the hashed_passwd: colon and the start of the password. It took a verifier to point that out.

      Hopefully this helps someone in the future

      1 Reply Last reply Reply Quote 3
      • V VGerris referenced this topic on
      • M Offline
        mtcoffee
        last edited by

        This post saved me a lot of time. Thank you for sharing

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

          ManonMercier if you volunteer, it might worth a guide/doc somewhere as a reference 🙂

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

            Noted @olivierlambert. Posting back here when it's done.

            1 Reply Last reply Reply Quote 0
            • ManonMercierM Offline
              ManonMercier Vates 🪐 Pro Support Team
              last edited by

              Dear fataugie,
              Thank you for sharing your findings! We have added the method you described to our documentation 🙂

              1 Reply Last reply Reply Quote 3
              • M Offline
                mtcoffee
                last edited by

                I am now a VMware -> XCP-ng convert and wish I had known sooner. This post helped me get to the point of fully automated template and server builds with Packer/Terraform.

                Here are my code samples. Hope it helps someone else!

                Packer/XCP-ng Templates
                https://github.com/mtcoffee/xcp-ng-packer-examples

                Terraform/XCP-ng Templates
                https://github.com/mtcoffee/xcp-ng-terraform-examples

                M 1 Reply Last reply Reply Quote 0
                • M Offline
                  mohammadm @mtcoffee
                  last edited by

                  mtcoffee Thank you. Just what I need.

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