Jump to: navigation, search

Play tricircle with virtualbox

Revision as of 08:34, 7 September 2016 by CR hui (talk | contribs) (Ping test)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Preparation

One server with Linux kernel (demo is Ubuntu 14.04 LTS)

Install softwares

Install virtualbox

Follow the steps in https://www.virtualbox.org/wiki/Linux_Downloads
First, add the following line to your environment→/etc/apt/sources.list:
deb http://download.virtualbox.org/virtualbox/debian trusty contrib
According to your distribution, replace ‘vivid’ by ‘utopic’, ‘trusty’, ‘raring’, ‘quantal’, ‘precise’, ‘lucid’, ‘jessie’, ‘wheezy’, or ‘squeeze’.
Then, add the Oracle public key for apt-secure:
#wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
Next, install with apt-get method:
#sudo apt-get update
#sudo apt-get upgrade
#sudo apt-get install virtualbox-5.0

Connect to the virtualbox with x11

First, copy your public key to the ~/authorized_keys.
Then, connect with -X command:
#ssh -X root@HostIP
Next, input the virtualbox to start install virtual machine:
#virtualbox
Then you can see the virtualbox graph interface:

111.jpg

Install Virtual Machines

For playing Tricircle, we need to install 3 nodes for devstack. One for the Top OpenStack, two for the cross pod bottom OpenStacks.

Configuration of VMs

The most important is to set up networks for use
In order to make the VMs with multiple VLAN networks, then add two network devices for bridge use.
eth0
The eth0 is the default network with NAT methods.

222.jpeg

eth1
The eth1 is the VLAN external network,and using bridge method, in my environment, I attached to the eth1.
Attention: The Promiscuous Mode must to set “Allow All”. And be in use after reboot.
Otherwise, the Ping test with VLAN tag from Node1 to Node2 will be blocked.

Eth1.png

eth2
The same setting as the above, the Promiscuous Mode must be set to “Allow All”. And be in use after reboot.

Installation the VMs

Download an ios for installation
There are many mirror sites in the world. I download a ubuntu-14.04-LTS in the http://mirrors.aliyun.com/ (Alibaba Open Source Mirror Site). Because it’s very fast in China.
Install the Operating System
Follow the steps while installing, because it’s easy, so it will be ignored. After installation, you will see the console like this:

Installiso.png

Running in the backgroud

After installation of the VMs, we can login from SSH. So we need to let’s these VMs running in the background. And so when we close the VMs, we need to choose the option:

Backgroud.png

Playing tricircle with devstack

The detailed methods can be seen in the https://github.com/openstack/tricircle

In the Top OpenStack

Configure the Network

Install the openvswitch for creating bridges
#apt-get install openvswitch-switch

Create the stack user

#adduser stack
Give the stack user sudo privileges:
#sudo apt-get install -y
#su root
#echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
#exit

Download the devstack

#su stack
#sudo apt-get install git -y
#git clone https://git.openstack.org/openstack-dev/devstack
Configure the local.conf Change the local.conf to fit your environment. The example is in the Tricircle Project. such as https://github.com/openstack/tricircle/blob/master/devstack/local.conf.sample

Install the devstack with Tricircle project

#./stack.sh
After installing the devstack with tricircle, the next step is verifying the installation.

Verifying the installation

Before verifying, it should create the client environment variables to import, such as the script admin-openrc.sh :
export OS_PROJECT_DOMAIN_ID=default
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=password#change password as you set in your own environment
export OS_AUTH_URL=http://127.0.0.1:5000
export OS_IDENTITY_API_VERSION=3
export OS_REGION_NAME=RegionOne#It's very important to set region name to the top openstack, because tricircle has different API urls.
Modify the verify install scripts as your own environment. And run:
#cd tricircle/devstack
#chmod +x verify_top_install.sh
#./verify_top_install.sh 2>&1 | tee logs
It will save the outputs in the logs, you can check if it’s installed correct.

Cross pods OpenStack

Installing

First, in the node1 install the tricircle, and then in the node2 install the tricircle. As the above:

  1. Modify the networks;
  2. Create the stack user;
  3. Install git;
  4. Download the devstack;
  5. Modify the local.conf;
  6. Install the devstack with tricircle;

Verifying the tricircle

Before verifying, It should create the client environment variables to import, such as the script admin-openrc.sh. export OS_PROJECT_DOMAIN_ID=default
export OS_USER_DOMAIN_ID=default
export OS_PROJECT_NAME=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=password#change password as you set in your own environment
export OS_AUTH_URL=http://127.0.0.1:5000
export OS_IDENTITY_API_VERSION=3
export OS_REGION_NAME=RegionOne#It's very important to set region name to the top openstack, because tricircle has different API urls.
Modify the verify install scripts as your own environment. And run:
#cd tricircle/devstack
#chmod +x verify_top_install.sh
#./verify_top_install.sh 2>&1 | tee logs
One copy logs like: this

Ping test

Using the VNC to login the instances in Node1 and Node2. And Ping with each other.
VM1 IP : 10.0.1.3/24
#ping -c 4 10.0.2.3

Ping1.jpg

VM2 IP : 10.0.2.3/24
#ping -c 4 10.0.1.3

Ping2.jpg

So the cross pod networking has been verified.