Skip to content

DevelopmentInstall

katia-e edited this page Oct 8, 2018 · 50 revisions

How to do a Development Install

Prerequisite

  • Host capable of running docker
  • Kernel which contains openvswitch kvm and tun
  • openvcloud repo cloned at /opt/code/github/0-complexity/openvcloud
  • Apparmor disabled on your host sudo systemctl disable apparmor && sudo systemctl reboot

Clone repo

mkdir -p /opt/code
sudo chown $USER -R /opt/code
mkdir -p /opt/code/github/0-complexity/
cd /opt/code/github/0-complexity/
git clone [email protected]:0-complexity/openvcloud

Create Master

Creating the master is just one simple script which will create docker container with IP 172.17.1.1

/opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/hostaddmaster
...
New node was setup connect via 'ssh -A [email protected]'

Continue inside the docker to install OpenvCloud master services. When asked for SMTP Server password just hit enter.

ssh -A [email protected]
/opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/masterinstall

MAILCLIENT: SMTP Server password           
:  
...

ays status
DOMAIN          NAME                 Instance   Prio Status   Ports                        
======================================================================                     
                                                                                           
jumpscale       redis                system        1 RUNNING  9999                         
jumpscale       mongodb              main          5 RUNNING  27017, 28017                 
jumpscale       osis                 main         10 RUNNING  5544                         
jumpscale       grafana              main         10 RUNNING  3000                         
jumpscale       portal               main         20 RUNNING  82                           
jumpscale       agentcontroller      main         20 RUNNING  4444                         
jumpscale       nginx                main         50 RUNNING                               
jumpscale       jsagent              main        100 RUNNING  4446                         

If all is running all is good

Install cpu node

First we need to prepare the disks needed for OVS to work.

/opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/hostcreatedevs cpunode1

This will create loopdevices connected to backend files under ~/.cache/loopdevs/cpunode1*

Let's create the cpunode container

/opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/hostaddnode
...
New node was setup connect via 'ssh -A [email protected]'

Connect to the node and install OVS + CPUNODE

ssh -A [email protected]
/opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/nodeinstall
/opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/nodeinstallovs

Install the images.

ays install -n image_openwrt

# in case you need it
ays install -n image_ubuntu-1604
ays install -n image_windows2012r2_standard

What to do after rebooting your physical node (laptop)

sudo modprobe openvswitch
sudo modprobe kvm
sudo modprobe tun
/opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/hostcreatedevs cpunode1
docker start ovc
docker start cpunode1
# wait for couple of minutes all should come back

Troubleshooting notes

If nodeinstall terminates due to openvstorage packages being unreachable

Substitute content of /etc/apt/sources.list.d/ovsaptrepo.list with deb http://gig:[email protected]:8056 fargo main, make the same substitution in /opt/code/github/0-complexity/openvcloud/scripts/dev/localnode/_functions.

In case nodeinstall on cpunode terminates with error:

The following packages have unmet dependencies:
 openvstorage-hc : PreDepends: openvstorage-backend (= 1.8.1-1) but it is not going to be installed
                   PreDepends: openvstorage (>= 2.2.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

ensure pythondjangoframework has version 2.3.12-1 on cpunode1 apt install python-djangorestframework=2.3.12-1

Cannot upload images with ays install

Can happen if images were deleted from ftp server. Alternatively images can be added by adding them in portal Cloudbroker->Images by url, for example https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img

Delete cpunode from master

If cpunode1 container was reinstalled you can delete old cpunode1 from master container with cleanup.py script:

cd /opt/code/github/0-complexity/openvcloud/scripts/dev/
jspython  cleanup.py --cpunode

This script will also delete all accounts, vdc's and vms created on the cpunode.

Before reinstalling cpunode1

Might be necessary to clean up old loop devices. rm -rf .cache/loopdevs/*

Add VM sizes

To be able to create VMs from userportal, VM sizes have to be manually defined. It can be done from Admin portal -> Locations. Go to the location page, then choose action -> "Add New VM Size".

Clone this wiki locally