Add Userguide.md

This commit is contained in:
Ahmed Bilal 2019-09-11 16:53:16 +02:00
parent da57d201ca
commit 0b9785d665
1 changed files with 101 additions and 0 deletions

101
Userguide.md Normal file
View File

@ -0,0 +1,101 @@
# ucloud User Guide
## Pre-requisite
1. You need to have an Account at [accounts.ungleich.ch](https://account.ungleich.ch). If you don't have it create one.
2. Login and click on **SHOW SEEDS** button. On the next page it will show you your seed mentioned next to your user realm.
## Installation
To install `ucloud-cli` you need to execute the following commands. Make sure you have [Python 3.7](https://www.python.org/) and [pipenv](https://pypi.org/project/pipenv/) installed.
1. Clone `ucloud-cli` git repository. `ucloud-cli` is needed to talk with ucloud backend i.e create/delete/start/stop VM, attach network to VM etc.
```bash
git clone https://code.ungleich.ch/ungleich-public/ucloud-cli.git
```
2. Change your directory to recently cloned repository.
```bash
cd ucloud-cli
```
3. Install dependencies of `ucloud-cli`
```bash
pipenv install
```
4. Activate `ucloud-cli`
```bash
pipenv shell
```
5. Run the following command to ensure that you have successfully installed `ucloud-cli`
```bash
python ucloud.py
```
If the output looks somewhat similar to this then you have successfully installed `ucloud-cli`
```bash
Usage: ucloud.py [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
host
image
user
vm
```
## Examples
### Create VM
1. Create a file name *specs.json* and put your required VM's specification in it. Save it in `ucloud-cli` directory. A sample is given below.
```json
{
"cpu": 2,
"ram": "2GB",
"hdd": "10GB"
}
```
2. Find out which image you want to use by running the following command. Image means the Operating System which you want to use in your VM.
```bash
python ucloud.py image list --public
```
It will show list of available images. Sample output
```json
{
"253286ee-5a74-4747-808d-e47d7c3ce4ed": {
"filename": "alpine.qcow2",
"name": "alpine",
"owner": "ahmedbilal-admin",
"status": "CREATED",
"store_name": "images",
"visibility": "public"
},
"1245856ee-2345-4747-56798-ejdf72394d": {
"filename": "devuan.qcow2",
"name": "devuan",
"owner": "ahmedbilal-admin",
"status": "CREATED",
"store_name": "images",
"visibility": "public"
}
}
```
3. Suppose, we want to create our VM with alpine Image. So, we would use uuid of alpine linux i.e **253286ee-5a74-4747-808d-e47d7c3ce4ed**.
4. Run the following command to create your VM.
```bash
python ucloud vm create --name {YOUR_USERNAME} --realm {YOUR_REALM} --seed {YOUR_SEED} --specs specs.json --image_uuid 253286ee-5a74-4747-808d-e47d7c3ce4ed
```
It will show something like the following
```json
{
"message": "VM Creation Queued"
}
```