Friday, April 26, 2013

OpenDaylight SDN on Windows

So following the tutorial from @networkstatic found here: http://networkstatic.net/opendaylight-openflow-tutorial/ I was able to easily modify the steps and install/build OpenDaylight on Windows.

I used Windows Server 2008 R2 as my base system.
Components added:



Install Git for Windows, I selected the option during install to use the windows command shell for git.

Extract Apache Maven from the zip file. Add the path of the extracted files to the system path so you can call maven from anywhere. Makes life a little easier when you get to the directory inside of the clone source.

Install the JDK/JRE and add an environmental variable: JAVA_HOME and the path to the JDK. Things don't go without it.


Once you have the prerequisites done you can pull down the source from git.opendaylight.org

From a command prompt:

git clone http://git.opendaylight.org/gerrit/p/controller.git
Next change directories into: controller\opendaylight\distribution\opendaylight\


Run the following command:

mvn clean install

If your path is correct Maven should start going. This is the long part. If you read through Brent's tutorial you can see this step is long and will be a possible trip up. It is possible that something doesn't build right, this is active code being changed by many all the time. 


Once built you can change directories to: target\distribution.opendaylight-0.1.0-SNAPSHOT-osgipackage\

As you can see the path is pretty long, but there is a run.bat. Call that file and you can then browse to: http://localhost:8080 , on the machine in which you just built the project.

You can login using username: admin password: admin


And there you have it. 

From there it is up to you. I am still working down this journey as are lots of us. Thanks for following along.



10 comments:

  1. Thank you, this was very helpful.
    When I run maven clean install, I got the error:
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.14.1:test (default-cli) on project org.openflow.openflowj: There are test failures.
    Any help?
    Thanks!

    ReplyDelete
    Replies
    1. I have not built the controller in a few weeks. Since it is a work in process something may have changed. I will try to get a build going to see. Check on the mailing lists: http://www.opendaylight.org/developers/mailing-lists for help as well. These lists are open to all.

      Delete
  2. If you receive a Maven error when building integration tests you can skip building those tests running the following:
    mvn clean install -DskipTests
    /* instead of "mvn clean install" *

    If the problem persists you can try allocating more memory to the maven build by adding the windows equivalent of this:
    MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m
    /* syntax for setting varies on the OS used by the build machine.*/

    If still stuck you can report it to the controller-dev listserv or jump on irc.freenode.net #opendaylight and someone will give you a hand.

    Cheers,
    -Brent

    ReplyDelete
  3. Very good tutorial

    After logging in, anyone know how I set the Mininet?

    ReplyDelete
    Replies
    1. I am sure there are instructions, I have access to physical Openflow enabled switches so I have not setup Mininet. Here is a link to one: http://www.cs.princeton.edu/courses/archive/fall10/cos561/assignments/ps2-tut.pdf

      Also check http://networkstatic.net for some of Brent's posts.

      Thank you for your comments.
      - Dave

      Delete
  4. run.bat throws error. Any idea how to fix it?

    ReplyDelete
    Replies
    1. If you check the note in the blog above about the Java Home path, I found that the old 8.3 style of the path worked best, Something about the spaces inside the path and the amount of quotes.

      Secondly you can ask on the #opendaylight irc channel on freenode.net or check one of the mailing lists and http://www.opendaylight.org/developers/how-participate .

      Delete
  5. run.bat throws error ... 'org.eclipse.equinox.console_1.0.0.v20120522-1841[6]'could not be resolved.Reason:Missing Constraint:Import-Package:org.apache.felix.service.command;version="0.8.0"

    ReplyDelete
  6. Everything worked as mentioned until I ran run.bat, throws an error,
    \Git\bin\controller\opendaylight\distribution\opendaylight\target\distribution.opendaylight-osgipackage\opendaylight\\logs\controller.out was unexpected at this
    time.

    Can you pls help?

    ReplyDelete
    Replies
    1. What version of ODL are you running? I have not had anytime to work on helium release. It is possible that helium has some different dependencies on windows.

      Delete