Update:
I tried to create a vm using a basic terraform config and using another template. Still the same problem, vm created without a disk.
tofu apply -var-file="carlo111.tfvars"
OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with
the following symbols:
+ create
OpenTofu will perform the following actions:
# module.vm.xenorchestra_vm.vm will be created
+ resource "xenorchestra_vm" "vm" {
+ auto_poweron = false
+ clone_type = "full"
+ core_os = false
+ cpu_cap = 0
+ cpu_weight = 0
+ cpus = 2
+ destroy_cloud_config_vdi_after_boot = false
+ exp_nested_hvm = false
+ hvm_boot_firmware = "uefi"
+ id = (known after apply)
+ ipv4_addresses = (known after apply)
+ ipv6_addresses = (known after apply)
+ memory_max = 2126512128
+ memory_min = (known after apply)
+ name_label = "carlo111"
+ power_state = "Running"
+ start_delay = 0
+ template = "3dbf5448-0337-40e1-ebfc-f3f47e2cb0dd"
+ vga = "std"
+ videoram = 8
+ disk {
+ name_label = "carlo111-osdisk"
+ position = (known after apply)
+ size = 32212254720
+ sr_id = "589dad4d-2391-c2a9-589c-d34a9a7757ea"
+ vbd_id = (known after apply)
+ vdi_id = (known after apply)
}
+ network {
+ device = (known after apply)
+ ipv4_addresses = (known after apply)
+ ipv6_addresses = (known after apply)
+ mac_address = (known after apply)
+ network_id = "d4ddcfb0-6d3e-d267-b200-d7d1fec1edc8"
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
OpenTofu will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
module.vm.xenorchestra_vm.vm: Creating...
module.vm.xenorchestra_vm.vm: Still creating... [10s elapsed]
module.vm.xenorchestra_vm.vm: Creation complete after 14s [id=95b3b0c6-ac8e-fe4b-2f55-ba0d8ff04005]
[20:09 dacshyp002 ~]# xe vbd-list vm-uuid=95b3b0c6-ac8e-fe4b-2f55-ba0d8ff04005
[20:25 dacshyp002 ~]#
main.tf
resource "xenorchestra_vm" "vm" {
name_label = var.vm_name
template = var.template_uuid
cpus = var.cpus
memory_max = var.memory * 1024 * 1024
hvm_boot_firmware = "uefi"
clone_type = "full"
disk {
sr_id = var.sr_uuid
name_label = "${var.vm_name}-osdisk"
size = var.disk_size * 1024 * 1024 * 1024
}
network {
network_id = var.network_id
}
}
I don't know if it is related, I see the following errors during the creation of the vm:
Oct 28 20:44:07 dacshyp002 xapi: [error||458 |xapi events D:20adbb444ff6|xenops] events_from_xapi: missing from the cache: [ 532cad38-f1ae-433b-b7ac-e0399613fe24 ]
Oct 28 20:44:07 dacshyp002 xapi: [error||458 |xapi events D:20adbb444ff6|xenops] events_from_xapi: extra items in the cache: [ 1c210250-1f89-b0e3-c1e6-f7bee976e94c ]
[20:44 dacshyp002 log]# xe vm-list uuid=532cad38-f1ae-433b-b7ac-e0399613fe24
uuid ( RO) : 532cad38-f1ae-433b-b7ac-e0399613fe24
name-label ( RW): Control domain on host: dacshyp002
power-state ( RO): running
[20:45 dacshyp002 log]# xe vm-list uuid=1c210250-1f89-b0e3-c1e6-f7bee976e94c
uuid ( RO) : 1c210250-1f89-b0e3-c1e6-f7bee976e94c
name-label ( RW): carlo111
power-state ( RO): running
Manually creating the vm using the same template is not a problem.