Terraform Creating VM from my Windows Templates No Bootable Device
-
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 diskNo bootable device.
Powering off in 30 seconds.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"
-
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.
-
@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.
-
@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.
-
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 .