Open micsport13 opened 2 months ago
Hey @micsport13 👋🏼
Just to confirm, you initially imported the resource without the initialization
section, then added the initialization
with the IP address? That's a bit unexpected...
If your intention is to add an IP to an existing, previously provisioned VM, this approach won't work. The initialization
block allows you to configure cloud-init for the VM, which runs only at the first boot with blank disks.
EDIT: just saw your comment to another ticket. Yeah, that won't let you configure IP without re-provisioning the VM. But provider should't panic like this, and should display a proper error message.
How does one set the IP address of an existing VM then? That's probably why it's failing though so is there no way to set the IP address after creating the VM in code?
This is not something that the provider could do for the VM, as IP configuration is essentially a responsibility of OS, which is already installed in the VM at this point.
Ideally the VM should be pre-configured with DHCP, and also have qemu-agent installed and enabled, then it will be much easier to import and then manage with terraform.
Describe the bug When adding an ipv4 configuration to a vm resource, it causes the plugin to crash
To Reproduce Steps to reproduce the behavior:
Please also provide a minimal Terraform configuration that reproduces the issue.
Expected behavior Should apply the IP address settings
Additional context Error Message:
TF_LOG=DEBUG terraform apply
): Potential extra information:I'm not sure if it matters but I did import this resource.