parent
e2fcc56ce0
commit
58a04d51b3
|
@ -10,6 +10,12 @@ Please refer to the README file, all install steps are described.
|
|||
|
||||
Not refered in the install, but you can pipx for you install.
|
||||
|
||||
# Networking
|
||||
|
||||
Hype use OpenvSwicth for interface and network creation. Common ovs command use in case of debgug.
|
||||
DNSMask, provided by LXC, is used to create DHCP for Interface configuration.
|
||||
|
||||
|
||||
# Storage
|
||||
|
||||
The server storage are in *{HYPE}/storage/*
|
||||
|
@ -99,3 +105,9 @@ SOLUTION 1 (on CLI): virsh reset VM_NAME
|
|||
|
||||
SOLUTION 2 (on CLI): virsh destroy VM_NAME (destroy the VM)
|
||||
|
||||
|
||||
|
||||
ERROR: libvirt: Storage Driver error : Requested operation is not valid: storage pool 'iso' is not active
|
||||
|
||||
SOLUTION (on CLI): pool = conn.storagePoolLookupByName('iso')
|
||||
pool.undefine()
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
- Now compatible with Windows Install, just take care to launch the driver before scanning disks.
|
||||
- Screenshot and VM live edition (RAM and vCPU until Max declared) added
|
||||
- Disk creation and resize
|
||||
|
||||
- Nework management (add,del network and interfaces)
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
|
@ -15,7 +15,8 @@ Server[Server] <----> LXC((LXC))
|
|||
|
||||
|
||||
|
||||
## Install requirements
|
||||
## Install requirements (Debian example
|
||||
For your safty you can also find the packages on pip or pipx
|
||||
|
||||
1 - Update and Install packages :
|
||||
|
||||
|
@ -24,6 +25,8 @@ apt-get update -y -qq
|
|||
apt-get install git lxc lxcfs lxc-templates qemu qemu-utils qemu-kvm virtinst bridge-utils virt-manager libvirt-daemon libvirt-daemon-system virt-viewer libvirt-clients libosinfo-bin websockify sqlite3 novnc
|
||||
apt-get install python3 python3-flask python3-flask-login python3-flask-sqlalchemy python3-requests python3-lxc python3-libvirt python3-psutil python3-werkzeug python3-websockify python3-novnc python3-flask-socketio python3-types-pyopenssl
|
||||
|
||||
apt-get install openvswitch-switch openvswitch-common
|
||||
|
||||
```
|
||||
|
||||
Clone the repository :
|
||||
|
@ -222,7 +225,6 @@ systemctl start hype.service
|
|||
|
||||
You can also change some configuration in the file *configuration.py* such as flask port, storage location...use it at your own risk.
|
||||
|
||||
|
||||
## Others
|
||||
|
||||
You can upload ISO directly from the interface.
|
||||
|
|
|
@ -44,18 +44,28 @@ def get_int(net_name):
|
|||
|
||||
def create_vswitch_int(net_int):
|
||||
cmd="ovs-vsctl add-br "+net_int
|
||||
subprocess.call(cmd, shell=True)
|
||||
out = subprocess.call(cmd, shell=True)
|
||||
if out2 != 0:
|
||||
raise Exception("Error on creating interface")
|
||||
|
||||
|
||||
def delete_network(net_name,net_int):
|
||||
cmd = "ovs-vsctl del-br "+net_int
|
||||
subprocess.call(cmd, shell=True)
|
||||
network = conn.networkLookupByName(net_name) #Lapin
|
||||
out = subprocess.call(cmd, shell=True)
|
||||
if out != 0:
|
||||
raise Exception("Error deleting interface")
|
||||
network = conn.networkLookupByName(net_name)
|
||||
network.destroy()
|
||||
network.undefine()
|
||||
cmd2="kill $(cat /run/dhypecp_"+net_int+".pid)"
|
||||
subprocess.call(cmd2, shell=True)
|
||||
out2 = subprocess.call(cmd2, shell=True)
|
||||
if out2 != 0:
|
||||
raise Exception("Error on killing DHCP process")
|
||||
cmd3="rm -f /run/dhypecp_"+net_int+".pid"
|
||||
subprocess.call(cmd3, shell=True)
|
||||
out3 = subprocess.call(cmd3, shell=True)
|
||||
if out3 != 0:
|
||||
raise Exception("Error on Deleting DHCP process")
|
||||
|
||||
|
||||
def create_network(net_name,net_int):
|
||||
create_vswitch_int(net_int)
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
flask
|
||||
flask_sqlalchemy
|
||||
flask_login
|
||||
pyopenssl
|
|
@ -34,7 +34,7 @@
|
|||
<br><br>
|
||||
<br><small><i class="fa-solid fa-triangle-exclamation"></i> Changing vCPU and/or Memory will restart {{ vm_name }} <i class="fa-solid fa-triangle-exclamation"></i></small>
|
||||
<br><br>
|
||||
<button type="submit" class="btn btn-outline-warning btn-hype"><i class="fa-solid fa-pencil"></i></button>
|
||||
<button type="submit" class="btn btn-outline-warning btn-hype" onclick="loading();"><i class="fa-solid fa-pencil"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -79,7 +79,7 @@
|
|||
<form action="/detachdisk" method="post">
|
||||
<input type="hidden" name="vm_name" value="{{vm_name }}" />
|
||||
<input type="hidden" name="diskfile" value="{{ disk[0] }}" />
|
||||
<button type="submit" class="btn btn-outline-danger btn-hype"><i class="fa-solid fa-link-slash"></i></button>
|
||||
<button type="submit" class="btn btn-outline-danger btn-hype" onclick="loading();"><i class="fa-solid fa-link-slash"></i></button>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
|
@ -103,7 +103,7 @@
|
|||
</div>
|
||||
<div class="col-sm">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-outline-info btn-hype"><i class="fa-solid fa-plus"></i> Add</button>
|
||||
<button type="submit" class="btn btn-outline-info btn-hype" onclick="loading();"><i class="fa-solid fa-plus"></i> Add</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
@ -126,7 +126,7 @@
|
|||
<option value={{ net }}>{{ net }}</option>
|
||||
{%endfor%}
|
||||
</select><br>
|
||||
<button type="submit" class="btn btn-outline-info btn-hype"><i class="fa-solid fa-plus"></i> Add</button>
|
||||
<button type="submit" class="btn btn-outline-info btn-hype" onclick="loading();"><i class="fa-solid fa-plus"></i> Add</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<table><tr><td>Max Memory :</td><td><input type="text" name="new_max_mem" class="form-control form-control-sm" placeholder="{{ max_Mermory }}" value="{{ max_Mermory }}" ></input></td></tr></table><br>
|
||||
<table><tr><td>Swap :</td><td><input type="text" name="new_max_swap" class="form-control form-control-sm" placeholder="{{ max_swap }}" value="{{ max_swap }}" ></input></td></tr></table><br>
|
||||
<br><br>
|
||||
<button type="submit" class="btn btn-outline-warning btn-hype"><i class="fa-solid fa-pencil"></i></button>
|
||||
<button type="submit" class="btn btn-outline-warning btn-hype" onclick="loading();"><i class="fa-solid fa-pencil"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -101,6 +101,10 @@
|
|||
var menu_btn = document.querySelector("#menu-btn");
|
||||
var sidebar = document.querySelector("#sidebar");
|
||||
var container = document.querySelector(".my-container");
|
||||
|
||||
sidebar.classList.remove("active-nav");
|
||||
container.classList.remove("active-cont");
|
||||
|
||||
menu_btn.addEventListener("click", () => {
|
||||
sidebar.classList.toggle("active-nav");
|
||||
container.classList.toggle("active-cont");
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
<div class="side-navbar active-nav d-flex justify-content-between flex-wrap flex-column" id="sidebar">
|
||||
<ul class="nav flex-column text-dark w-100 ">
|
||||
<li class="nav-link">
|
||||
<h1 class="display-6">Hype²</h1>
|
||||
</li>
|
||||
<hr class="text-body">
|
||||
<li class="nav-link">
|
||||
<a class="nav-link text-body text-decoration-none fw-light" href="/"><i class="fa fa-pie-chart"></i> Dashboard</a>
|
||||
</li>
|
||||
<li class="nav-link">
|
||||
<a class="nav-link text-body text-decoration-none fw-light" href="/state"><i class="fa fa-cubes"></i> State</a>
|
||||
</li>
|
||||
<li class="nav-link">
|
||||
<a class="nav-link text-body text-decoration-none fw-light" href="/build"><i class="fa fa-cogs"></i> Build</a>
|
||||
</li>
|
||||
<li class="nav-link">
|
||||
<a class="nav-link text-body text-decoration-none fw-light" href="/backup"><i class="fa fa-archive"></i> Backup</a>
|
||||
</li>
|
||||
<li class="nav-link">
|
||||
<a class="nav-link text-body text-decoration-none fw-light" href="/iso"><i class="fa-solid fa-compact-disc"></i> ISO</a>
|
||||
</li>
|
||||
<li class="nav-link">
|
||||
<a class="nav-link text-body text-decoration-none fw-light" href="/pool"><i class="fa-solid fa-hard-drive"></i> Pools</a>
|
||||
</li>
|
||||
<li class="nav-link">
|
||||
<a class="nav-link text-body text-decoration-none fw-light" href="/network"><i class="fa-solid fa-network-wired"></i> Network</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="p-1 my-container active-cont">
|
||||
<nav class="navbar top-navbar px-5">
|
||||
<a class="btn border-0 text-body" id="menu-btn"><i class="fa fa-bars"></i></a>
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-user"></i> {{ current_user.username }}
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdownMenuLink">
|
||||
<li><a class="dropdown-item" href="/logout"><i class="fa fa-sign-out"></i> Logout</a></li>
|
||||
<li><a class="dropdown-item" href="/signup"><i class="fa fa-user-plus"></i> Add user</a></li>
|
||||
<li><a class="dropdown-item" href="/param"><i class="fa fa-gear"></i> Parameters</a></li>
|
||||
<li><a class="dropdown-item" style="cursor:pointer" id="btnSwitch"><i class="fa-solid fa-circle-half-stroke"></i> Theme</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</br>
|
||||
<!-- Safe pour que ce soit au format html, sinon, prit comme texte -->
|
||||
<div class="container">
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div id="alert" class="alert alert-{{ category }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</br>
|
|
@ -4,49 +4,76 @@
|
|||
<center>
|
||||
<a href="/createnet" class="btn btn-outline-danger"><i class="fa-solid fa-plus"></i> Add Network</a></br></br></br>
|
||||
<div class="container">
|
||||
Physical Interfaces:
|
||||
<div class="row justify-content-md-center">
|
||||
<div class="col-md-6">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item bg-primary text-dark">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Physical interface
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% for pint in net_hard_int %}
|
||||
<strong><i class="fa-solid fa-ethernet"></i> {{ pint }}</strong><br>
|
||||
<i class="fa-solid fa-ethernet"></i> {{ pint }}<br>
|
||||
{% endfor %}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div></br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<center>
|
||||
<br>
|
||||
<div class="container">
|
||||
Virtual Interfaces:
|
||||
<div class="row justify-content-md-center">
|
||||
<div class="col-md-6">
|
||||
<ul class="list-group">
|
||||
{% for noac in net_na %}
|
||||
<li class="list-group-item bg-secondary text-dark">
|
||||
<strong><i class="fa-solid fa-ethernet"></i> {{ noac }} Not active</strong><br>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% for item in net_tree %}
|
||||
<li class="list-group-item bg-info text-dark">
|
||||
<table class="table table-sm text-dark table-borderless"><tr><td>
|
||||
<strong><i class="fa-solid fa-network-wired"></i> {{ item[0][0][0] }} - <i class="fa-solid fa-ethernet"></i> {{ item[0][0][1] }} - {{ item[0][0][2] }}</strong>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Virtual interface
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
{% for noac in net_na %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa-solid fa-ethernet"></i> {{ noac }} Not active
|
||||
</div>
|
||||
<div class="card-body">
|
||||
</div></div></div></div></div>
|
||||
<br><br>
|
||||
{% endfor %}
|
||||
{% for item in net_tree %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<table class="table table-sm table-borderless"><tr><td>
|
||||
<i class="fa-solid fa-network-wired"></i> {{ item[0][0][0] }} - <i class="fa-solid fa-ethernet"></i> {{ item[0][0][1] }} - {{ item[0][0][2] }}
|
||||
</td><td>
|
||||
<form action="/delnet" method="post">
|
||||
<input type="hidden" id="net_del" name="net_del" class="form-control" value="{{ item[0][0][0] }}">
|
||||
<button name="delete" class="btn btn-outline-danger btn-sm" type="submit" onclick="loading();"><i class="fa fa-trash" aria-hidden="true"></i></button>
|
||||
</form>
|
||||
</td></tr></table>
|
||||
<ul class="list-group">
|
||||
</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% for sub_item in item[1] %}
|
||||
<li class="list-group-item bg-warning text-dark">
|
||||
<p class="text-start"><i class="fa-solid fa-desktop"></i> {{ sub_item[0] }}<br></p>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<i class="fa-solid fa-desktop"></i> {{ sub_item[0] }}<br>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{% for pitem in sub_item[1] %}
|
||||
<table class="table table-sm text-dark table-responsive table-borderless"><tr><td>
|
||||
<center><i class="fa-solid fa-ethernet"></i> {{ pitem[0] }} - <i class="fa-solid fa-at"></i> {{ pitem[1] }} - {{ pitem[2] }}<br></center>
|
||||
<table class="table table-sm table-responsive table-borderless">
|
||||
<tr><td>
|
||||
<i class="fa-solid fa-ethernet"></i> {{ pitem[0] }} - <i class="fa-solid fa-at"></i> {{ pitem[1] }} - {{ pitem[2] }}<br>
|
||||
</td><td>
|
||||
</td><td>
|
||||
|
||||
<form action="/delnetvm" method="post">
|
||||
<input type="hidden" id="vm_name" name="vm_name" class="form-control" value="{{ sub_item[0] }}">
|
||||
<input type="hidden" id="del_net_vm" name="del_net_vm" class="form-control" value="{{ item[0][0][0] }}">
|
||||
|
@ -54,16 +81,15 @@ Virtual Interfaces:
|
|||
<input type="hidden" id="del_net_int" name="del_net_int" class="form-control" value="{{ item[0][0][1] }}">
|
||||
<button name="delete" class="btn btn-outline-danger btn-sm" type="submit" onclick="loading();"><i class="fa fa-trash" aria-hidden="true"></i></button>
|
||||
</form>
|
||||
</td></tr></table>
|
||||
</td></tr>
|
||||
</table>
|
||||
{% endfor %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div></div></div></div></div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue