How to add a new VNF Monitor

Asked by Chip Boling

I have written a monitor for a VNF and want to install it after tacker has already been installed. Is this possible?

I am running on Liberty with the stable/tacker installed (not devstack) and Tacker is working great for me. I located information on how to add a monitor before your install tacker.

     o Create a sudirectory under tacker/vm
     o Modify the setup.cfg by adding to the tacker.servicevm.monitor.drivers line

But this is before running the install.

So far I have tried:

     o add monitor to the /etc/tacker/tacker.conf in the [servicevm] section
     o manually copy over the code to the proper python location on server ( /usr/lib/pyton2.7/site-packages/tacker/vm) for my install
     o restart the tacker service

When tacker starts up (with debugging turned on), I notice that tacker.service and tacker.openstack.common.service show entries for my new monitor (radius) as in.

    grep -i radius /var/log/tacker/tacker.log
    2016-05-02 14:48:17.453 22538 DEBUG tacker.service [-] servicevm.monitor_driver = ['ping', 'http_ping', 'radius'] log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2237
   2016-05-02 14:48:17.482 22538 DEBUG tacker.openstack.common.service [-] servicevm.monitor_driver = ['ping', 'http_ping', 'radius'] log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2237

but that is about it. If I do a similar search for either the ping or http_ping service, it seems to output more infomation leading me to believe I've missed a step. For instance:

  grep -i http_ping /var/log/tacker/tacker.log
  2016-05-02 14:48:17.406 22538 DEBUG stevedore.extension [-] found extension EntryPoint.parse('http_ping = tacker.vm.monitor_drivers.http_ping.http_ping:VNFMonitorHTTPPing') _load_plugins /usr/lib/python2.7/site-packages/stevedore/extension.py:156
  2016-05-02 14:48:17.409 22538 INFO tacker.common.driver_manager [-] Registered drivers from tacker.servicevm.monitor.drivers: ['http_ping', 'ping']
   2016-05-02 14:48:17.442 22538 DEBUG tacker.service [-] monitor_http_ping.port = 80 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2237
  2016-05-02 14:48:17.442 22538 DEBUG tacker.service [-] monitor_http_ping.retry = 5 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2237
  2016-05-02 14:48:17.442 22538 DEBUG tacker.service [-] monitor_http_ping.timeout = 1 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2237
  2016-05-02 14:48:17.453 22538 DEBUG tacker.service [-] servicevm.monitor_driver = ['ping', 'http_ping', 'radius'] log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2237
  2016-05-02 14:48:17.472 22538 DEBUG tacker.openstack.common.service [-] monitor_http_ping.port = 80 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2237
  2016-05-02 14:48:17.473 22538 DEBUG tacker.openstack.common.service [-] monitor_http_ping.retry = 5 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2237
  2016-05-02 14:48:17.473 22538 DEBUG tacker.openstack.common.service [-] monitor_http_ping.timeout = 1 log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2237
  2016-05-02 14:48:17.482 22538 DEBUG tacker.openstack.common.service [-] servicevm.monitor_driver = ['ping', 'http_ping', 'radius'] log_opt_values /usr/lib/python2.7/site-packages/oslo_config/cfg.py:2237

Any suggestions besides perhaps running setup again?

Question information

Language:
English Edit question
Status:
Solved
For:
tacker Edit question
Assignee:
Bob Haddleton Edit question
Solved by:
Chip Boling
Solved:
Last query:
Last reply:
Revision history for this message
Bob Haddleton (bob-haddleton) said :
#1

Hi Chip:

You might try adding the driver to setup.cfg in the tacker directory and re-run python setup.py install and then restart the server.

There are some internal changes that get handled by the setup process, like modifications to entry_points.txt, which may be required for the server to find everything it needs for the new driver.

Hope this helps

Bob

Revision history for this message
Chip Boling (chip-bcsw) said :
#2

Thanks, I will give that a try (but might not be until Friday)

Revision history for this message
Chip Boling (chip-bcsw) said :
#3

I went ahead and located the entry_point.txt file and added my driver entry point and restarted tacker and it successfully picked up my new monitor. Thanks for the advice.

For anyone who else needs this, here is a rough series of steps I when through to add a new VNF monitor after you have already installed tacker (at least on Liberty).

For my service, it monitors RADIUS and is composed of the files __init__.py and radius_monitor.py

My setup.cfg [tacker.servicevm.monitor.drivers] line is:

    radius = tacker.vm.monitor_drivers.radius.radius_monitor:VNFMonitorRADIUS

1. Move your monitor driver files into a subdirectory on your controller where tacker is installed and place them in a the
     proper tacker/vm subdirectory. My tacker installation was located in /usr/lib/python2.7/site-packages/tacker/vm/monitors

    $ mkdir /usr/lib/python2.7/site-packages/tacker/vm/monitors/radius
    $ cp __init__.py radius_monitor.py /usr/lib/python2.7/site-packages/tacker/vm/monitors/radius/

2. Edit /etc/tacker/tacker.conf and add your monitor driver:

     [servicevm]
     ...
     monitor_driver = radius

3. Locate you tacker entry_point.txt files and add your setup.cfg [tacker.servicevm.monitor.drivers] line to the
    [tacker.servicevm.monitor.drivers] section. You will probably see the ping and http_ping lines there already.

4. Restart the openstack tacker service

5. If you have DEBUG turned on, you can grep your /var/log/tacker/tacker.log file and search for your monitor
    driver name (radius in my case).

    You should see a 'stevedore.extension' line with 'EntryPoint.parse' with your driver's name in it
    If you have parameters, you should see several 'tacker.service' and tacker.openstack.common.service' lines listing those parameters.
   And finally a tacker.openstack.common.service line containing 'servicevm.monitor_driver' that prints a list of monitor drivers it knows of.

Hope this helps.

     - Chip Boling

Revision history for this message
Bob Haddleton (bob-haddleton) said :
#4

Hi Chip - thanks for the writeup of your steps. If it's OK with you I will add this information to a devref in the Tacker documentation for future reference.

Revision history for this message
Chip Boling (chip-bcsw) said :
#5

That would be great.

On Tue, May 3, 2016 at 8:04 AM -0700, "Bob Haddleton" <email address hidden> wrote:

Your question #293125 on tacker changed:
https://answers.launchpad.net/tacker/+question/293125

Bob Haddleton posted a new comment:
Hi Chip - thanks for the writeup of your steps. If it's OK with you I
will add this information to a devref in the Tacker documentation for
future reference.

--
You received this question notification because you asked the question.