Software Defined Networking
1827775 Members
2565 Online
109969 Solutions
New Discussion

How to install SDN

 
MatthewHart
Advisor

How to install SDN

Hi Everyone,

 

I have tried to install the hp-sdn-sdk-2.3.5 through the use of the bin/install-sdk script.

The issue is that Eclipse believes that only some of the libraries are there. It can see some of the com.hp.util.* libraries (but not com.hp.utils.ip.* library). There are a few other libraries it can see too, but the most important library for my project is com.hp.of.* so I can start to hook into the PACKET_IN requests.

 

Can anyone shed some light as to where I should start looking or start hooking into things such that I can get what i'm looking for?

 

 

--

Regards,

Matthew Hart

14 REPLIES 14
sdnindia
Trusted Contributor

Re: How to install SDN

Hello Matthew Hart,

 

We need to understand few questions to support you in a better way.

 

1) Is this a fresh installation or Upgrade from some older version to 2.3.5?

2) Are you getting any error when you tried to install SDN/SDK/dependencies? If yes can you please share the screenshots of the error message?

3) Did you follow the installation guide?

4) Please do shed some light on your setup.

 

This looks like some Jar file missing, we need some clarity to pin point the issue.

 

Please advise

 

Thanks,

HP SDN Team

MatthewHart
Advisor

Re: How to install SDN

Hi Team,

 

 

1) Is this a fresh installation or Upgrade from some older version to 2.3.5?

 

This is a fresh install.

 

 

2) Are you getting any error when you tried to install SDN/SDK/dependencies? If yes can you please share the screenshots of the error message?

 

All of the SDN/SDK/Dependencies installed fine with no errors.

 

 

3) Did you follow the installation guide?

 

I followed the installation guide and everything was successful.

 

 

4) Please do shed some light on your setup.

 

This is a fresh install of Ubuntu Server 12.04 LTS with HP SDN VAN Controller vesion 2.3.5 and the 2.3.5 SDK. This is running in a virtual box because it is just for developmental ideas and isn't doing much in regards to heavy lifting (mininet will be used to generate network traffic).

 

Interestingly, I re-ran the installer and now Eclipse is able to find hp.com.of.lib.* but it is unable to find hp.com.of.ctl.* or any other libraries under the hp.com.of.* package. 

 

Given that running the reinstall helped, I completely removed the ~/.m2 folder and re-ran the install script. This put me in the same position as above. I can nost see the hp.com.of.lib.* library, but nothing else uder the hp.com.of.* package.

 

sdnindia
Trusted Contributor

Re: How to install SDN

Hello Matthew,

Thanks for the details that you have provided. After sucessfully building the sample app (which was generated by running the script gen-sdn-app) ,you should create eclipse project by running below command
mvn eclipse:eclipse

Was this tried?

Then you can import java project as mentioned on SDN programming guide page 208 and there you can see all package import statement resolved automatically.


Please note that the file supplied is not meant to be a complete working example rather it should be considered as some guideline code snippets to further modification. However import statement should not show any error.

Please let us know if this helps or still you are facing some issue.

Thanks
HP SDN team

MatthewHart
Advisor

Re: How to install SDN

Hi Team,

 

Yes, I have generated my sample app through the use of the gen-sdn-app script and then run mvn eclipse:eclipse.

 

I also imported the app into Eclipse as per the instructions in the programming guide and, yes the import statements resolved automatically (after a restart).

 

The issue is that not all of the libraries that are mentioned in the SDK API have been imported correctly. For example, I am missing the com.hp.of.* library. I am also missing part of the utils library (com.hp.utils.ip.* for example).

 

I noticed that during the install-sdk command, these libraries are not mentioned anywhere. The two install locations are ~/.m2/repository/com/hp/sdn and ~/.m2/repository/com/hp/utils.

 

What folders are supposed to be in the ~/.m2/repository/com/hp/ folder?

Also, what are the jar's that handle the missing libraries? Can I get them and import them manually somehow?

 

 

--

Regards,

Matthew Hart

sdnindia
Trusted Contributor

Re: How to install SDN

Hello Matthew,
 
Did you set M2_REPO variable as per programming guide page 246 ?
Setting up this variable properly, will also resolve many dependencies.

Also please note that there is no package com.hp.utils (and no directory ~/.m2/repository/com/hp/utils)  rather it is package com.hp.util (and the directory ~/.m2/repository/com/hp/util)


After running install-sdk there will be two  sub directories  under ~/.m2/repository/com/hp/    - (1) sdn (2) util
 
If still you are facing problem ,please share the screenshot of your code in eclipse having red marked dependency error.
 
Thanks,
HP SDN Team

MatthewHart
Advisor

Re: How to install SDN

Hi Team,

 

I've attached some images of my setup. It's util, not utils in my setup too.

 

You should be able to see that some of the libraries are linking fine, but some are just not there (or not linking for whatever reason).

 

Can you tell me what the $PATH variable should be? Also, any other environment variables that I need for this project to work (even outside of Eclipse). Also, ~/.bashrc

sdnindia
Trusted Contributor

Re: How to install SDN

Hello Matthew,

 

We tried to regenerate the error as mentioned in the screenshots shared by you and we regenerated the error.

However to solve that error we added M2_REPO variable as per the SDN Programming guide and rebuild all and this solved the problem.

So can you please delete M2_REPO variable ,rebuild all and see what errors come.

Then you add M2_REPO (for e.g. M2_REPO=/home/user/.m2/repository) and rebuild all and let us know if this helps or not.

 

Please make sure M2_REPO variable has the correct value (i.e. /home/YOUR_USER_DIRECTORY_NAME/.m2/repository)

 

Thanks,

HP SDN Team

MatthewHart
Advisor

Re: How to install SDN

Hi Team,

 

I removed and re-added the classpath (M2_REPO) as you requested and the issue still exists.

I've attached a couple of images and the build error output for you to take a look at.

 

For your reference, the program that I am trying to get working can be found at this thread (http://h30499.www3.hp.com/t5/SDN-Development/Packet-In/td-p/6301111#.VB9h4S6Sztn) under the file name "SampleManager.txt" which I have renamed to Manager.java

 

Coming back to my previous question, do there need to be any local environment variables in the computer (such as in $PATH or .bashrc) that I need to have in conjunction with M2_REPO in eclipse?

 

I have read the install guide and the SDN programming guide cover to cover and nothing in either document has helped.

sdnindia
Trusted Contributor

Re: How to install SDN

Hello Matthew,

 

Before putting the code  mentioned in the link http://h30499.www3.hp.com/t5/SDN-Development/Packet-In/td-p/6301111#.VB9h4S6Sztn , were you able to build the project(generated by gen-sdn-app script) successfully ?

 

First please make sure you are successfully building the generated project ,later you can modify the java files.

Please make sure you are done with below steps successfully(each step must be successfully completed)

  • install-sdk script runs
  • gen-sdn-app runs successfully
  • Then you got to hm-root directory and run  mvn clean install  successfully, and you see the generated target zip file under hm-app/target/
  • Then only you run mvn eclipse:eclipse command from  hm-root directory . This must build successfully
  • Then you can import java project to eclipse [page 243 SDN Programming guide 2.3]

 

Please have a look on the above steps and make sure you have completed successfully. In case you get any error in any step please let us know.

 

Again if you get those import errors please share the screenshot of 2 tabs ( 1-Libraries and 2-Order and Export ).These tabs you can find in java build path as below-

 

Right click on project(e.g. hm-bl)àselect properties à then type “Java Build Path” in the ‘type filter text’ box there you can see two tabs ‘Libraries’ and ‘Order and Export’

 

 

Thanks,

HP SDN Team  

MatthewHart
Advisor

Re: How to install SDN

Hi Team,

 

I tried all of the steps in the order specified and I still have the same issue.

  • install-sdk works
  • gen-sdn-apps works
  • mvn clean install on fresh gen-sdn-apps works and I get hm-app/target/hm-1.0.0-SNAPSHOT.zip
  • mvn eclipse:eclipse works
  • Importing the project works.

 

 

I was fiddling around within eclipse and I found that in some of the created folders (hm-rs and hm-ui) I can see some of the com.hp.of.* libraries, whereas in others (hm-model, hm-bl and hm-api) I cannot see any part of the com.hp.of.* library.

Curiously, I cannot see the part of the API that I need in any folder (namely com.hp.of.ctl.*).

 

I've attached images to help illustrate this for you.

 

 

I've also attached the images of Libraries, Order and Export for you.

 

 

--

Regards,

Matthew Hart

sdnindia
Trusted Contributor

Re: How to install SDN

Hello Matthew,

Since you were successfully able to do  install command (mvn clean install) and generate the zip file in the target directory  and after this you created eclipse project (mvn eclipse:eclipse) so by default in health monitor app files( for e.g. DeviceHealthManager.java ) there will be some import statements

(for e.g. import static com.hp.of.lib.msg.Port.NONE; )which are resolved there automatically in eclipse.

Also you can put import statements for com.hp.of.* and check if DeviceHealthManager.java file still resolves the import.
If this is not the case for your Health Monitor apps files then there is some problem  either with install command or with creating eclipse project.

As per the screenshots shared by you, the file (View from rs and ui i.e. OpenFlowSwitchResourceTest.java)  contains sdn-of-lib-2.0.0.jar as in the referenced libraries(you can see the same in Project Explorer) so you are able to see some com.hp.of.* however the file (View from bl model and api i.e. OpenFlowSwitchManager.java) doesn’t contain any sdn-of-lib-x.x.x.jar file so you don’t see the same imports resolve there.

Since you are using 2.3.5 version SDK so you should include sdn-of-lib-2.3.5.jar .
You can include jars manually as below-
1.    Right click on project ,select properties then java build path
2.    There in library tab you can click add external jars
3.    Then you can specify the path(for e.g.  ~/.m2/repository/com/hp/sdn/sdn-of-lib/2.3.5/ sdn-of-lib-2.3.5.jar)

Please let us know if this helps or you still face the issue.

Thanks,
HP SDN Team

MatthewHart
Advisor

Re: How to install SDN

SUCCESS!!

 

It appears that the M2_REPO environment variable misses a chunk of libraries! Once I manually added the JARs I required, the imports succeeded!

 

The issue now becomes that, even though Eclipse now see's all of the libraries and appears to be happy - when I try to build the project via the "mvn clean install" command, mvn has an error and believes that it cannot find the JARs, even though eclipse now says it's happy.

 

How do I add these JARs into mavens build environment?

 

 

--

Regards,

Matthew Hart

MatthewHart
Advisor

Re: How to install SDN

I managed to find a solution to this by deleting .m2 and putting it in again.

 

There was also an issue with java being on version 1.7.x but javac being on version 1.6.x

 

 

Thanks to everyone for their help on this.

 

 

 

--

Regards,

Matthew Hart

sdnindia
Trusted Contributor

Re: How to install SDN

Hello Matthew,

 

We are glad that your problem is solved.

Please do let us know if you need further assistance.

 

Please feel free to reply incase you have more questions around the same topic or open a new thread if new topic.

 

Thanks

HP SDN Team