Open den-patrakeev opened 3 months ago
Try this ignore_changes
:
...
ignore_changes = [
usb[0]
]
...
or
...
ignore_changes = [
usb[0].host
usb[0].usb3
]
...
Try this
ignore_changes
:... ignore_changes = [ usb[0] ] ...
or
... ignore_changes = [ usb[0].host usb[0].usb3 ] ...
Hi! Thank you! Unfortunately this didn't help.
Hi! Thank you! Unfortunately this didn't help.
Can you share your config snippet with usb block/blocks?
The same error with hostpci section
Invalid address to set: []string{"hostpci", "0", "id"}
block:
dynamic hostpci {
for_each = var.vm_pci_devices
content {
host = hostpci.value.id
rombar = hostpci.value.rombar
pcie = hostpci.value.pcie
}
}
vm_pci_devices = [
{ id = "0000:00:02", rombar = 1, pcie = 0 }
]
The same error with hostpci section
Invalid address to set: []string{"hostpci", "0", "id"}
block:
dynamic hostpci { for_each = var.vm_pci_devices content { host = hostpci.value.id rombar = hostpci.value.rombar pcie = hostpci.value.pcie } }
vm_pci_devices = [ { id = "0000:00:02", rombar = 1, pcie = 0 } ]
1) I'm not sure if you're using Terraform dynamic blocks correctly.
...
dynamic hostpci {
...
As per Terraform documentation it should be like this:
...
dynamic "hostpci" {
...
2) Are you sure the latest version of the provider supports hostpci
?
I couldn't find anything similar in Temate provider documentation
dynamic network {
for_each = var.vm_network_interfaces
content {
bridge = network.value.bridge
model = network.value.model
firewall = network.value.firewall
tag = network.value.vlan
}
}
(anyway it present in https://github.com/Telmate/terraform-provider-proxmox/blob/d3fed178e06e9429e27e92094387e1ceef95e825/proxmox/resource_vm_qemu.go#L437 )
- you can use both variants: example of working dynamic block (network)
dynamic network { for_each = var.vm_network_interfaces content { bridge = network.value.bridge model = network.value.model firewall = network.value.firewall tag = network.value.vlan } }
- So..it worked before, and it didn't say in the change notes that it no longer works :| hostpci block was added in v2.9.14 (How to enable PCI passthrough #299)
(anyway it present in
)
OK, but there is no official documentation that this can be done un such way...
Latest major version is v3, not v2 Present - doesn't mean that it really works :) and at the same time there is no documentation for this... Here it is necessary to get comments from the developers.
Hi! Thank you! Unfortunately this didn't help.
Can you share your config snippet with usb block/blocks?
Block with USB commented out and don`t use.
Cause:
User for provider on ProxMox VE cluster has no rights for configure USB passthrought. USB configuration is available only to the user root
. This is a limitation ProxMox VE.
Therefore, we set it up manually and ignore USB in config provider.
Uncommenting the block gives the same error.
Block with USB commented out and don`t use. Therefore, we set it up manually and ignore USB in config provider. Uncommenting the block gives the same error.
Seems something you are doing wrong... Unfortunately, without all the details I can’t say what exactly is wrong.
User for provider on ProxMox VE cluster has no rights for configure USB passthrought. USB configuration is available only to the user root. This is a limitation ProxMox VE.
As for this, check and try out this Proxmox Forum thread:
Only root@pam is now allowed to clone and restore guests with passed through PCI/USB devices that are not using the new mapping feature. To allow regular users to clone and restore with PCI/USB devices, create a mapping and give the user 'Mapping.Use' on that.
You can try as well use other Mapping privileges for that:
Mapping.Audit: view resource mappings
Mapping.Modify: manage resource mappings
Mapping.Use: use resource mappings
@maksimsamt Thanks for the information about the directive Mapping.Use
!
I'll try it and post the results.
Hello. After updating from version 3.0.1-rc1 to version 3.0.1-rc3, I encountered the same error for VMs to which I added PCI-e device mapping. How can I add an ignore rule for devices that I added myself?
I tried this one:
lifecycle {
ignore_changes = [
hostpci,
]
}
But the error is stilling.
I am getting the same error when using usb
like it's documented:
usb {
host = "051d:0002"
usb3 = false
}
Did some bisecting of the plugin and is the commit that introduced the change: https://github.com/Telmate/terraform-provider-proxmox/commit/819869a1c9f337fc940f1b97613d7b5d8fd11c9c. I don't know the code, maybe before the change the data from the proxmox API was just ignored and never put into the state because it didn't/doesn't match the expected format?
Hello, any news on that? I've created machine using root account for authentication everything worked as expected including usb creation but after that i can no longer run terraform refresh
or terraform plan
because of the same error. I've already tried adding different combinations to ignore_changes
block but none of them is working
Same here:
Error: Invalid address to set: []string{"usb", "0", "id"}
Does not matter if I add the USB passthrough through the webui or the TF itself.
@maksimsamt
Block with USB commented out and don`t use. Therefore, we set it up manually and ignore USB in config provider. Uncommenting the block gives the same error.
Seems something you are doing wrong... Unfortunately, without all the details I can’t say what exactly is wrong.
User for provider on ProxMox VE cluster has no rights for configure USB passthrought. USB configuration is available only to the user root. This is a limitation ProxMox VE.
As for this, check and try out this Proxmox Forum thread:
Only root@pam is now allowed to clone and restore guests with passed through PCI/USB devices that are not using the new mapping feature. To allow regular users to clone and restore with PCI/USB devices, create a mapping and give the user 'Mapping.Use' on that.
You can try as well use other Mapping privileges for that:
Mapping.Audit: view resource mappings Mapping.Modify: manage resource mappings Mapping.Use: use resource mappings
Hi! Sorry for the long wait.
Adding user for terraform provirder access:
Mapping.Audit: view resource mappings
Mapping.Modify: manage resource mappings
Mapping.Use: use resource mappings
didn't help.
Regardless of whether the block is commented out or not.
And also whether usb
is added to ignore
or not.
Tried to manually clear the USB information in the .tfstate
file.
The error persists and Terraform cannot refresh
.
@lucian-tx fixed a similar issue for the hostpci config. I applied the same path to usb devices in #1077, which fixes this issue for me.
@lucian-tx fixed a similar issue for the hostpci config. I applied the same path to usb devices in #1077, which fixes this issue for me.
Thanks, this fixed it for me.
I just tried it and I don't get this error anymore:
Error: Invalid address to set: []string{"usb", "0", "id"}
The only change I'm aware of is updating the proxmox terraform provider to version 3.0.1-rc4
Hi, migrates from
3.0.1-rc1
to3.0.1-rc2
and fix error with USB passthrough device.Proxmox VE cluster with version nodes: 8.0.4 and 8.2.2 Terraform - 1.8.4
USB manually config in VM by root and fix in
.tfstate
byterraform refresh
. Ignore changes in state VM from provider by this:In new version 3.0.1-rc2 error by
terraform refresh
orterraform plan
: