Comments (5)
Adding this type of filtering configuration at the resource level wouldn't be appropriate for the provider. Please keep in mind that the goal of the Terraform/OpenTofu provider is to manage the remote state of the resource in a declarative way. The template defines what state you want the resource to be in, and the provider brings the resource to that defined state by creating or updating it as necessary.
There isn't much room for functionality outside of state management; essentially, everything the provider operates with must be somehow reflected in that resource state. For example, ipv4_addresses is an "output" attribute of the resource, filled by the provider when it reads information back from the VM. When the provider does that, only the remote state is available to it. This means the filter value, like "^(lo|docker|veth).*", must be somehow available in that remote state so it can be read and applied to the values of the ipv4_addresses list. But where to store them on PVE?
Alternative to that would be having the VM interface filters as part of the provider configuration, which is global and available at any time to all resources and datasources. However, it doesn't sound very appealing to me. A resource-specific config leaking out all the way to the global provider settings, it seems more like a hack than a proper fix for the problem.
The solution proposed in the issue description seems like a good option to me. The only improvement I can think of is perhaps implementing some specific filtering functions in the provider to handle those interface lists with less verbosity. However, this is a new API feature, available only in Terraform 1.8+ and not yet supported by OpenToFu. So, it's unlikely to be worked on any time soon.
from terraform-provider-proxmox.
Actually was thinking about the same functionality just a few days ago. I'm using outputs to show what IPs my VMs received from DHCP so when i saw a few of them showing gazillion of addresses from docker interfaces i was really sad.
Yes, what Proxmox GUI shows is basically enumeration of interfaces which were found by qemu-guest-agent. But i think some kind of filtration should (could?) be implemented on the provider side.
Not sure that i want to use a local module for that, but i'll think about adding something like that in outputs. Thanks for an example, @xoxys :)
from terraform-provider-proxmox.
This list is actually the same as the one returned in the VM summary on Proxmox VE web interface.
I'm not sure if this is ideal to filter out the interfaces in the ressource attributes since this could be relevant information depending on the situation.
from terraform-provider-proxmox.
Users that don't want to filter out anything just don't set a filter. Users that don't care about some interfaces should still have the possibility to opt-in by setting a provider config.
from terraform-provider-proxmox.
Thanks for your detailed reply. Thats fine Ill just keep using my current local approach then.
from terraform-provider-proxmox.
Related Issues (20)
- Cannot use cloudinit with initialization HOT 1
- Disk resize for VM not updated in terraform state HOT 14
- CD-ROM is not attached when creating a VM from scratch HOT 1
- Not sure why I have these issue HOT 2
- Cannot Set Disk Passthrough Serial
- Terraform unable to set CIUPGRADE config, regardless of running as root or not, using API token HOT 3
- proxmox_virtual_environment_user_token is not idempotent if no expiration_date is set HOT 1
- Idempotence issues in "proxmox_virtual_environment_vm" after cloning from another VM HOT 3
- Support provider_override HOT 4
- Document which is the latest compatible version for Proxmox 7.4 HOT 1
- Align Defaults with Proxmox Defaults HOT 1
- Error: unknown time zone HOT 3
- HTTP 596 response Connection timed out in proxmox_virtual_environment_file HOT 1
- disk resize fails: error waiting for VM disk resize: All attempts fail: HOT 2
- Allow VM clone to pass with warnings HOT 3
- Missing "none" and "VirGL" to VGA type in proxmox_vm proxmox_virtual_environment_vm HOT 1
- Container volume mount backup flag defaults to true in provider but false in Proxmox, so volume mounts are created with the flag missing. HOT 1
- 0.58.0 VM resource: `expected clipboard to be one of ["vnc"], got .` HOT 1
- Selection of the components you want to be hotpluggable HOT 1
- error creating clonr vm linked clone HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-proxmox.