Feature Request: Userscripts in webUI

Dunuin

Distinguished Member
Jun 30, 2020
14,346
4,210
243
Germany
Hi,

Sometimes I really wish there would be some user-customizable buttons in the webUI. I do a lot of scripting to automate my PVE server but it is quite annoying to run all that scripts though the console. It would be so much more comfortable, if I could run these scripts by pressing a button in the webUI.
We already got hook scripts that can be placed in the snippets storage, so PVE tasks can make use of hooks for automation. My idea would be that we could place scripts in the snippets storage and call them something like "userscript_SomeName.bash" or "userscript_SomeOtherName.sh". PVE could then scan the snippet storage for files starting with "userscript_" to see if there are userscripts present and if they are, PVE could show some buttons in the webUI to make those scripts executable.
The webUI header got a lot of empty space. Would be really nice if they could show up there like this:
suerscripts.png

I know that this wouldn't be that easy to implement, as you probably also would need to check permissions, add new privileges so it could be limited which users are allowed to run which scripts and so on. Maybe parsing of scripts for metadata so the script could specify a name that should be shown in the webUI, needed privilege and similar. Maybe different script states or scripts that allow arguments so running script for a node would pass the node name to the script and so on...

But I would really like to see that. I got so much tasks I need to run scripts for:
  • mounting filesystems
  • unlocking encrypted pools/partitions
  • bulk starting/stopping guests in an specific order
  • disabling/enabling multiple storages at once
  • booting/stopping other servers though IPMI
  • unlocking encryption of remote server
  • bulk manual backups
  • switching between performance modes (underclocking CPU and changing CPU governor to save electricity when no running VMs actually needs that much power)
  • ...
Would be so much more convenient.

Does such a feature request already exist in the bugtracker or should I create a new one?
Someone else finds this useful or am I the only person here that heavily cusatomizes its PVE nodes?
 
Last edited:
Our solution to this problem is to have a special VM that does all the clusterwide automation for us with scripts similar to your's.
Yes, got an orchestrator VM on my todo list and maybe I will even embed my webUIs in an iframe so I can add a custom tool bar at the top of the webUI to easily interact with the orchestrator VM to tell it to do stuff on the PVE nodes.
 
  • Like
Reactions: BassT
Hello I've just seen your reply @Dunuin, was your idea adding an iframe to the proxmox GUI? I've been looking for that for a while because I want to make a VM that uses Ansible to create VM on Proxmox and I was about to make a web page with a form for that but i really wanted to make the form appear on the proxmox GUI instead of using the virtual machine itself.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!