vagrant and virtualbox
Install vagrant:
sudo apt-get install vagrant
Download virtualbox from: https://www.virtualbox.org/wiki/Downloads
Git clone this repo
git clone https://github.com/snlab/odl-summit-2016-tutorial-vm.git
After installing Vagrant and VirtualBox, run
vagrant up
in this directory.
The username and password are both vagrant
. You can use the VirtualBox GUI as normal or run
vagrant ssh
to connect to the VM from this directory.
-
After SSH'ing into VirtualBox (see above), execute
start.sh
to load cloud9:/home/vagrant/tutorial/cloud9/start.sh
-
Open the following url in your host machine's browser:
localhost:9000
Generate your Archetype in interactive mode, only thing your should care is the DappName
where Maple's onPacket() lies in, and artifactId
, which is the generated folder name
mvn archetype:generate \
-DarchetypeGroupId=org.opendaylight.maple \
-DarchetypeArtifactId=maple-archetype \
-DarchetypeVersion=1.0.0-Beryllium-SR3
You could find DappName.java
from here:
{home_of_your_maple_app_project}/impl/src/main/java/org/opendaylight/mapleapp/impl/{your_define_name}.java
And then you could copy paste the Mapple App Code M1 from
M1 example: https://github.com/snlab/fastmaple16/blob/master/M1.java
to this {your_define_name}.java file.
Note: if you set DappName as M1 for M1 example, you could directly copy and paste the belowing java file into your {your_define_name}.java file. Also M2 is ready for testing.
cd {artifactId}
mvn clean install -DskipTests
cd ~/tutorial/maplemain-karaf-1.0.0-Beryllium-SR3/etc
Add following line into org.ops4j.pax.url.mvn.cfg
org.ops4j.pax.url.mvn.defaultRepositories=\ file:${karaf.home}/${karaf.default.repository}@id=system.repository@snapshots,\ file:${karaf.data}/kar@id=kar.repository@multi@snapshots
And then run your Maple,
cd ~/tutorial/maplemain-karaf-1.0.0-Beryllium-SR3/bin
./karaf
In karaf,
kar:install file:{directory of your kar file}
The kar file will be located in {your_maple_app_directory}/features/target/*.kar
In your host machine, the home directory of this repo, type
vagrant ssh
A new terminal will appear, so that you could use Mininet. Type this to generate Topo based on ODL wiki page.
sudo mn --controller remote,127.0.0.1 --custom ~/utils/Maple_Topo_Scripts/exampletopo.py --topo mytopo --switch ovs,protocols=OpenFlow13 --mac
And then you should follow the steps listed in ODL wiki https://wiki.opendaylight.org/view/SDN_Programming_using_High_Level_Programming_Abstractions#Build_and_deploy_M1 , and see the result!
In your host machine, type:
cd ${home_directory_of_this_repo}
vagrant destroy
vagrant up