Skip to main content

Switch among Guest VMs organized by Resource Pool

Project description

logo

Proxmox PCI Switcher

GitHub all releases PyPI - Downloads Quality Gate Status

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

Resource Pool

Assign Guest VM

Assign Guest VM

Install Proxmox Snippet

curl -fsSL https://github.com/rosineygp/proxmox-pci-switcher/releases/latest/download/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
pip install proxmox-pci-switcher

# create config folder
mkdir -p ~/.config/proxmox-pci-switcher/

# create config file
cat <<EOF > ~/.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>'

EOF

Edit config.yaml with your proxmox credentials and pools.

List Resources

proxmox-pci-switcher 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
proxmox-pci-switcher switch win10-desktop

# create a alias for better experience
alias windows="proxmox-pci-switcher switch win10-desktop"

# and just run
windows

For windows is possible create a shortcut for better experience.

Windows Shortcut

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proxmox-pci-switcher-0.10.13.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

proxmox_pci_switcher-0.10.13-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page