Jump to: navigation, search

Difference between revisions of "GroupBasedPolicy/InstallODLIntegrationDevstack"

(Multi-node Devstack Installation)
(GBP in action)
Line 89: Line 89:
 
   WEB1=$(gbp policy-target-create web-ep-1 --policy-target-group web | awk "/port_id/ {print \$4}")
 
   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}")
 
   CLIENT1=$(gbp policy-target-create client-ep-1 --policy-target-group client-1 | awk "/port_id/ {print \$4}")
 +
  WEB2=$(gbp policy-target-create web-ep-2 --policy-target-group web | awk "/port_id/ {print \$4}")
 +
  CLIENT2=$(gbp policy-target-create client-ep-2 --policy-target-group client-1 | awk "/port_id/ {print \$4}")
 +
  
 
   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=$WEB1 web-vm-1
 
   nova boot --flavor m1.nano --image cirros-0.3.2-x86_64-uec --nic port-id=$CLIENT1 client-vm-1
 
   nova boot --flavor m1.nano --image cirros-0.3.2-x86_64-uec --nic port-id=$CLIENT1 client-vm-1
 +
 +
  nova boot --flavor m1.nano --image cirros-0.3.2-x86_64-uec --nic port-id=$WEB2 web-vm-2
 +
  nova boot --flavor m1.nano --image cirros-0.3.2-x86_64-uec --nic port-id=$CLIENT2 client-vm-2
  
 
   ####CHECKPOINT: ICMP and HTTP work from app to web and vice versa
 
   ####CHECKPOINT: ICMP and HTTP work from app to web and vice versa

Revision as of 13:41, 6 January 2015

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 git-core maven openjdk-7-jre openjdk-7-jdk

2. git clone https://github.com/opendaylight/groupbasedpolicy.git

3. cd groupbasedpolicy

4. mvn clean install

5. cd distribution-karaf/target/assembly/bin/

6. ./karaf

7. Inside karaf, run following command:

  feature:install odl-restconf odl-groupbasedpolicy-openstackgbp

All-in-one Devstack Installation

1. Grab devstack from github:

    git clone https://github.com/group-policy/devstack.git -b stable/juno-gbp-odl
    cd devstack
    cp local.conf.controller local.conf


2. 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>


3. ./stack.sh

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}")
 WEB2=$(gbp policy-target-create web-ep-2 --policy-target-group web | awk "/port_id/ {print \$4}")
 CLIENT2=$(gbp policy-target-create client-ep-2 --policy-target-group client-1 | awk "/port_id/ {print \$4}")


 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
 nova boot --flavor m1.nano --image cirros-0.3.2-x86_64-uec --nic port-id=$WEB2 web-vm-2
 nova boot --flavor m1.nano --image cirros-0.3.2-x86_64-uec --nic port-id=$CLIENT2 client-vm-2
 ####CHECKPOINT: ICMP and HTTP work from app to web and vice versa

Unstack and Restack

Stop OpenDaylight Controller and remove any persistent data

 logout
 rm -rf ../data

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

Start OpenDaylight Controller

 ./karaf
 feature:install odl-groupbasedpolicy-openstackgbp odl-restconf

Start Devstack

 ./stack.sh

Multi-node Devstack Installation

  1. Launch ODL controller OpenDaylight Set up
  2. Launch Openstack controller node: follow All-in-one Devstack Installation.
  3. Create compute node VM VM Set up. Note: this VM size could be smaller, CPU 2core, Memory 2GB is ok.
  4. Follow this link to setup compute node Setup compute node
  5. Register OFOverlay OFOverlay

Setup compute node

1. Grab devstack from github:

    git clone https://github.com/group-policy/devstack.git -b stable/juno-gbp-odl
    cd devstack
    cp local.conf.compute local.conf


2. modify the IP addresses your local.conf file, so:

  • ODL_MGR_IP = <odl-controller-ip>
  • HOST_IP = <openstack compute ip>
  • SERVICE_HOST = <openstack controller ip>
  • odl_host = <odl-controller-ip>


3. ./stack.sh