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

    Cloudbase-init on Windows

    Scheduled Pinned Locked Moved Advanced features
    10 Posts 6 Posters 403 Views 6 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
      jkatz
      last edited by

      I've been working on getting Windows deployments (2022 in particular) to customize with Cloudbase-init.

      So far I have it:

      • Updating the hostname
      • Updating the administrator account's password
      • Running a command
      • And configuring the NIC with a static IP when supplied with the MAC address.

      If I don't supply the MAC in the network config, then cloudbase-init throws a bunch of errors in the log looking for the address and does not set the static IP. It doesn't make sense as their doc states that the field is optional. But seems to be necessary to find the NIC.

      So to make it work, I need to specify a MAC address in XO when creating the VM. And then paste that into the network config yaml.

      So is there a template variable for MAC like there is for {name} and {index} ? And if not... can we get one?

      The working network config:
      network:
      version: 1
      config:
      - type: physical
      name: eth0
      mac_address: "56:a7:01:38:75:3f"
      subnets:
      - type: static
      address: 192.168.1.3/24
      gateway: 192.168.1.1
      dns_nameservers:
      - 192.168.1.2
      dns_search:
      - company.name

      Or am I just doing it wrong?

      Thanks!
      jonathan

      O D 2 Replies Last reply Reply Quote 1
      • O Offline
        onthegrid @jkatz
        last edited by onthegrid

        Would you mind sharing your cloudbase conf and yaml files to get that far?

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          jkatz @onthegrid
          last edited by

          @onthegrid Sure!

          So with the network config above. Gotta make your own MAC address and have it match the one in the interface field when cloning the template. (Variable would be nice here.)

          Cloud config in XO:
          55ba86a2-e4cb-4d8a-b3b3-904d1bb1fa38-image.png

          Installed cloudbase with defaults. Did not run sysprep. Did not reboot. I plan to handle those IDs later. And trying to sysprep Windows 11 didn't work/broke.

          Cloudbase-init.conf:
          6f8df03b-510f-48e5-9c0a-a42de0593eef-image.png

          If i recall correctly, it was just the last three lines I changed/added. Tested on Server 2022 and Windows 11. If we do go into produciton on this platform, I'll do the other config stuff later. I just wanted to make sure I could get the OS config'd with an IP, update the hostname, and reset the administrator password.

          A 1 Reply Last reply Reply Quote 0
          • A Offline
            Andrew7 @jkatz
            last edited by

            @jkatz
            Hi,
            I'm trying to do the same thing.
            So, did you just shutdown the VM after cloudbase init installation and do the changes in config files ?
            Which one you change unattended ?
            How will you manage sysprep ?

            I came from VMware world, and everything there just works.
            Here you have to put your problem on forum ( most of them are just basic/standard VM deployment and administration stuff ) and pray for an answer with a resolution.

            Best regards

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

              @Andrew7 this mindset won't be really constructive if you want some free assistance on a free product.

              @dinhngtu might help if he's around.

              1 Reply Last reply Reply Quote 0
              • D Offline
                DustinB @Andrew7
                last edited by DustinB

                @Andrew7 said in Cloudbase-init on Windows:

                I came from VMware world, and everything there just works.
                Here you have to put your problem on forum ( most of them are just basic/standard VM deployment and administration stuff ) and pray for an answer with a resolution.

                Best regards

                You're welcome to go back to VMWare as well.

                As the saying goes, "if you're free to stay, you're free to go".

                If you want to buy support for your environment then do so and you can create a private ticket with the Vates company and not have to post on the forums. You can't have your cake and eat it too.

                A 1 Reply Last reply Reply Quote 0
                • A Offline
                  Andrew7 @DustinB
                  last edited by Andrew7

                  @DustinB

                  No problem.
                  I'm just a infrastructure engineer/architect as many of us here looking for VMware alternatives.
                  I work in big global company that builds and deploys solutions for different clients.
                  Most of them are asking if there is a real enterprise solution that we can work with, aside from VMware.
                  That's why I'm here trying to figure it out, how this product works. How to do things that you normal do on daily basis in vCenter and ESXi's.

                  No one have to provide any answers here. I wonder for how long this product will survive then ?
                  I would like to remind you that VMware market share and popularity came from free ESXi, vCenter with 3 months trial with full features and easy access to get into product and get help on forums.

                  My frustration is coming from basic things that I am not able to do here.
                  It's not that I'm asking about some advanced features. We are talking about VM provisioning on the basic level.
                  Template creation and deploying VMs from that template with changes that needs to be done during deployment like hostname, IPs and Windows SIDs.

                  If it's too much to ask how to do it, fine. I will move to check out other hypervisors.

                  D 1 Reply Last reply Reply Quote 0
                  • D Offline
                    DustinB @Andrew7
                    last edited by

                    @Andrew7 XCP-ng has always been free to use, the same for Xen Orchestra (from source) you can look at my profile to find a link or read the documentation to deploy it yourself.

                    You've hijacked someone else's thread to ask your question because their question was similar to yours, I guess?

                    And you seem to have an arrogance about your inquiry of "it just works on this other product that we're fleeing from that would cost us as much as 300% more every year forever".

                    And on the same coin, other side you're saying you haven't the faintest reason why anyone would be upset with your tone, while asking for free help.

                    Support for a 3 host pack, is as cheap as $1000/year or $3000, with essentially unlimited and confidential access for a product which has a long tract record.

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      dinhngtu Vates 🪐 XCP-ng Team @jkatz
                      last edited by

                      Hi @jkatz @Andrew7,

                      Cloudbase-init is currently the recommended method for personalizing Windows templates in XO. It supports multiple configuration plugins (hostname/credentials/licensing etc.), which are available from the linked page above.

                      For customizing deployed VMs, what I like to do is to prepare a "skeleton" cloud-init file and set it in XO Settings -> Cloud config. Then I can load this config at any time and fill in the details later for each batch of VM I want to deploy.

                      We do have a Packer repo for making master VM templates from @nathanael-h; it will prepare an XVA image ready for specialization using cloudbase-init. I'll try to work to publish that and provide some documentation next.

                      As for Sysprep support specifically, I've put in a request to the XO team, although I can't promise anything specific for now.

                      A 1 Reply Last reply Reply Quote 0
                      • A Offline
                        Andrew7 @dinhngtu
                        last edited by

                        @dinhngtu

                        Thank you for the replay.

                        I understand that cloudbase-init is a way to go. I did similar config to @jkatz and don't know why it doesn't work for me.
                        I did exactly as you suggested, created Cloud Config settings in XO and then use that during deployment screen.
                        fb2c70d1-6189-4602-9808-aec119f9ac0c-image.png

                        I've tried to set it up with this guide
                        https://docs.xen-orchestra.com/vm-templates

                        So I've added those fields :
                        config_drive_vfat=true
                        ...
                        metadata_services=cloudbaseinit.metadata.services.nocloudservice.NoCloudConfigDriveService
                        plugins=cloudbaseinit.plugins.common.userdata.UserDataPlugin

                        into config files.

                        I'm probably doing something wrong but I don't know where to look.
                        It seems that cloudbase-init doesn't even start or it is skipped because my input is totally incorrect in those "User config " and "Network Config" fields.

                        The log folder here is empty
                        f22f1716-fa3e-46de-be19-6edb70f06377-image.png

                        Do you have any ideas why it doesn't work ?
                        It might be the case that I'm just an idiot and did some rookie mistake as I have never used cloudbase-init before.
                        So, I don't really know if the problem is my Custom Config settings in XO or cloudbase-init config on VM.

                        @dinhngtu said in Cloudbase-init on Windows:

                        As for Sysprep support specifically, I've put in a request to the XO team, although I can't promise anything specific for now.

                        Thank you.

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