Switch among Guest VMs organized by Resource Pool
Project description
Proxmox PCI Switcher
Switch among Guest VMs organized by Resource Pool
.
main features:
ONE
GPU card,N
OS (at once)- Guest VM command client
- Handler power off
- Reset framebuffer
TOC
Proxmox Configuration
Create Resource Pool
Assign Guest VM
Install Proxmox Snippet
curl https://raw.githubusercontent.com/rosineygp/proxmox-pci-switcher/master/src/snippets/pci-group-switcher.sh > pci-group-switcher.sh
# set execution permission
chmod +x pci-group-switcher.sh
# move for your snippets <storage>/<folder>
Proxmox Config
Snippet Variables
NAME | Default | Description |
---|---|---|
_POOL_NAME * | <auto_discovery> | The name of Resource Pool |
_SHUTDOWN_TIMEOUT | 300 | Checking if resource was released (Current VM Running is down) |
_RESET_GPU_FRAMEBUFFER | true | Reset GPU framebuffer |
All variables must be changed in
pci-group-switcher.sh
at proxmox ve.
_POOL_NAME
* By default it will scan for VMID in all Resource Pools, in case of long delays replace function call to Resource Pool name (eg. desktop, gpu, ...).
Assign VM to Snippet
qm set <vmid> -hookscript <storage>:snippets/pci-group-switcher.sh
After proxmox configuration is possible to switch using proxmox api or web interface.
Guest Client Switcher
- requirements: python 3
git clone https://github.com/rosineygp/proxmox-pci-switcher.git ~/.proxmox-pci-switcher
cd ~/.proxmox-pci-switcher
pip3 install -r requirements.txt
# create config folder or using passing parameter -c
mkdir -p ~/.config/proxmox-pci-switcher
# copy or create config.yaml
cp ~/.proxmox-pci-switcher/src/client/config.yaml .config/proxmox-pci-switcher/config.yaml
# edit config file
- config.yaml
# default location: ~/.config/proxmox-pci-switcher/config.yaml
proxmox:
host: '<ip or dns>'
user: '<user>@<method>'
password: '<password>'
verify_ssl: false
pools:
- desktop
- gpu-nvidia
- gpu-amd
List Resources
python ~/.proxmox-pci-switcher/src/client/proxmox-pci-switcher.py list
pool(s) vmid name status type
---------- ------ --------------- -------- ------
desktop 119 catalina stopped qemu
desktop 116 win10-desktop stopped qemu
desktop 117 mini-desktop stopped qemu
desktop 103 u20-desktop running qemu
desktop 115 u20-srv-desktop stopped qemu
Switch Resource
# run command directly
python ~/.proxmox-pci-switcher/src/client/proxmox-pci-switcher.py switch win10-desktop
# create a alias for better experience
alias windows="python ~/.proxmox-pci-switcher/src/client/proxmox-pci-switcher.py switch win10-desktop"
# and just run
windows
For windows is possible create a shortcut for better experience.
Target: C:\Users\<user>\AppData\Local\Programs\Python\Python39\python.exe C:\Users\<user>\Projects\proxmox-pci-switcher\src\client\proxmox-pci-switcher.py switch ubuntu -c C:\Users\<user>\Projects\proxmox-pci-switcher\src\client\config.yaml
Start in: C:\Users\<user>\AppData\Local\Programs\Python\Python39
For windows config.yml is located at:
C:\\Users\\<user>\\AppData\\Local\\proxmox-pci-switcher\\config.yaml
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for proxmox-pci-switcher-0.10.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | febd693c20092e22b3eb45a55eddffc81093c537edf79bc4654f60d21a98d7fd |
|
MD5 | e823539f2fb53e1d8551f214431f0cf5 |
|
BLAKE2b-256 | abb13ff5b14cff1f3f12192201331e0320ba278828448657eeb8f0247037cfe2 |
Hashes for proxmox_pci_switcher-0.10.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc03f43c3f0a14051aef10b33f35689b1104c03d3ff69eb37fb9899794ecf3c9 |
|
MD5 | 10a75c9515356a56315cc8999496bf0c |
|
BLAKE2b-256 | 2cff0effa3bfbb7dec4c7ee13509740272ce7ef7034e02952c1bcc07d9ce3a07 |