v0.1.7

Environment Variables

Last updated


This page lists every environment variable QemuRun-pve reads, its default, and what actually happens when it is unset.
At startup godotenv loads .env from the working directory; when the file is missing the server only logs a warning and reads the process environment. Startup checks only PORT and GATEWAY; every other variable is read when first used.

Required


VariableExamplePurposeWhen unset
PORT8080API listen port; also part of the init script URLStartup fails
GATEWAY192.168.0.1VM gateway; its first three octets form the VM IP prefixStartup fails
MAIN_NODEpve1Name of the node hosting the serviceNo VM operation can resolve where to run; SSH initialization cannot build the script URL
NODE_<name>NODE_pve2=192.168.0.12Management IP of every node, main node includedVMs on that node cannot be controlled
ALLOW_IPS192.168.0.10,192.168.0.20Comma-separated client IPs allowed to call mutating endpoints; 0.0.0.0 allows allAn empty string splits into [""], so every mutating call is denied
ASSIGN_STORAGElocal-zfsStorage pool for imported disks and cloud-initInstall fails at "checking storage pool"

Optional


VariableDefaultPurpose
ASSIGN_IP_START100Lower bound for auto-assigned VMIDs; 0 or below 100 becomes 100
ASSIGN_IP_END254Upper bound for auto-assigned VMIDs; 0 or above 254 becomes 254; swapped automatically when reversed
VM_MAX_CPUunlimitedvCPU cap at install time; larger requests are clamped
VM_MAX_RAMunlimitedMemory cap at install time (MB)
VM_MAX_DISKunlimitedDisk cap at install time (GB); values at or above it become the cap
VM_BALLOON_MINdisabledBalloon reserve (MB); see the rule below
VM_ROOT_PASSWORDscript defaultRoot password passed to the OS init script; when empty the script falls back to 0123456789

Numeric variables that fail to parse as integers are treated as unset.

Ballooning Rule


When VM_BALLOON_MIN is set, memory that meets one of these conditions also gets --numa 1 and --balloon:
Memory (MB)--balloon value
≥ 6553649152
≥ VM_BALLOON_MIN + 1024memory − VM_BALLOON_MIN
otherwisenot set

Install and 0 share this rule.

.env Example


  1. PORT=8080
  2. MAIN_NODE=pve1
  3. GATEWAY=192.168.0.1
  4. ALLOW_IPS=192.168.0.10,192.168.0.20
  5. NODE_pve1=192.168.0.11
  6. NODE_pve2=192.168.0.12
  7. NODE_pve3=192.168.0.13
  8. ASSIGN_IP_START=100
  9. ASSIGN_IP_END=254
  10. ASSIGN_STORAGE=local-zfs
  11. VM_MAX_CPU=32
  12. VM_MAX_DISK=64
  13. VM_MAX_RAM=32768
  14. VM_BALLOON_MIN=2048
  15. VM_ROOT_PASSWORD=

Other files in the working directory are covered in State Files.
中文