Skip to content
This repository was archived by the owner on Jul 16, 2020. It is now read-only.

HOWTO: Single VM Development Environment

Manohar Castelino edited this page Jun 6, 2016 · 21 revisions

Ciao VM Based Development and Test Environment

This page documents the setup that is ideal for developers that desire the ability build Ciao from sources, make changes and perform quick end to functional testing without requiring multiple machine VM's or the need to create a custom networking environment.

In this case the ciao is configured in a special all in one mode where a node has dual role (i.e launcher can be a Network Node and a Compute Node at the same time)

High Level Overview

Host Node (VM)

A clear VM running running on a NATed Virtual network with its own DHCP server.

Requirements on the VM

  • 4GB of RAM (for now)
  • 32GB of Disk Space
  • NATed Virtual Network with the bridge port attached to the VM setup in hairpin mode

This NATed Virtual Network network configuration is available by default using virt-manager or virsh on most linux distributions.

Requirements on the VM

  1. Controller: Running directly in the VM
  2. Scheduler: Running directly in the VM
  3. Compute+Network Node (i.e. CN + NN Launcher): Running directly on the host
  4. Workloads: Running directly in the VM
  5. WebUI: Running directly in the VM
  6. Mock Openstack Services: Running directly in the VM

So the VM is also the CN, NN, Controller, WebUI and Scheduler (and hosts other openstack services)

Setup

When the system is functioning the overall setup manifests as follows

As you can see below the CNCI VM's will end up on the NATed network. The Tenant VM's are invisible to host network or the NATed network The Bridge on which the NATed network is created should support hairpin mode and be configured as such.


                _____________________________________________________________________________________
                |                                                                                     |
                |                                                                                     |
                |                                                                                     |
                |                                   [Tenant VMs]                         [CNCI VMs]   |
                |                                                                           ||        |
                |                                                                           ||        |
                |                                                                           ||        |
                |                                                                           ||        |
                |    [scheduler]  [controller] [keystone] [CN+NN Launcher]                  ||        |
                  __________________________________________________________________________||________|
                                                              ||                            ||
                                                              ||                            ||
           ------------------------------------------------------------------------------------------------
                                                  Host NATed Virtual Network (Or physical network)

Setup

  • Create a VM with hostname ciao-allinone running on a NATed setup (virtual network 192.168.12.0/24)
  • From the host enable hairpin mode for the port on which your VM attaches to the linux bridge
		sudo brctl show
		sudo brctl hairpin <bridge> <port> on
Note: If you shut down your machine or VM (redo this), as virt-manager will not persist this.
  • In the VM build ciao from sources
cd $GOPATH/src
go get -v -u github.com/01org/ciao/...
go install -v --tags 'travis debug' ./...
  • Generate single machine certs
cd ~
mkdir local
cd ~/local
ciao-cert -server -role scheduler [email protected] -organization=Intel -host=ciao-allinone -verify 
ciao-cert -role cnciagent -server-cert ./cert-Scheduler-ciao-allinone.pem [email protected] -organization=Intel -host=ciao-allinone -verify 
ciao-cert -role controller -server-cert ./cert-Scheduler-ciao-allinone.pem [email protected] -organization=Intel -host=ciao-allinone -verify 
ciao-cert -role agent,netagent -server-cert ./cert-Scheduler-ciao-allinone.pem [email protected] -organization=Intel -host=ciao-allinone -verify
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout controller_key.pem -out controller_cert.pem

  • Generate a CNCI VM based on these certs as usual
  • Now kick off the scheduler, launcher and controller (here the compute net is the VM's virtual network subnet, 192.168.12.0/24).
cd $GOPATH/src

sudo -E ./ciao-scheduler --cacert=~/local/CAcert-ciao-allinone.pem --cert=~/local/cert-Scheduler-ciao-allinone.pem --heartbeat --alsologtostderr -v 3

sudo ./ciao-launcher --cacert=~/local/CAcert-ciao-allinone.pem --cert=~/local/cert-CNAgent-NetworkingAgent-ciao-allinone.pem --network=dual --compute-net 192.168.12.0/24 --mgmt-net 192.168.12.0/24 --alsologtostderr -v 3 --disk-limit=false

sudo ./ciao-controller --cacert=~/local/CAcert-ciao-allinone.pem --cert=~/local/cert-Controller-ciao-allinone.pem --single --username=csr --password=hello --httpskey=./controller_key.pem --httpscert=./controller_cert.pem -v 3 -alsologtostderr

  • Check the ciao-controller output/logs to determine the URI for the mock keystone
cat /var/lib/ciao/logs/controller/ciao-controller.ERROR
...
E0526 11:15:58.118249    5543 main.go:123] ========================
E0526 11:15:58.118750    5543 main.go:124] Identity URL: http://127.0.0.1:44822
E0526 11:15:58.118774    5543 main.go:125] Please
E0526 11:15:58.118785    5543 main.go:126] export CIAO_IDENTITY=http://127.0.0.1:44822
E0526 11:15:58.118801    5543 main.go:127] ========================

  • Setup your environment variables for the ciao-cli with the single machine specific values and the identity information from the log file
export CIAO_CONTROLLER=ciao-allinone
export CIAO_USERNAME=admin
export CIAO_PASSWORD=giveciaoatry
export CIAO_IDENTITY=http://127.0.0.1:44822
Clone this wiki locally