terraform-provider-proxmox: Can't Use API Token/Secret
Hi, I can’t seem to use API tokens/secret, though the user/password works.
No matter what combination I tried or gave all the permissions , I still get the following:
│ Error: user does not exist or has insufficient permissions on proxmox: terraform-prov@pve!terraform-provisioner
│
│ with provider["registry.terraform.io/telmate/proxmox"],
│ on main.tf line 10, in provider "proxmox":
│ 10: provider "proxmox" {
│
Can someone verify that this is working with the latest provider? If it is working for you, can you update the example to also show how to add secrets and tokens, in case I’m doing something wrong?
Thanks!
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 6
- Comments: 33 (1 by maintainers)
I just tried upgrading the proxmox provider from 2.9.11 to 2.9.13 and am getting the same error when trying to use tokens. Rolling back to 2.9.11 resolves the issue, so I suspect something breaks as part of the upgrade. 😦
I have tested it. Getting now this:
The user has been created as written in the documentation. In the UI I see this:
Toggling the checkbox doesn’t change the error message.
I’m feeding these credentials via variables plus tfvars file (manual test) or var-flags (pipeline runs).
Switching back to 2.9.11 makes the setup work again.
Should be fixed in 2.9.14
Merged request : #649
@mleone87 it was my mistake. It was not enough permissions for new version of provider. I needed just grant privileges for role as describe in current version of documentation and problem has been solved.
Can confirm this seems to happen when I upgrade to
2.9.13as well, I’ve tried with PVE users, PAM users and the root user…The additional permissions needed are: Sys.Audit, Sys.Modify, Sys.Console. There is already an open issue about this being more permissions than is actually needed to deploy a VM. 784. I’ll switch to that ticket to try to get these documented in the Creating the user and role for terraform section of the documentation. Hopefully this addresses @JamborJan’s question about what permissions are required.
The other breaking change that was introduced by 2.9.13 is related to the disk -> backup field. The field was changed from a number to a boolean, the default was changed from false to true, and the old values from your terraform.tfstate file are now rejected instead of being converted to the correct type. See issue 702 for a workaround of manually editing each of your terraform.tfstate files.
In my opinion, after #784 is resolved (e.g. the additional permissions are either removed, or at least documented), this ticket should be able to be closed.
I’ve been locked in at v2.9.11 since February to work around this issue. If it’s expected to be fixed in the latest release, I can upgrade and re-test so we can get one step closer to closing or resolving the issue.