Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In v3.0.1-rc6 release network block macaddr value converts from upper to lower case #1182

Closed
maksimsamt opened this issue Nov 26, 2024 · 17 comments · Fixed by #1244
Closed
Assignees
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented resource/qemu Issue or PR related to Qemu resource type/bug

Comments

@maksimsamt
Copy link
Contributor

Network Block

Seems it is related with:
#1139

Adding resources:

      + network {
          + bridge    = "vmbr0"
          + firewall  = false
          + id        = 0
          + link_down = false
          + macaddr   = "AC:15:11:99:D5:11"
          + model     = "virtio"
          + tag       = 1111
        }

Removing resources:

      - network {
          - bridge    = "vmbr0" -> null
          - firewall  = false -> null
          - id        = 0 -> null
          - link_down = false -> null
          - macaddr   = "ac:15:11:99:d5:11" -> null
          - model     = "virtio" -> null
          - mtu       = 0 -> null
          - queues    = 0 -> null
          - rate      = 0 -> null
          - tag       = 1111 -> null
        }

I have some macaddr manipulations after VM provisioning (with provisioner "local-exec") and due to this change this action fails:

│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for terraform_data.* to include new values learned so far during apply, provider "terraform.io/builtin/terraform" produced an invalid new value for .triggers_replace[0]: was
│ cty.StringVal("AC:15:11:99:D5:11"), but now cty.StringVal("ac:15:11:99:d5:11").
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
@Tinyblargon
Copy link
Collaborator

@maksimsamt this was done on purpose to enforce the same case pve uses when it generates a mac address from the ui. As switching the case of the mac address counts as disconnecting and reconnecting the network interface.

@Tinyblargon
Copy link
Collaborator

Tinyblargon commented Nov 26, 2024

Also, all mac address formats are valid, even octal as we use the binary representation of the mac address.

Would using lower-case mac addresses in your be a solution for you?

Personally prefer upper-case mac address, so could make it default to uppercase.

@maksimsamt
Copy link
Contributor Author

@Tinyblargon,

Would using lower-case mac addresses in your be a solution for you?

Yes, already changed in my solution logic to use lower case values.

Personally prefer upper-case mac address, so could make it default to uppercase.

The same to me, upper-case mac address is more readable.

@Tinyblargon
Copy link
Collaborator

@maksimsamt gonna try to figure out if i can preserve the format when returning it.

I'll add it to RC7.

@Tinyblargon Tinyblargon added type/bug issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented resource/qemu Issue or PR related to Qemu resource labels Nov 26, 2024
Copy link

This issue is stale because it has been open for 60 days with no activity. Please update the provider to the latest version and, in the issue persist, provide full configuration and debug logs

@Tinyblargon
Copy link
Collaborator

@maksimsamt would you be able to test #1244? It should preserve the case/syntax of the mac-address.

@Tinyblargon Tinyblargon self-assigned this Feb 4, 2025
@maksimsamt
Copy link
Contributor Author

@maksimsamt would you be able to test #1244? It should preserve the case/syntax of the mac-address.

@Tinyblargon ,
Unfortunately with new changes (newer than rc6) I can't test, there is permission issue:

Error: 403 Permission check failed

In rc6 this workaround worked:
#784 (comment)

Modify minimumPermissions as per below example (keep only Sys.Audit permission)...

This version is no longer working with this workaround:
https://github.com/Tinyblargon/terraform-provider-proxmox/tree/1182

@Tinyblargon
Copy link
Collaborator

@maksimsamt not sure what is causing the permission issue as we haven't added any functionality that requires the interaction with PVE to change.

@Tinyblargon
Copy link
Collaborator

@maksimsamt could you check if the permission issue already exists in 7e66709 as this would really narrow down the search.

@maksimsamt
Copy link
Contributor Author

@maksimsamt could you check if the permission issue already exists in 7e66709 as this would really narrow down the search.

for what? when 3.0.1-rc6 works fine

@Tinyblargon
Copy link
Collaborator

@maksimsamt I'm trying to figure out why your workaround doesn't work anymore. The commit i mentioned adds a lot of code that functionality doesn't change anything. It would help a lot in trying to figure out if your workaround broke before or after that commit.

@maksimsamt
Copy link
Contributor Author

@Tinyblargon,
Sorry, I thought this commit 7e66709 was before rc6.
I just checked and this commit doesn't have this permission issue.

@Tinyblargon
Copy link
Collaborator

@maksimsamt thanks for testing. :)

@maksimsamt
Copy link
Contributor Author

maksimsamt commented Feb 4, 2025

@Tinyblargon ,
This latest commit 47d9e55 introduces this issue.

This previous 364b3ba works fine.

@Tinyblargon
Copy link
Collaborator

@maksimsamt the only meaningful change is on line 788 in the qemu code. We used to set pool through the vmref, but now through the vm config. As far as I'm aware should that do the exact same. Gonna check upstream what is causing this.

@maksimsamt
Copy link
Contributor Author

@Tinyblargon ,
So, did test for:

364b3ba
+
#1244

The test was successful.
Now the macaddr value remains unchanged.

@Tinyblargon
Copy link
Collaborator

@maksimsamt, thank you for verifying and all the help with the permission issue. I know what to revert, just nor sure yet why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented resource/qemu Issue or PR related to Qemu resource type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants