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

    Terraform Creating VM from my Windows Templates No Bootable Device

    Scheduled Pinned Locked Moved Infrastructure as Code
    5 Posts 3 Posters 525 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.
    • S Offline
      SethNY
      last edited by SethNY

      BLUF: creating new VMs from my custom Windows 10 and Windows Server 2022 templates works, but using terraform I get failures.

      Console messages
      Boot device: Hard Disk - success.
      Boot device: CD-Rom - failure: could not read boot disk

      No bootable device.
      Powering off in 30 seconds.

      616cf52e-0f13-4de9-8526-6bbd7299de78-image.png

      from my workstations.tf file

      data "xenorchestra_template" "workstation-template" {
      name_label = "win10-template"
      }
      [...]
      resource "xenorchestra_vm" "branch1-1" {
      memory_max = 4294934528
      cpus = 1
      name_label = "branch1-1"
      name_description = "Windows 10 workstation 1 in branch 1"
      template = data.xenorchestra_template.workstation-template.id
      depends_on = [ xenorchestra_network.vlan_network_201]
      disk {
      sr_id = data.xenorchestra_sr.local.id
      name_label = "workstation-1-1-disk"
      size = 137437904896
      }
      network {
      network_id = data.xenorchestra_network.branch1mgt.id
      }
      }
      [...]

      I created my own name_label (e.g. "worksation-1-1.disk") based on the system name.

      Is there a proper way to clone my windows templates? (i did sysprep on the server 2022 systems before creating the server 2022 template)

      Full details https://github.com/doritoes/NUC-Labs/tree/xcp-ng-improvement/XCP-ng/terraform (my entire XCP-ng build is documented there)

      Thank you!

      EDIT: Add that the original templates I created were based on the build-in templates for Windows, <ins>not</ins> "Other source media"

      1 Reply Last reply Reply Quote 0
      • S Offline
        SethNY
        last edited by SethNY

        Re-creating the Windows Server 2022 template off of "Other installation media" instead of the built-in template solved the problem.

        I will repeat this on the Windows 10 template to confirm.

        EDIT: Confirmed Windows 10 working using same solution.

        DanpD 1 Reply Last reply Reply Quote 0
        • DanpD Online
          Danp Pro Support Team @SethNY
          last edited by

          @SethNY Be careful with using "Other installation media" instead of the template closest to the target OS. This has caused some performance issues for some of our customers that was resolved by switching back to the correct template.

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            SethNY @Danp
            last edited by

            @Danp thank you for that information.

            When I wasn't using Terraform, I followed that advice.

            The Windows built-in templates change the boot process fundamentally, requiring "press any key to boot from CD/DVD". If you find another way to resolve it issue, I would love to hear it.

            1 Reply Last reply Reply Quote 0
            • O Offline
              observant-night
              last edited by

              I was having this problem with my Debian 12 template when using terraform as well. I can confirm that rebuilding the template using "Other installation media" also fixed the problem for me. Thanks @SethNY .

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