# Re-enable the terraform user
pveum user modify terraform@pve --enable 1# Verify the user is enabled
pveum user list | grep terraform
Option 2: Via Direct Config Edit
If CLI doesn't work, edit the configuration directly:
# Edit the user configuration
nano /etc/pve/user.cfg
Find the line:
user:terraform@pve:0:0:::...
Change the first 0 to 1:
user:terraform@pve:1:0:::...
Then restart the relevant services:
systemctl restart pvedaemon pveproxy
Option 3: Via Web UI
Navigate to Datacenter → Permissions → Users
Select the terraform@pve user
Click Edit
Check the Enabled checkbox
Click OK
Verification
Test the API token after re-enabling:
# Test with curl
curl -k -H "Authorization: PVEAPIToken=terraform@pve!terraform_token=YOUR_TOKEN_SECRET"\
https://pve01.taila5ad8.ts.net:8006/api2/json/version
# Or test Terraformcd terraform/prod
terraform plan
Prevention
Consider documenting the Proxmox user configuration in this repository. Add a file docs/proxmox-setup.md with:
Required User Configuration
# Create terraform user (if not exists)
pveum user add terraform@pve --comment "Terraform automation user"# Create API token (save the secret!)
pveum user token add terraform@pve terraform_token --privsep 0# Assign Administrator role
pveum acl modify / --user terraform@pve --role Administrator
# Verify configuration
pveum user list
pveum user token list terraform@pve
## 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
- Terraform `plan` or `apply` commands fail with authentication errors
- API calls return `401 Unauthorized` or `403 Permission check failed (user 'username@pve' is disabled)`
- The user appears disabled in the Proxmox web UI under **Datacenter → Permissions → Users**
### Root Cause
During the Proxmox 9.1 upgrade, user accounts may have been disabled. This is controlled by the `enable` flag in `/etc/pve/user.cfg`.
The user configuration line format is:
```
user:<username>@<realm>:<enable>:<expire>:<firstname>:<lastname>:<email>:<comment>:<keys>
```
Where `<enable>` is `1` (enabled) or `0` (disabled).
---
## Solution
### Option 1: Via CLI (Recommended)
SSH into the Proxmox host and run:
```bash
# Re-enable the terraform user
pveum user modify terraform@pve --enable 1
# Verify the user is enabled
pveum user list | grep terraform
```
### Option 2: Via Direct Config Edit
If CLI doesn't work, edit the configuration directly:
```bash
# Edit the user configuration
nano /etc/pve/user.cfg
```
Find the line:
```
user:terraform@pve:0:0:::...
```
Change the first `0` to `1`:
```
user:terraform@pve:1:0:::...
```
Then restart the relevant services:
```bash
systemctl restart pvedaemon pveproxy
```
### Option 3: Via Web UI
1. Navigate to **Datacenter → Permissions → Users**
2. Select the `terraform@pve` user
3. Click **Edit**
4. Check the **Enabled** checkbox
5. Click **OK**
---
## Verification
Test the API token after re-enabling:
```bash
# Test with curl
curl -k -H "Authorization: PVEAPIToken=terraform@pve!terraform_token=YOUR_TOKEN_SECRET" \
https://pve01.taila5ad8.ts.net:8006/api2/json/version
# Or test Terraform
cd terraform/prod
terraform plan
```
---
## Prevention
Consider documenting the Proxmox user configuration in this repository. Add a file `docs/proxmox-setup.md` with:
### Required User Configuration
```bash
# Create terraform user (if not exists)
pveum user add terraform@pve --comment "Terraform automation user"
# Create API token (save the secret!)
pveum user token add terraform@pve terraform_token --privsep 0
# Assign Administrator role
pveum acl modify / --user terraform@pve --role Administrator
# Verify configuration
pveum user list
pveum user token list terraform@pve
```
### Required Permissions
The `terraform@pve` user needs at minimum:
- `Administrator` role on `/` for full VM management
- Or a custom role with these privileges:
- `Datastore.AllocateSpace`
- `Datastore.Audit`
- `VM.Allocate`
- `VM.Audit`
- `VM.Clone`
- `VM.Config.*`
- `VM.Console`
- `VM.Monitor`
- `VM.PowerMgmt`
- `Sys.Audit`
- `Sys.Modify` (for cloud-init snippets)
---
## Related
- Proxmox User Management: https://pve.proxmox.com/wiki/User_Management
- Proxmox API Tokens: https://pve.proxmox.com/wiki/Proxmox_VE_API#API_Tokens
- bpg/proxmox Terraform Provider: https://registry.terraform.io/providers/bpg/proxmox/latest/docs
---
**Labels:** `bug`, `proxmox`, `documentation`
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.