fusioninventory / fusioninventory-agent

FusionInventory Agent
http://fusioninventory.org/
GNU General Public License v2.0
252 stars 125 forks source link

No virtualization detected with Proxmox/Debian 10 #984

Open redfish8 opened 2 years ago

redfish8 commented 2 years ago

Hi, I have a Proxmox environment running under Debian 10, when the inventory runs the debug shows :

... [debug] Running FusionInventory::Agent::Task::Inventory::Provider [debug] Running FusionInventory::Agent::Task::Inventory::Virtualization::Lxc [debug] Running FusionInventory::Agent::Task::Inventory::Virtualization::Qemu [debug] [http client] Using Compress::Zlib for compression...

But no vms are found, I think the issue is that on that hypervisor the command to list the vms is qm and not qemu|kvm|qemu-kvm|qemu-system as I found in FusionInventory::Agent::Task::Inventory::Virtualization::Qemu.

Any idea how to make it work ?

Thanks

ddurieux commented 2 years ago

You have try to add qm in the list in FusionInventory::Agent::Task::Inventory::Virtualization::Qemu to see if it works ?

redfish8 commented 2 years ago

I added the qm command in lib/FusionInventory/Agent/Task/Inventory/Virtualization.pm 20 : canRun('qm') || 80 : next if $process->{CMD} !~ /(qm|qemu|kvm|qemu-kvm|qemu-system\S+) .*\S/x;

I have now two vms shown in the glpi Virtualization tab which is correct for this host, but the other data are wrong :

List of virtualized environments Name | Comment | Automatic Inventory | Virtualization System | Virtualization Model | State | UUID | Processors Number | Memory (MB) | Machine N/A | | Yes | qemu | qemu | running | | 1 | 0 N/A | | Yes | qemu | qemu | running | | 1 | 0

The correct output is qm list VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID
727 debian10 stopped 4096 2.00 0
147217984 rdb stopped 16384 2.00 0

I guess more work has to be done on Qemu.pm to get and parse correctly the qm output, I'm not a programmer but I will try.

Thank you for your fast reply

ddurieux commented 2 years ago

ok, so qm is qemu or other?

redfish8 commented 2 years ago

qm is a proxmox command as it's written here it is kvm specific. In the graphical interface the vms are showed as type "QEMU". I'm a bit new to that environment, I apologize if my feedback is not clear enough.

ddurieux commented 2 years ago

I never use it, that's why I ask :D I will read the documentation

redfish8 commented 2 years ago

Thanks a lot, I'm available for testing in case.