-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GLPI 10.0.17 does not record the IP of the VMs collected with the ESX task. #839
Comments
If the agent obtains the IP address of the VM you should report it into GLPI bugtracker instead. I believe it will be declined since it seems a feature request instead of a bug report, since I don't think this feature exists on GLPI UI before and it's not available on the GLPI 10.0.18 nightly build, so you would need to implement it on your own if you don't have a TecLib' subscription. |
Hi @eduardomozart, yes, but in the changes brought by version 1.12 of the glpi agent it is indicated that the format is compatible with version 10.0.17 of GLPI. esx: It doesn't make much sense to have functionality that you can't take advantage of. |
as said here, the feature also requires an option in GLPI to be enabled. As you answered here, you have enabled it, so it seems this is maybe a GLPI server problem. But you're also telling you still run inventory locally in VM or containers. So you may have a concurrency between local inventory and this feature. You must also know remote inventory of vm generated by RemoteInventory task will be considered as local inventory in GLPI. And this is normal are they were made running checks into the OS system itself. This means such kind of inventory will also be concurrent to the feature. I really don't know how concurrency between this feature and local inventory import can perform, and I won't be surprised if this generates side-effect issues. Generally, I won't advise to use this feature if you also generates local inventories from VMs. You should better choose between running local inventory and use this feature. Another point, you are showing a screenshot where you expect to see the ip if column, but sorry, I don't understand that language, so I can't confirm you if the ip should be seen in that column. Can you translate the column name into english ? |
Hi @g-bougard, I am clear that performing a local inventory and having the "Create computer for virtual machines" option enabled can be a problem. In my case I will do local inventory later, it is not possible for now, in the meantime I at least wanted to do the inventory for the ESX task. With version 1.11 of the agent it did not obtain from the ESX task either the Operating System or the IP of the VMs. Now with v1.12 I get both the O.S. as the IP, but in GLPI the IP is not registered, however the O.S. is registered. I think it is because to register the IP it is necessary to associate it with a network interface and that is not obtained by the VCenter ESX task. |
Okay, this reminded me there was a PR from @stonebuzz which has still been merged in GLPI but will only be available in next release and this PR should probably fix your problem. Here's the PR: glpi-project/glpi#18746 You can try to apply on your server the changes on src/Inventory/Asset/InventoryNetworkPort.php from this PR. |
Hi @g-bougard, I applied the patch but it did not solve the problem, GLPI does not record the IP address of the VCenter VMs collected with the ESX task with the glpi v1.2 agent, although the agent does collect it. I think it is because of what I already mentioned, an IP has to be associated with a network interface but the ESX task does not obtain it from the VM, so it is not created in GLPI. |
do you have any error that could be related in the GLPI php-warnings.log file ? Do you see the ip as management ip on computer network ports tab in GLPI ? This may just be an UI issue where the expected ip doesn't appear in the search results but it does in the network ports. |
Hi @g-bougard, in php-errors.log, this error repeats when I run the glpi agent: [2025-01-31 11:50:41] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "operatingsystems_id" in /var/www/html/glpi/src/Inventory/Asset/OperatingSystem.php at line 184 No network interface is created in GLPI |
would you have a dictionary rule that would change the OS name? Check that you don't have an inconsistent rule (assign N/A) Best regards |
Hi @stonebuzz, I don't have any dictionary rules, it is from a default installation of glpi with no additional rules configured. Best regards |
Can you post here related inventory file ? |
Hi @stonebuzz, I cannot send the inventory files because they have confidential information. I send you an extract where a VM appears with the Operating System and the IP address. |
Hello guys, Here I opened the UniFi OS Console machine, no IP is shown: Also find an odd behavior, as ESX inventory seems to create a new machine instead of updating the existing one: I believe it happens because the GLPI Agent is nativelly installed into Here's my inventory files: server02-agentless-esx-inventory.json |
thank you for the sharing, I really don't know why you have assets duplication here. Do you import manually via GLPI UI in Administration section ? If yes, do you have the same problem when injecting the inventory while using glpi-injector script ? If not, you may have to refresh your GLPI session by logging out and logging in so the UI import works as expected. Regarding the duplication problem because using import from ESX at the same time than import from a local agent, this is realted to a bug from ESX around UUID support... even a very old which caused a lot of trouble to a lot of people. Their poorly managed to report UUID to the vm system a long time ago and we are still have to handle the consequences. Shame on them... 😒 If you check your esxi01.json inventory, you'll see the VM with "564d4cbc-c6a9-1969-3fee-fa0f3887b6a5" as UUID and you'll see "BC4C4D56-A9C6-6919-3FEE-FA0F3887B6A5" as UUID in your computer inventory. There's a big difference on the first 8 hexadecimal digits... the bytes are in reversed order. 😒 But you probably still can enhance the situation: check Computers import rules and try to play with their order... As serialnumber is the same in the two inventories, you can manage to have the related rules triggered before the S/N+UUID ones, for example you can try to disable import and update rules by serial+UUID. But be aware and warned this can involve other problems. Try this change as your own risk. You should definitively choose between local inventory of ESX VM and VM creation/update from ESX host inventory. This feature has been developed for people who won't run local inventory in the sens of GLPI (as inventory generated by RemoteInventory task are also seen as local inventory by GLPI). |
Hello @g-bougard, thank you for your response and digging into this. I'm not sure why the wrong UUID reading, I believe it maybe a bug with GLPI Agent itself instead of ESXi because it reports the UUID correctly on MOB (vSphere API) which I believe where ESX remote inventory gather information from: On the VMX file of the VM it also doesn't seems to be inverted: Also, there's the "duplicate VM" error on SQL above, so I believe it's importing the UUID correctly but there should be some buggy on GLPI core itself maybe? Digging into that SQL message maybe lead us to the main issue. I imported them through GLPI Agent itself: simply created an ESX task and run it, I didn't used the GLPI-Injector or manual import through GLPI UI. I do believe that local inventory (aka. GLPI Agent installed) is the best approach but I have on my homelab some VMs (like ClearPass and Aruba Mobility) which are based on RHEL 8 but they are appliance with their console blocked (I'm unable to install GLPI Agent on them), so a hybrid approach would be great, but I think it would be better handling those scenarios through rules as they aren't common, because how we could handle when not overriding a VM inventory using ESX info when GLPI-Agent is installed for clients with no clean-up inactive GLPI-Agents? |
Hi @g-bougard, I have 400 VMs hosted in the VCenter, in a few of them the agent is installed (I cannot install the agent in all the VMs), so I go to the inventory through ESX to the VCenter to at least have them inventoried with the minimum data of the majority of VMs. Local inventory using the GLPI agent gives much more information than with the ESX task. In GLPI there is a problem because in the case of VMs that have the agent installed, two Computers are created for the same VM when executing the ESX task, I suppose because the UUID of the Computer created by the agent is different from the UUID of the Computer created by the ESX task. For example, for the GLPIPre VM: |
About UUID, the problem is not what you can find for a VM on ESX side. GLPI-Agent also finds that value during ESX host inventory. The problem is ESX provided a wrongly encoded UUID via the Bios. Since years, Operating systems see wrong UUID for ESX vms. On the local OS, glpi-agent gets UUID as it does for physical computers. Should do we do differently for ESX ? No, this is not glpi-agent role to assume UUID can be wrong. This is a really old and often reported problem with VMware ESX. Other virtualization systems don't make such a mistake. For your other question, maybe a hybrid approach would be great, but this won't be cost effective to develop. I agree having dedicated rules glpi-server side would probably be more appropriate. A simple way of doing would be to keep a field on asset telling which task generated an inventory. With such a data, GLPI could be able to decided to not update an asset with an inventory from esx task if an inventory from inventory task was still integrated. Actually, the only data we keep is which agent provided the datas, not the task used to generate datas. |
Yes, this is what I explained an hour ago. As I said, this problem is only related to ESX. Other virtualization systems, don't have that issue. You can use the rule I told about to not use UUID during asset look up. Maybe if you have only few devices, you can create a rule to just deny the update from ESX when UUID starts with "420717a6-" and only count on locally installed glpi-agent to update that asset. You can also put the full UUID in blacklist. You'll also have to remove the duplicated light entry for that asset. I still don't know why ip is not integrated. @stonebuzz do you have time to take a look ? |
I know it's a bug from ESX, but if it's a known bug, I believe that we could create a workaround to circumvent that because even if it be fixed into the near future, users that are stuck with older ESX versions (which is common since most major ESX upgrades requires a hardware upgrade) would still be affected. I can try to take it a look, but if you wouldn't be willing to accept some PR into that way please let me know so I won't invest time on it. |
Don't loose your time on such a feature. I don't want to have to maintain ESX bug support in glpi-agent (and indeed there's still some kind of such support on which we are just afraid to have update to do without really knowing if this won't involved more and more problems...). About the field, you would always have the choice to manually revert how glpi would expect datas are coming from. Of course, this is not optimum, but nothing is fully optimum in such a context. |
Bug reporting acknowledgment
Yes, I read it
Professional support
None
Describe the bug
Hi @g-bougard,
with version 1.12 of the agent and version 10.0.17 of glpi, the agent obtains the IP address and operating system of the virtual machines hosted on the VCenter server, GLPI registers the operating system in the VMs but not the IP address, the field remains empty.
GLPI 10.0.17 is assumed to support the v1.1.36 inventory format scheme. Is there something to configure in GLPI?
LOG GLPI AGENT
GLPI 10.0.17
Greetings
To reproduce
Expected behavior
Register the IP in GLPI.
Operating system
Linux
GLPI Agent version
v1.12
GLPI version
10.0.17
GLPIInventory plugin or other plugin version
GLPI Inventory v1.4.0
Additional context
No response
The text was updated successfully, but these errors were encountered: