Hi,
Since some days, I was working on a new arbiter module : the vmware host->VM
automatic host dependency creation. In fact, the module is far more generic
than just this. It's a generic "hot link dependencies" module.
It read a mapping file (simple json format) with son->father links. It call
an external script at an interval, and the one I wrote is a VMWare mapping
one. It use the check_esx3.pl (that all ESX admin should have) plugin and
generate the mapping file. When this file is changed, the module reload it,
create new links and delete old ones. So when you VMotion a virtual machine,
in the next pass, there will be a new link and a delete of the old one in
the scheduler that manage it :)
Of course like all module it's totally optional, but I think most ESX admin
will be happy (like me :) ).
The definition is very easy :
define module{
module_name VMWare_auto_linking
module_type hot_dependencies
mapping_file /tmp/vmware_mapping_file.json
mapping_command /usr/local/shinken/libexec/link_vmware_host_vm.py
-x '/usr/local/shinken/libexec/check_esx3.pl' -V 'vcenter.mydomain.com' -u
'admin' -p 'secret' -r 'lower|nofqdn' -o /tmp/vmware_mapping_file.json
mapping_command_interval 60 ; optionnal
mapping_command_timeout 300 ; optionnal
}
So here, it will call the script
/usr/local/shinken/libexec/link_vmware_host_vm.py with a listing of the
vCenter vcenter.mydomain.com and generate the mapping file
/tmp/vmware_mapping_file.json.
It look at the file modification time each second. This command can also be
launch by an external cron of course.
So if you want to wrote a script that do this for XEN server, all you need
is to generate a json file with all the mapping. I didn't wrote the doc
about this, but you can look in the test file for it, the format is very
very easy :)
There also now external commands for adding/deleting such links :)
(ADD_SIMPLE_HOST_DEPENDENCY;son;father and DEL_HOST_DEPENDENCY;son;father)
if you do not want to call this module but call it from an UI for example.
Jean
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel