uncloud-mravi/doc/README.md

2.6 KiB

Install

OS package requirements

Alpine:

apk add openldap-dev postgresql-dev

Debian/Devuan:

apt install postgresql-server-dev-all

Python requirements

If you prefer using a venv, use:

python -m venv venv
. ./venv/bin/activate

Then install the requirements

pip install -r requirements.txt

Database requirements

Due to the use of the JSONField, postgresql is required.

First create a role to be used:

postgres=# create role nico login;

Then create the database owner by the new role:

postgres=# create database uncloud owner nico;

Installing the postgresql service is os dependent, but some hints:

  • Alpine: apk add postgresql-server && rc-update add postgresql && rc-service postgresql start
  • Debian/Devuan: apt install postgresql

After postresql is started, apply the migrations:

python manage.py migrate

Flows / Orders

Creating a VMHost

Creating a VM

  • Create a VMHost
  • Create a VM on a VMHost

Creating a VM Snapshot

Working Beta APIs

These APIs can be used for internal testing.

URL Overview

http -a nicoschottelius:$(pass ungleich.ch/nico.schottelius@ungleich.ch) http://localhost:8000

Snapshotting

http -a nicoschottelius:$(pass ungleich.ch/nico.schottelius@ungleich.ch) http://localhost:8000/vm/snapshot/  vm_uuid=$(uuidgen)

VPNs

VPNs consist of VPNPools ("networks of networks") which are handled by VPNHosts. Users can requests VPNs with specific sizes.

VPNs support both IPv6 and IPv4. However only IPv6 support has not been

Managing VPNPools

http -a nico:$(pass ldap/nico) https://uncloud.place7.ungleich.ch/v1/admin/vpnpool/ network=2a0a:e5c1:200:: network_size=40 subnetwork_size=48 vpn_hostname=vpn-2a0ae5c1200.ungleich.ch wireguard_private_key=$(wg genkey)

This will create the VPNPool 2a0a:e5c1:200::/40 from which /48 networks will be used for clients.

VPNPools can only be managed by staff.

Managing VPNNetworks

To request a network as a client, use the following call:

http -a nicoschottelius:$(pass ungleich.ch/nico.schottelius@ungleich.ch)https://uncloud.place7.ungleich.ch/v1/net/vpn/ network_size=48 wireguard_public_key=$(wg genkey | tee privatekey | wg pubkey)

VPNNetworks can be managed by all authenticated users.

Proposed (uncoded) flows

Changing the disk size of a VM

  • GET on ../vm/vm/ should list uuids of disks
  • UPDATE on ../vm/disk/ with size=newsize
    • Newsize > oldsize!
  • Triggers shutdown of VM
  • Resizes disk
  • Starts VM
  • Maybe confirm flag?

Adding a disk to a VM

(TBD)