Installation
1. Install the extension\
-
Install the extension
In the admin panel open /admin/extensions/extension?tab=installable upload the Proxmox Auto Stock and install/enable it.
The bundled migrations run automatically. -
Configure global defaults in Admin → Extensions → Auto Stock:
Setting Description Enable scheduled auto stock runs Turns on the Laravel scheduled job. Schedule interval How frequently the scheduler should recalc stock (5 min – 24 hr). Enable automation by default for new locations If on, newly created locations start with automation enabled. Default RAM/CPU/Disk reserve % Safety buffers applied when a location has no custom reserves. Default minimum stock per product Floor value for automation (0 disables). Capacity factor Which resource determines remaining capacity ( all,ram,cpu,disk). -
Create/verify Proxmox locations and nodes
Ensure each location has at least one node with memory, CPU, and disk limits set (0 means unlimited). -
Enable automation per location
Navigate to Admin → Extensions → Proxmox Auto Stock.
Each location card shows an “Enable Automation” toggle, reserve percentages, and capacity metrics. -
Set location reserves (optional)
Adjust RAM/CPU/Disk reserve percentages, then click Save Reserves.
How Automation Works
- The scheduler (or a manual trigger) calls
proxmox:auto-stock. - For each enabled location the service:
- Collects node totals and existing usage.
- Applies reserves and the selected capacity factor.
- Calculates how many additional services can be provisioned for each product.
- Updates
products.stockand logs the change inext_proxmox_auto_stock_logs.
If a product is marked as manually overridden in the settings it is skipped unless you pass --force.
Running Jobs Manually
From the Dashboard
- Run Now / Demo Run (per location) – buttons on each card.
- Run Now (All Locations) / Demo Run (All Locations) – global buttons at the top of the page.
Demo runs preview adjustments without changing stock.
Using Artisan
php artisan proxmox:auto-stock {location_id?} \
[--dry] \
[--force] \
[--trigger=manual]location_id– optional; omit to run against every location.--dry– preview without writing to the database.--force– process even if automation is disabled or a product is manually overridden.--trigger– text that appears in the log (defaults tomanual).
Scheduled runs execute the same command with --trigger=scheduled.
Monitoring & Logs
-
Recent runs list – bottom of the dashboard shows the last 25 entries with per-product changes.
-
Database table – query
ext_proxmox_auto_stock_logsfor historical data:mysql -u root -p paymenter \ -e 'SELECT `trigger`, status, message, created_at FROM ext_proxmox_auto_stock_logs ORDER BY created_at DESC LIMIT 20;' -
Snapshots – each successful run stores capacity data in
ext_proxmox_auto_stock_snapshots.
Troubleshooting
| Symptom | Fix |
|---|---|
| Dashboard says “Scheduler disabled. Runs occur on demand only.” | Enable the scheduler in extension settings or verify the cron entry. |
No scheduled entries in the log | Ensure locations are enabled and cron is executing schedule:run. Lower the interval to 1 minute for quick verification. |
| Artisan command “namespace not defined” | Update to the latest version of the extension (command registration added). |
Job fails with “There are no commands defined in the app namespace.” | Remove or reintroduce legacy scheduled commands (e.g., app:fetch-emails) before the scheduler reaches Auto Stock. |
| Stock does not change | The capacity factor/reserve combination may leave zero available headroom. Adjust reserves, change the capacity factor, or review product resource requirements. |
Tips
- Use Demo Run after adjusting reserves to understand the impact before committing changes.
- For large environments consider enabling notifications or webhooks based on the auto stock log table.
- Keep Proxmox node limits accurate—set realistic memory, CPU, and disk values so capacity calculations are meaningful.