Difference between revisions of "GroupBasedPolicy/InstallODLIntegrationDevstack"
(→OpenDaylight Set up) |
(→Unstack and Restack) |
||
Line 122: | Line 122: | ||
sudo service rabbitmq-server restart | sudo service rabbitmq-server restart | ||
sudo service mysql restart | sudo service mysql restart | ||
+ | |||
+ | Stop/Start controller | ||
+ | logout | ||
+ | rm -rf ../data | ||
+ | ./karaf | ||
+ | |||
./stack.sh | ./stack.sh |
Revision as of 15:04, 17 December 2014
Contents
Installing and Running GBP
The following are a set of instructions for installing and working with GBP/ODL integration:
VM Set up
- Setup Ubuntu 14.04 VM in virtualbox or vmware fusion, you can use one VM or two VMs. In the example, one VM is set up for devstack (2 core with 4G RAM), and a second VM for opendaylight controller(2 core with 6G RAM).
- Run OVS 2.1 minimum! (we recommend 2.3).
OpenDaylight Set up
1. sudo apt-get install maven openjdk-7-jre openjdk-jdk
2. git clone https://github.com/opendaylight/groupbasedpolicy.git
3. cd groupbasedpolicy
4. Apply patch:
git fetch ssh://alagalah@git.opendaylight.org:29418/groupbasedpolicy refs/changes/82/13682/1 && git checkout FETCH_HEAD
5. mvn clean install
6. cd distribution-karaf/target/assembly/bin/
7. ./karaf
8. Inside karaf, run following command:
feature:install odl-restconf odl-groupbasedpolicy-openstackgbp
Devstack Installation
1. git clone https://github.com/yapengwu/devstack.git
2. cd devstack
3. git checkout -b patch21_patch6_nosecgrp_modfind origin/patch21_patch6_nosecgrp_modfind
4. modify the 'odl_host' at the end of your local.conf file, so:
- ODL_MGR_IP = <odl-controller-ip>
- HOST_IP = <openstack controller ip>
- odl_host = <odl-controller-ip>
5. ./stack.sh
6. source openrc demo demo
Set up OVS
- sudo ovs-vsctl set bridge br-tun protocols=OpenFlow13
- sudo ovs-vsctl set bridge br-int protocols=OpenFlow13
- sudo ovs-vsctl set bridge br-ex protocols=OpenFlow13
- sudo ovs-vsctl set-controller br-tun tcp:<odl-controller-ip>:6653
- sudo ovs-vsctl set-controller br-ex tcp:<odl-controller-ip>:6653
- sudo ovs-vsctl set-controller br-int tcp:<odl-controller-ip>:6653
Register OFOverlay
From your POSTMAN application, set following RESTful call: PUT http://<controller_IP>:8181/restconf/config/opendaylight-inventory:nodes
{ "opendaylight-inventory:nodes": { "node": [ { "id": "openflow:XXXX", "ofoverlay:tunnel-ip": "<ovs IP address>" } ] } }
where XXXX is the DPID from <sudo ovs-ofctl show br-int -OOpenFlow13> converted from hex to long
GBP in action
Use the "gbp" CLI binary ("gbp --help" will give you the commands)
Example scenario: Modeling connectivity between Web and App Tiers using GBP:
# Authenticate source openrc demo demo
# Create allow action that can used in several rules gbp policy-action-create allow --action-type allow
# Create ICMP rule gbp policy-classifier-create icmp-traffic --protocol icmp --direction bi gbp policy-rule-create ping-policy-rule --classifier icmp-traffic --actions allow
# Create HTTP Rule gbp policy-classifier-create web-traffic --protocol tcp --port-range 80 --direction in gbp policy-rule-create web-policy-rule --classifier web-traffic --actions allow
# ICMP policy-rule-set gbp policy-rule-set-create icmp-policy-rule-set --policy-rules ping-policy-rule
# WEB policy-rule-set gbp policy-rule-set-create web-policy-rule-set --policy-rules web-policy-rule
# Policy Target Group creation and policy-rule-set association gbp group-create web --provided-policy-rule-sets "icmp-policy-rule-set=true,web-policy-rule-set=true" gbp group-create client-1 --consumed-policy-rule-sets "icmp-policy-rule-set=true,web-policy-rule-set=true"
# Policy Target ceation and launching VMs WEB1=$(gbp policy-target-create web-ep-1 --policy-target-group web | awk "/port_id/ {print \$4}") CLIENT1=$(gbp policy-target-create client-ep-1 --policy-target-group client-1 | awk "/port_id/ {print \$4}")
# Reset OpenDaylight controller connection. This is a workaround to a race-condition currently being addressed. # Will remove this instruction once condition addressed sudo ovs-vsctl del-controller br-int sudo ovs-vsctl set-controller br-int tcp:<odl-controller-ip>:6653
nova boot --flavor m1.nano --image cirros-0.3.2-x86_64-uec --nic port-id=$WEB1 web-vm-1 nova boot --flavor m1.nano --image cirros-0.3.2-x86_64-uec --nic port-id=$CLIENT1 client-vm-1
####CHECKPOINT: ICMP and HTTP work from app to web and vice versa
Unstack and Restack
Modify local.conf uncomment "OFFLINE=True", start to unstack and restack
./unstack.sh --all rm -rf /opt/stack/horizon/openstack_dashboard/enabled/*gbp*.py sudo service rabbitmq-server restart sudo service mysql restart
Stop/Start controller
logout rm -rf ../data ./karaf
./stack.sh