Giter VIP home page Giter VIP logo

vmupdown's Introduction

vmupdown

A simple web gui for controlling Proxmox VMs & nodes. Specifically for the use case of using a headless proxmox server as a workstation with multiple VMs sharing a single GPU and switching between them as required.

screenshot-1

It uses a Flask and Proxmoxer (https://github.com/proxmoxer/proxmoxer) to monitor status and control powering on/off VMs or nodes. It also includes basic detection of conflicts in VFIO pcie devices shared between VMs.

The default credentials are admin:admin. The password can be changed once logged in.

NB - Various assumptions on deployment platform are made in the below instructions, the below relates to Ubuntu.

Configuration:

  • Create a proxmox pam user "vmupdown"
  • Create a 'Role' in proxmox called 'vmupdown' and give it the following privileges:
    Sys.PowerMgmt, VM.Audit, VM.PowerMgmt
  • Create 'Permissions' for both /nodes and /vms for the user and role above.
  • Create an API Token for the vmupdown user. Disable 'Privilege Separation'. Note it down.
  • Fill out the variables in config.py with values appropriate to your setup, for example:
token = "31dc4f09-871e-44eb-9392-4e38b63aab2b"
nodes = {
        "qproxmox-01": {"ip": "192.168.20.2", "mac": "d6:09:6b:f3:72:ec", "status": ""},
        "qproxmox-02": {"ip": "192.168.20.3", "mac": "d6:09:6b:f3:72:ec", "status": ""}
        }
sharedgpu = "0000:0f:00"

Docker Deployment

Example docker compose file:

version: '3.3'
services:
    vmupdown:
        container_name: vmupdown
        ports:
            - '8080:8000'
        volumes:
            - '/path/to/vmupdown/config.py:/var/www/html/vmupdown/config/config.py'
            - '/path/to/vmupdown/db:/var/www/html/vmupdown/db'
        restart: unless-stopped
        image: lupinelab/vmupdown

Create the db folder and set permissions. eg:

mkdir /path/to/vmupdown/db
chown 33:33 /path/to/vmupdown/db

Run the container:

docker-compose up -d

Manual Deployment

Requirements:

APT:

apt install apache2 libapache2-mod-wsgi-py3 wakeonlan python3-pip

PIP:

pip install flask proxmoxer requests

Example Installation:

  • Configure apache2 to listen on port 8080 in /etc/apache2/ports.conf:
...
Listen 8080
...
  • Copy vmupdown folder into /var/www/html and adjust permissions:
cp -R vmupdown /var/www/html/
chown -R www-data:www-data /var/www/html/vmupdown
chmod +x /var/www/html/vmupdown/vmupdown.*
  • Copy vmupdown.conf to /etc/apache2/sites-available and then enable site:
a2ensite vmupdown
  • Reload apache:
systemctl reload apache2

vmupdown's People

Contributors

lupinelab avatar

Stargazers

Eraj avatar Thomas B. avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hermesthecat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.