[BUG] Proxmox 9.1 upgrade: Terraform API user disabled #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Description
After upgrading to Proxmox VE 9.1, the Terraform API user has been disabled, preventing Terraform from authenticating with the Proxmox API.
Symptoms
planorapplycommands fail with authentication errors401 Unauthorizedor403 Permission check failed (user 'username@pve' is disabled)Root Cause
During the Proxmox 9.1 upgrade, user accounts may have been disabled. This is controlled by the
enableflag in/etc/pve/user.cfg.The user configuration line format is:
Where
<enable>is1(enabled) or0(disabled).Solution
Option 1: Via CLI (Recommended)
SSH into the Proxmox host and run:
Option 2: Via Direct Config Edit
If CLI doesn't work, edit the configuration directly:
Find the line:
Change the first
0to1:Then restart the relevant services:
Option 3: Via Web UI
terraform@pveuserVerification
Test the API token after re-enabling:
Prevention
Consider documenting the Proxmox user configuration in this repository. Add a file
docs/proxmox-setup.mdwith:Required User Configuration
Required Permissions
The
terraform@pveuser needs at minimum:Administratorrole on/for full VM managementDatastore.AllocateSpaceDatastore.AuditVM.AllocateVM.AuditVM.CloneVM.Config.*VM.ConsoleVM.MonitorVM.PowerMgmtSys.AuditSys.Modify(for cloud-init snippets)Related
Labels:
bug,proxmox,documentationProcédure complète via l'interface Web Proxmox 9.1
Étape 1 : Créer le rôle Terraform
TerraformRoleDatastore :
Datastore.AllocateDatastore.AllocateSpaceDatastore.AllocateTemplateDatastore.AuditSystem :
Sys.AuditSys.ConsoleSys.ModifyVM :
VM.AllocateVM.AuditVM.CloneVM.Config.CDROMVM.Config.CloudinitVM.Config.CPUVM.Config.DiskVM.Config.HWTypeVM.Config.MemoryVM.Config.NetworkVM.Config.OptionsVM.ConsoleVM.MigrateVM.PowerMgmtVM.SnapshotVM.Snapshot.RollbackPool & SDN :
Pool.AllocatePool.AuditSDN.UseÉtape 2 : Créer l'utilisateur Terraform
terraformProxmox VE authentication server(pve)neverTerraform automation userÉtape 3 : Créer le Token API
terraform@pveterraform_tokenneverLe format du token sera :
terraform@pve!terraform_token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxÉtape 4 : Assigner les permissions (ACL)
/(pour tout le datacenter)terraform@pveTerraformRoleÉtape 5 : Configurer l'accès SSH (requis par bpg/proxmox)
Le provider
bpg/proxmoxutilise SSH pour certaines opérations (upload de fichiers cloud-init, etc.).Sur le serveur Proxmox :
Étape 6 : Mettre à jour terraform.tfvars
Étape 7 : Vérification
Résumé des privilèges pour Proxmox 9.1
Allocate,AllocateSpace,AllocateTemplate,AuditAudit,Console,ModifyAllocate,Audit,Clone,Config.*,Console,Migrate,PowerMgmt,Snapshot,Snapshot.RollbackAllocate,AuditUse📝 Documentation créée
Branch :
feature/docs-proxmox-setupFichier :
docs/proxmox-setup.mdLa documentation inclut :
TerraformRole(pas de rôle Administrator)Prêt pour review et merge dans
dev.