Closed ddelnano closed 3 years ago
VM templates without an existing disk can't use Cloudinit because it means there's no Cloudinit already installed in the VM. That's why we have 2 kind of templates: "diskless" ones, with only some metadata info (BIOS settings, sort of), and templates with existing disks (ie when you turn a VM into a template). Only the latter can be used with Cloudinit, because there's already an OS installed (hopefully with cloudinit inside, but there's no way to know from our perspective).
Ah I see. So the terraform provider will need to inspect the template before creating the VM (maybe later on down the line the XO api could provide a different mechanism for dealing with this?).
If the provider needs to create the VM with the "iso template" I'm still not clear on how to use the vm.create
rpc call to accomplish that. From some documentation I've read on creating a VM manually with the xenserver cli it seems like some of these concept. It seems like the installation
argument might be relevant and then it would require passing in a value to VDIs
?
Users can now use diskless templates if they want (provided they supply an ISO on creation). This was implemented in #128 and the docs on terraform registry explain how to use this functionality.
I've been having a discussion in Discord with a user that is trying to create a
xenorchestra_vm
resource using one of the out of the box VM templates as the template attribute. The following code reproduces the problem.Applying this code causes the following error
The user that reported this issue shared the following stack trace which links the problem back to the fact that XO can't find a SR to create the cloud config drive. The issue seems to be related to the fact that the template itself doesn't have any disks with device
0
.I need to investigate how these templates are properly used and see how the
vm.create
rpc call should be updated to handle this case. I don't run into this issue because I have hand made a VM template that works with the provider and does not need an OS iso for its first boot.