dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.54k stars 457 forks source link

domain cpu mode not recognized in 0.6.11 #908

Closed mwhahaha closed 2 years ago

mwhahaha commented 2 years ago

System Information

Linux distribution

fedora34

Terraform version

Terraform v1.0.11
on linux_amd64
+ provider registry.terraform.io/dmacvicar/libvirt v0.6.10
+ provider registry.terraform.io/hashicorp/template v2.2.0

Provider and libvirt versions

Broken provider version v0.6.11


Issue

In v0.6.10, the following works in a libvirt_domain definition...

resource "libvirt_domain" "foo" {
   ...
    cpu = {
      mode = "host-passthrough"
    }
}

In v0.6.11, that errors with:

│ Error: Unsupported argument
│ 
│   on main.tf line 92, in resource "libvirt_domain" "task-core":
│   92:     cpu = {
│ 
│ An argument named "cpu" is not expected here. Did you mean to define a block of type "cpu"?
rhafer commented 2 years ago

@mwhahaha I think this is because of https://github.com/dmacvicar/terraform-provider-libvirt/commit/7074fe3c13e08a79f8d82d39aa7f163a88a7caa9. Which changed the syntax of the cpu block a bit. Try without the = sign. This should work:

cpu {
      mode = "host-passthrough"
}
mwhahaha commented 2 years ago

Ah yes that was is. I knew there was a change but couldn't find the specifics. Thanks for the pointer.