ocsinventoryng icon indicating copy to clipboard operation
ocsinventoryng copied to clipboard

Fusion+OCS+GLPI sync VM's problems

Open KB7777 opened this issue 8 years ago • 23 comments

Hello. I am here to ask for a little help with synchronizations of VM's data.

First I run fusioninventory-esx to get infos from my ESXi servers. Second fusioninventory-injector puts the data into OCS Inventory NG. Now the OCS Inventory NG plugin from GLPI synchronize the data from OCS Invertory NG. That works fine except one thing -- it doesn't update informations about VM's from ESXi sad But after manual click "Force Synchronization" the data suddenly appears! I have got over 100 VM's, so it's very big problem for me to force synchronization every time every machine... Could someone help me with this problem? OS -- CentOS 6.8 (fully patched) fusioninventory (agent esx) -- 2.3.18.-1.el6 from epel OCS Inventory NG server -- 2.2RC GLPI server -- 0.90.1 OSC Inventory NG plugin -- 1.2.2 SELinux mode is disabled of course.

I appreciate any help...

Regards.

KB7777 avatar Oct 31 '16 09:10 KB7777

I don't understand. Can you add screenshot for see which link you use to force synchronization ?

tsmr avatar Nov 04 '16 13:11 tsmr

Hello. Here is the screenshot:

2016-11-07 07_17_25

KB7777 avatar Nov 07 '16 06:11 KB7777

In fact you want to ask your ESXI Server for retrieve informations of installed virtual machine ?

tsmr avatar Nov 07 '16 08:11 tsmr

Yes! :)

KB7777 avatar Nov 07 '16 08:11 KB7777

You cannot use at this time OCS Client for that, you must create a task into FusionInventory plugin for ask ESXI Web services.

tsmr avatar Nov 07 '16 09:11 tsmr

But when I use "Force Synchronization" it synchronize well. Why? :)

KB7777 avatar Nov 07 '16 09:11 KB7777

OK. So, do you use ocsng automatic action for planned synchronization ?

tsmr avatar Nov 07 '16 09:11 tsmr

Yes -- cronjob.

KB7777 avatar Nov 07 '16 09:11 KB7777

with ocsfullsync.sh ?

tsmr avatar Nov 07 '16 09:11 tsmr

Yes.

*/5 * * * * root /usr/share/glpi/plugins/ocsinventoryng/scripts/ocsng_fullsync.sh

KB7777 avatar Nov 07 '16 09:11 KB7777

Hum your subject is interesting. But I want to understand.

Which are you VM Provider ? (VMWare ? Xen ? Hyper-V) ?

Which agent have you install on theses servers ?

tsmr avatar Nov 14 '16 08:11 tsmr

Hello.

It is VMWare ESXi 5.0/5.5. Agent is fusion-inventory-esxi 2.3.18.-1.el6 from epel (updated from 2.3.16-1.2.noarch). Agent is installed at one server only and it collects data from ESXi servers using SOAP (http://fusioninventory.org/documentation/agent/man/fusioninventory-esx.html). It works fine. Data at OCS Inventory are correct. Only synchronization from OCS Inventory to GLPI using OCSInventoryNG plugin doesnt work as expected.

Regards.

KB7777 avatar Nov 14 '16 08:11 KB7777

I think you cannot do what you want :

  • You retrieve data from your ESX with fusion (SOAP) So your computer into GLPI is created & managed with Fusion Inventory
  • You haven't any OCS agent in your VMServer.

So OCS cannot retrieve any informations from VMServer.

You must only do that with Fusion Inventory

tsmr avatar Nov 15 '16 09:11 tsmr

Hello

FYI, OCS agent can retrieve Esxi data from SNMP scan. OCS team is working on a standalone Esxi agent

Regards Damien Belliard

damienbelliard avatar Nov 15 '16 14:11 damienbelliard

tsmr, thnx for answers, but I don't understand a little.

If it is as you describe, so why after "Full synchronization" all works fine? Fusion inventory agent esxi puts correct data to OCS Inventory portal.

My computers into GLPI are not managed with Fusion Inventory plugin. I disabled it and it works the same as I described at the first post. It works the same way (not syncing VM's data) no matter I do with OCS Inventory settings, GLPI settings or OCSINventory plugin settings.

I get stucked :(

KB7777 avatar Nov 16 '16 07:11 KB7777

For resume : You send Fusion Inventory esx data to your OCS Server. So when you go to OCS Server administration Web Pages, you see virtual machines linked with your ESX Server ?

If datas are stored into OCS database, so effectively the synchronization.

Have you selected expert mode into OCS Server Setup into the plugin ?

tsmr avatar Nov 16 '16 20:11 tsmr

when you go to OCS Server administration Web Pages, you see virtual machines linked with your ESX Server ?

Yes.

Have you selected expert mode into OCS Server Setup into the plugin ?

Yes.

KB7777 avatar Nov 18 '16 08:11 KB7777

Can you give me a XML for check it ? tsmr[at]thetsmr.fr

tsmr avatar Nov 21 '16 17:11 tsmr

Sent :)

KB7777 avatar Nov 25 '16 08:11 KB7777

I have tested with my plugin master, it's ok for me.

tsmr avatar Dec 21 '16 15:12 tsmr

Hi,

Since June 2015 I use the method you described to inventory my ESXi servers : Fusion inventory esx agent --> OCS file --> transform OCS file --> inject in OCS server --> synchronize whith GLPI using GPLI OCS plugin.

I made some modifications on the fusion inventory agent perl code to have the VM list inventory updated. The issue is with the checksum calculation:

First of all you have to ask the plugin to calculate a checksum 😄 : You have to modify the sub createInventory in file perl\agent\FusionInventory\Agent\Task\ESX.pm and insert commande "$inventory->computeChecksum();" just before "return $inventory;"

sub createInventory {
...
--> insert this row
    $inventory->computeChecksum();
<-- 

    return $inventory;

}

Then you have to modify the checksum calculation itself as it doesn't recalculate when the VM change (bug) : You have to modify sub computeChecksum in file perl\agent\FusionInventory\Agent\Inventory.pm add "VIRTUALMACHINES => 131072," just after "SOFTWARES => 65536,"

sub computeChecksum {
...
    SOFTWARES   => 65536,
--> insert this row
    VIRTUALMACHINES => 131072,
<-- 
...
}

Tell me if this helps 😃

I made other modifications to the code to add CPU data in HARDWARE section and subnet IPSUBNET in section NETWORKS. Don't hesitate to ask if interested.

However I have issue with ESXi servers that migrated from ESXi 5 to ESXi 6. VM data are not updated anymore. Maybe some changes in the SOAP ? I am interested with any news on this topic.

Regards,

Sylvie

SylvieCozic avatar Apr 11 '17 18:04 SylvieCozic

Hello Sylvie,

Other than the checksum issue, that is OCS specific, if you've made some intersting modifications to the esx task on the agent side, feel to to open pull requests on fusioninventory-agent's github repository.

Regards

wawax avatar Apr 11 '17 18:04 wawax

@SylvieCozic It works! Thank you very very very much! :))

KB7777 avatar May 04 '17 12:05 KB7777