Featurebranch/feature-requisition-vcenter
Subscribe

From OpenNMS

(Difference between revisions)
Jump to: navigation, search
(Requisition police)
Line 17: Line 17:
  
 
   $HOME/.m2/repository/com/vmware/vijava-520110926.jar
 
   $HOME/.m2/repository/com/vmware/vijava-520110926.jar
 +
 +
Also missing is sblimCIMClient. You can download the sourcecode from here: http://sourceforge.net/apps/mediawiki/sblim/index.php?title=CimClient
 +
You have to unpack the tar-file, build it via ant, and add it to your local maven repository.
 +
 +
  # ant package
 +
  # mvn install:install-file -Dfile=cim-client/sblimCIMClient.jar \
 +
    -DgroupId=org.sblim.wbem -DartifactId=sblimCIMClient \
 +
    -Dversion=1.17 -Dpackaging=jar
 +
  # mvn install:install-file -Dfile=cim-client/sblimCIMClient.jar \
 +
    -DgroupId=org.sblim.slp -DartifactId=sblimSLPClient \
 +
    -Dversion=1.17 -Dpackaging=jar
  
 
After this step it is possible to compile and assemble OpenNMS in the proper (hopefully) way.
 
After this step it is possible to compile and assemble OpenNMS in the proper (hopefully) way.

Revision as of 13:08, 28 July 2012

Contents

Requisition from VMware vCenter

This prototype is a proof-of-concept and has the use case in mind to provide virtual machines from VMware vCenter into OpenNMS. It should help to allow an easy manageable workflow to provide virtual nodes automatically in the network management. VMware vCenter provides a set of web services to allow access to virtual machines and the hosts underneath. This integration prototype covers the following functions:

  • Provide all virtual machines as nodes from vCenter
  • Determine the IP address from the virtual machine. Hint: This is only possible if vmware-tools are installed!
  • Allow the vCenter administrator to filter on an customized attribute in the vCenter to provision this node in OpenNMS or not
  • Provide a read only user for vCenter with less permissions as possible to provide virtual machine informations in OpenNMS
  • Use the VMware SDK API to retrieve virtual machine information

Build issues

The code can be checked out from the public git repository. The feature-branch is named origin/feature-requisition-vcenter. The current implementation is based on VMware VI (vSphere) Java API hosted on SourceForge. This API isn't provided by any central maven repository, so you have to download and install this jar-dependency manually with the following command:

 mvn install:install-file -Dfile=<path-to-vijava520110926.jar> -DgroupId=com.vmware \
 -DartifactId=vijava -Dversion=520110926 -Dpackaging=jar

There should be now a file in

 $HOME/.m2/repository/com/vmware/vijava-520110926.jar

Also missing is sblimCIMClient. You can download the sourcecode from here: http://sourceforge.net/apps/mediawiki/sblim/index.php?title=CimClient You have to unpack the tar-file, build it via ant, and add it to your local maven repository.

 # ant package
 # mvn install:install-file -Dfile=cim-client/sblimCIMClient.jar \ 
   -DgroupId=org.sblim.wbem -DartifactId=sblimCIMClient \
   -Dversion=1.17 -Dpackaging=jar
 # mvn install:install-file -Dfile=cim-client/sblimCIMClient.jar \
   -DgroupId=org.sblim.slp -DartifactId=sblimSLPClient \
   -Dversion=1.17 -Dpackaging=jar

After this step it is possible to compile and assemble OpenNMS in the proper (hopefully) way.

Requirements vCenter

To get information from vCenter you have to configure a user. Mostly it is a local account on the Windows box, where vCenter is running. It is just necessary to have read only user to get the information. It should be possible for OpenNMS to have access to

 https://your-vCenter/sdk

OpenNMS provisiond configuration

To configure the new vmware handler you can create the following configuration.

 <requisition-def import-name="vmware-requisition" \
   import-url-resource="vmware://<user>:<pass>@<vcenter-host>">
   <cron-schedule>0 42 23 * * ? *</cron-schedule> 
 </requisition-def>

This configuration will catch every day at 11:42 pm *ALL* virtual machines into OpenNMS. The provisioning requisition is named as

 vmware-<ip-vCenter>

To restrict the import you can add a customized attribute to your virtual machine in vCenter called:

 Key: "OpenNMS-Import" with an value "yes"

You can use this attribute to have control over the provisioning in OpenNMS as vCenter admin without any idea of OpenNMS :)

 <requisition-def import-name="vmware-requisition" \
   import-url-resource="vmware://<user>:<pass>@<vcenter-host>/?key%3DOpenNMS-Import&value%3Dyes">
   <cron-schedule>0 42 23 * * ? *</cron-schedule> 
 </requisition-def>

With this configuration only virtual machines with this customized attribute will be provisioned.

Caveat

Sorry, there is - this is the result of a one day Hackathon at the University of Fulda. So the current prototype has the following restrictions:

  • The DNS requisition does work anymore, we had to rework the URL Handler. There could be only *ONE* UrlHandler so we had to make a decision ;)
  • There is *NOT* only one JUnit test

Improvements

  • It is currently quite hard to register new UrlHandler, I guess this could also be Layer-8 problem
  • It could be a good idea to have UrlHandler as dedicated maven modules to handle dependencies in a better way

Credits

A big big thank you to Christian Pape who worked out the Java stuff with VI-Java API and vCenter and helped us with the integration in OpenNMS._indigo 13:38, 4 January 2012 (EST)