Why does Terraform not clone my target machine properly? #1060
-
Hi
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 6 replies
-
Try to remove these config lines: ...
ide {
ide0 {
cdrom {
iso = "local:iso/SERVER_EVAL_x64FRE_en-us.iso"
}
}
}
... Your template is ...
bios = "ovmf"
boot = "order=scsi0"
... Probably, you should disable Agent (does it exist on Windows?): ...
agent = 0
... Not sure regarding this, if this is correct: ...
os_type = "win11"
... |
Beta Was this translation helpful? Give feedback.
-
Hi! What I have right now is the following:
And when removing the following block:
I will always get booted to a bootscreen stating the following (and never actually get booted into windows):
Why is this simple task proving to be so hard for me? |
Beta Was this translation helpful? Give feedback.
-
What will be if you add this? ...
pxe = false
... Also, have you tried provisioning just one VM instead of bulk? |
Beta Was this translation helpful? Give feedback.
-
And what about this?
|
Beta Was this translation helpful? Give feedback.
-
I even tried a simplistic code but, got booted in to a broken machine with the same boot message as before.
I don't get it. What am I missing? I feel like this should be so simple. |
Beta Was this translation helpful? Give feedback.
-
I am running into a very similar problem. I have a heavily modified template VM and using it as template in this provider would lead to me having to basically redefine it explicitly, which I would rather avoid, since I would have to make changes at two places now. This is not, as @maksimsamt alleged, simple. If you clone a VM using the UI or the API the semantics are completly different. You just inherit every aspect of the template. I think there is a proper solution here. We just would need to adjust thesources of truth Terraform uses on resource creation when cloning. Those are: TF Provider SpecifiedNon-Null default values are specified in the provider for every parameter that is not overridden by the user. This one is currently used and the provider explicitly defines the parameters of the VM. It makes sense that there is a default here from a usability POV but in my opinion the default provided by the system should take preference if it is provided. Deferred System DefaultThese are values that are resulting in a (known after apply ) message when used in the output. The underlying system (Proxmox) defines it an Terraform adopts whatever the value is into the state. To solve our problem we would need to make all our variables use whatever the Deferred System Default value is when cloning the resource. It would require to not set the default value as the desired value, unless the user specified it explicitly. We should stick to how the API semantics work on how to set defaults. |
Beta Was this translation helpful? Give feedback.
ide0
disk, notscsi0
, so, you have two options:scsi0
diskide0
diskYour template disk is 64G, in your Terraform config only 20G. Target VM should have the same or larger disk (>=64G, not 20G)
Is it correct, that your template disk is TPM encrypted? If so, I doubt that it is supported by the current terraform provider.
As for
CPU [x86-64-v2-AES]
.By default terraform provider sets it to
host
. If you need any other option, you need to add it to the Terraform configuration, for example