Open Unfairz opened 4 years ago
Following up, I have double-checked and it seems like, in order to get the disk block to function, I would need to apply all of the attributes and set the ones that I don't need to null, as this doesn't set it automatically:
"disk": [
{
"volume_id": "${libvirt_volume.vps-001.id}",
"block_device": null,
"file": null,
"scsi": null,
"url": null,
"wwn": null
}
],
This works and seems to be caused by the #665 merge which included the different mapping. Not sure this can be resolved due to the specific JSON syntax and the way it handles mapping.
@Unfairz thx for issue.We might needt to check if we can make json
happy.
However the json format has less prio then the others since it is less used. But we might check if we can find a solution where there both compatible. it should exists one
Hello,
I notice same error with hcl format.
--> terraform apply
Error: Incorrect attribute value type
on computes.tf line 18, in resource "libvirt_domain" "db1":
18: disk = [
19: {
20: volume_id = libvirt_volume.my_root_centos.id
21: },
22: {
23: volume_id = libvirt_volume.my_root_debian.id
24: }
25: ]
Inappropriate value for attribute "disk": element 0: attributes
"block_device", "file", "scsi", "url", and "wwn" are required.
I try to look at code but here https://github.com/dmacvicar/terraform-provider-libvirt/blob/v0.6.2/libvirt/resource_libvirt_domain.go#L146 attributes are marked as optional. and i fail to find error message Inappropriate value for attribute "disk"
. Does it had anything to do with non set value Computed: true
?
I think the last error is related to #1032
System Information
Linux distribution
Centos7
Terraform version
Provider and libvirt versions
Checklist
[ ] Is your issue/contribution related with enabling some setting/option exposed by libvirt that the plugin does not yet support, or requires changing/extending the provider terraform schema?
[x] Is it a bug or something that does not work as expected? Please make sure you fill the version information below:
Description of Issue/Question
Setup
Steps to Reproduce Issue
Hello folks! I have been dealing with this problem for quite some time now and am hoping to be missing something really simple at this point!
Basically, when I use the JSON syntax of building the terraform files, I cannot get the disk portition to function correctly and the error given is quite odd.
I thought it would be caused due to the way JSON maps values, however, in my testing I wasn't able to get it working.
Odd part is that if I go ahead and change the "volume_id" to a "block_device", for example, the error message changes to:
If I delete the disk block, the rest works perfectly fine, without the disk (to be expected).
Huge thanks for taking your time to take a look into this and sorry if it's something really simple that I might have missed!