VM disk size with Proxmox API is possible #185
-
Hi! So as we know Proxmox VE API does not report used disk size on a VM. I did a bit digging and found that if qemu-guest-agent is installed, that we can get disk size. Still, after agent is installed Proxmox UI does not show the used disk space, but it is available in the API! If you navigate to "api2/json/nodes/NODE_NAME/qemu/VM_ID/agent/get-fsinfo/" you will see mount points that is reported by the VM. Attribute "used-bytes" is actual information about the used size in bytes. There is also attribute "total-bytes", but did not represent actual VM max disk size. This could be added in coordinator.py -> ProxmoxQEMUCoordinator -> before "update_device_via(self, ProxmoxType.QEMU)". Making a variable hddused before, that by default value would be: api_status["disk"] This is not available on all VMs. I have no idea why. Maybe we can implement this and work our way thru qemu-ga version, os and versions that does not report, to fix this together. Let's make this integration more awesome together! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I appreciate the suggestion, but I believe that this would add a layer of complexity to the integration to solve a problem with the Proxmox API, not all users would have the same understanding and understanding as you, so I don't think it's feasible to include this at this time. |
Beta Was this translation helpful? Give feedback.
-
I'm a new user to this integration, and compared to the one built into home assistant, its amazing! I think my issue might be related to the above, but my disk used percentage always shows as 0% for all my VMs, and if I enable the total disk size entity, it shows the size of the disk, as report by proxmox, not whats actually available to the VM. Both VM's have QEMU agents installed, and I selected 'pass through disk information' as part of the hacs setup. |
Beta Was this translation helpful? Give feedback.
I appreciate the suggestion, but I believe that this would add a layer of complexity to the integration to solve a problem with the Proxmox API, not all users would have the same understanding and understanding as you, so I don't think it's feasible to include this at this time.