---
tags: NodeWeaver, NFVI
---
# Build a VM and Docker Container on NodeWeaver SOP
###### tags: NodeWeaver
## BIOS setting
enable SR-IOV and vSwitch
## install and enter nodeweaver (YiHao in charge of this part)
### install nodeweaver
1. Choose option 1 like picture below

2. After step 1, you'll enter this login frame
Default account: setup
Default password: nodeweaver

3. After login, nodeweaver will search cluster automaticly, like picture below
If there's cluster found, follow step 4-6
else, follow step 7

4. If there's cluster found, it will ask for join cluster or not, like picture below

5. Press space to choose the cluster, and it will add "*" mark, like picture below
After that, choose "connect" option below

6. After rebooting, it will show message like picture below, and it means node setted

7. If there's no cluster found or creating a new cluster, it will show pictures below
Type in label, IP address, netmask, default gateway and canary IP (fill in default gateway in canary IP column), after that, it will start processing after press enter




### enter nodeweaver webUI
1. Open web browser and type in IP address
Default account: admin
Default password: cloud

### troubleshooting
When creating a new node (step 7 of install nodeweaver)
It should be finished in 10 minutes, or it may have problem
Please reboot and follow step 1 and step 2 of install nodeweaver part,
we'll show the frame like picture below, and we choose "Manage Options"

After that, choose "Format" option and restart install nodeweaver procedure

### caution
1. If you can, avoid using console, sometimes it occurs error (no output from console)
2. If stucked at procedure 7 of install nodeweaver, please follow troubleshooting and do, and it may takes more than 1 time to do that
## build VM
### create a net interface
1. Click Item on the menu of the left: Network => Virtual Networks
2. Click “+” button on the upper left side of the menu

3. Type Name of that Virtual Network Interface

4. Click Item on the menu of the top: Addresses
5. Type in first IP address, size (amount of VMs in the virtual internet) and first MAC
6. Click "Create" button

### create a image which contains installing OS .iso file
7. Click Item on the menu of the left: Storage => Images
8. Click "+" button on the upper left side of the menu

9. Write name and select goal (about goal, I always choose HDD_2 option because there's no SSD on system)
10. Upload the .iso file from local
12. Click "Create" button

### doing setting of VM
12. Click Item on the menu of the left: Templates => VMs
13. Click "+" button on the upper left side of the menu

14. Type in Name, HW Resource (including Memory, CPU and VCPU) of VM

15. Click Item on the menu of the top: Storage
16. Add a disk what you built with installing OS .iso

17. Add a disk
18. Click "Volatile disk" option
19. Type in capacity of storage

20. Click Item on the menu of the top: Network
21. Choose a defined NIC interface
22. Click "Create" button on the upper left side

23. Click Item on the menu of the left: Instances => VMs
24. Click "+" button on the upper left side of the menu

### starting VM
25. Choose template of VM you built
26. Click "Create" button on the upper left side

27. Click Item on the menu of the left: Instances => VMs
28. If VM was built successfully, it should show RUNNING on the column of Status, if the VM's running, click the monitor button at the rightside to the view of VM and install OS

### installing OS
29. After installing OS, poweroff your VM. After VM poweroffed, clicking your VM

30. Click Item on the menu of the top: Storage
31. Detach the Vhd with installing OS .iso

## after installing OS
1. install ssh
```javascript=
$ sudo apt-get install ssh
```
2. attach the VM by ssh protocol
## transfer file to VM (VM must be poweroffed if use this method)
1. Click Item on the menu of the left: Storage => Images
2. Click "+" button on the upper left side of the menu

3. Write name and select goal (about goal, I always choose HDD_2 option because there's no SSD on system)
4. Choose Type: Generic storage datablock
5. Choose Advanced Options => BUS: SCSI(sd)
6. Pack file what you want to upload to a .iso file at local
7. Upload the .iso file from local
8. Click "Create" button

9. Click Item on the menu of the left: Instances => VMs
10. Click your VM

11. Click Item on the menu of the top: Storage
12. Click Attach disk button

13. Choose disk that contains your file and click attach button

14. Boot VM
15. Mount the disk in the VM like you use Linux
## Build a Docker Container
After we built a VM, we can build a docker container on VM
We work on command line, so we can attach VM by NodeWeaver or SSH
### Install Docker Container on VM
source: https://docs.docker.com/engine/install/ubuntu/
```javascript=
$ sudo apt-get remove docker docker-engine docker.io containerd runc
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
# reboot
```
### Pull docker images
I take ubuntu docker image for example
* search docker images
```javascript=
$ sudo docker search ubuntu //docker search [keyword]
```
* pull docker images from docker images library
```javascript=
$ sudo docker pull ubuntu //docker pull [image_Name]
```
* create docker container from docker image
```javascript=
$ sudo docker run -it ubuntu //docker run -it [image_Name]
```
* exit from container and close container
```javascript=
# exit
```
We can also use Ctrl+C
* exit container without close it
(Ctrl+P) and (Ctrl+Q)
## source
https://docs.nodeweaver.eu/#/
https://docs.docker.com/engine/install/ubuntu/
## special thanks
Rick Xiao
Kevin Chio
YiHao Shih