More Networking Implementation

This commit is contained in:
ahmadbilalkhalid 2019-11-15 21:11:45 +05:00
commit fefbe2e1c7
17 changed files with 243 additions and 119 deletions

View file

@ -7,10 +7,12 @@ SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source/
BUILDDIR = build/
DESTINATION=root@[2a0a:e5c0:2:12:0:f0ff:fea9:c3d9]:/home/app/static/ucloud
DESTINATION=root@staticweb.ungleich.ch:/home/services/www/ungleichstatic/staticcms.ungleich.ch/www/ucloud/
.PHONY: all build clean
publish: build
rsync -av $(BUILDDIR)/ $(DESTINATION)
rsync -av $(BUILDDIR) $(DESTINATION)
build:
$(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)"

View file

@ -18,8 +18,8 @@
# -- Project information -----------------------------------------------------
project = 'ucloud'
copyright = '2019, Ahmed Bilal Khalid'
author = 'Ahmed Bilal Khalid'
copyright = '2019, ungleich'
author = 'ungleich'
# -- General configuration ---------------------------------------------------
@ -28,6 +28,7 @@ author = 'Ahmed Bilal Khalid'
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc'
]
# Add any paths that contain templates here, relative to this directory.

View file

@ -12,7 +12,9 @@ Welcome to ucloud's documentation!
introduction/introduction
introduction/installation
introduction/usage
usage/usage-for-admins
usage/usage-for-users
Indices and tables
==================

View file

@ -7,7 +7,7 @@ Installation
The instructions assumes the following things
* User is **root**.
* Base Directory is `/root/`.
* Base Directory is :file:`/root/`.
Alpine
------

View file

@ -1,5 +1,5 @@
Introduction
============
What is ucloud?
===============
**Open** + **Simple** + **Easy to hack** + **IPv6 First**
@ -18,6 +18,7 @@ Tech Stack
* QEMU (+ kvm acceleration) as hypervisor.
* etcd for key/value storage (specifically all metadata e.g Virtual Machine Specifications, Networks Specifications, Images Specifications etc.).
* Ceph for image storage.
* uotp for user authentication.
Components
----------

View file

@ -1,5 +1,5 @@
Usage
=====
Usage Guide For Administrators
==============================
Start API
----------
@ -95,14 +95,14 @@ An image belongs to an image store. There are two types of store
* Private Image Store (Not Implemented Yet)
.. note::
**Quick Quiz** Have we create an image store yet?
**Quick Quiz** Have we created an image store yet?
The answer is **No, we haven't**. Creating an example image store is very easy.
The answer is **No, we haven't**. Creating a sample image store is very easy.
Just execute the following command
.. code-block:: sh
pipenv run python ~/ucloud/api/create_image_store.py
(cd ~/ucloud && pipenv run python api/create_image_store.py)
An image store (with name = "images") would be created. Now, we are fully ready for creating our
very own image. Executing the following command to create image using the file uploaded earlier
@ -132,73 +132,3 @@ output something like the following
}
]
}
Create VM
---------
The following command would create a Virtual Machine (name: meow) with following specs
* CPU: 1
* RAM: 1GB
* OS-SSD: 4GB
* OS: Alpine Linux
.. code-block:: sh
ucloud-cli vm create --vm-name meow --cpu 1 --ram '1gb' --os-ssd '4gb' --image images:alpine
Check VM Status
---------------
.. code-block:: sh
ucloud-cli vm status --vm-name meow
.. code-block:: json
{
"hostname": "/v1/host/74c21c332f664972bf5078e8de080eea",
"image_uuid": "3f75bd20-45d6-4013-89c4-7fceaedc8dda",
"in_migration": null,
"log": [
"2019-11-12T09:11:09.800798 - Started successfully"
],
"metadata": {
"ssh-keys": []
},
"name": "meow",
"network": [],
"owner": "admin",
"owner_realm": "ungleich-admin",
"specs": {
"cpu": 1,
"hdd": [],
"os-ssd": "4.0 GB",
"ram": "1.0 GB"
},
"status": "RUNNING",
"vnc_socket": "/tmp/tmpj1k6sdo_"
}
Create Network
--------------
.. code-block:: sh
ucloud-cli network create --network-name mynet --network-type vxlan
.. code-block:: json
{
"message": "Network successfully added."
}
Create VM using this network
.. code-block:: sh
ucloud-cli vm create --vm-name meow2 --cpu 1 --ram '1gb' --os-ssd '4gb' --image images:alpine --network mynet

View file

@ -0,0 +1,89 @@
Usage Guide For End Users
=========================
Create VM
---------
The following command would create a Virtual Machine (name: meow) with following specs
* CPU: 1
* RAM: 1GB
* OS-SSD: 4GB
* OS: Alpine Linux
.. code-block:: sh
ucloud-cli vm create --vm-name meow --cpu 1 --ram '1gb' --os-ssd '4gb' --image images:alpine
.. _how-to-check-vm-status:
Check VM Status
---------------
.. code-block:: sh
ucloud-cli vm status --vm-name meow
.. code-block:: json
{
"hostname": "/v1/host/74c21c332f664972bf5078e8de080eea",
"image_uuid": "3f75bd20-45d6-4013-89c4-7fceaedc8dda",
"in_migration": null,
"log": [
"2019-11-12T09:11:09.800798 - Started successfully"
],
"metadata": {
"ssh-keys": []
},
"name": "meow",
"network": [],
"owner": "admin",
"owner_realm": "ungleich-admin",
"specs": {
"cpu": 1,
"hdd": [],
"os-ssd": "4.0 GB",
"ram": "1.0 GB"
},
"status": "RUNNING",
"vnc_socket": "/tmp/tmpj1k6sdo_"
}
Connect to VM using VNC
-----------------------
We would need **socat** utility and a remote desktop client e.g Remmina, KRDC etc.
We can get the vnc socket path by getting its status, see :ref:`how-to-check-vm-status`.
.. code-block:: sh
socat TCP-LISTEN:1234,reuseaddr,fork UNIX-CLIENT:/tmp/tmpj1k6sdo_
Then, launch your remote desktop client and connect to vnc://localhost:1234.
Create Network
--------------
.. code-block:: sh
ucloud-cli network create --network-name mynet --network-type vxlan
.. code-block:: json
{
"message": "Network successfully added."
}
Create VM using this network
.. code-block:: sh
ucloud-cli vm create --vm-name meow2 --cpu 1 --ram '1gb' --os-ssd '4gb' --image images:alpine --network mynet