wxt9861 / esxi_stats

ESXi component for Home Assistant
MIT License
146 stars 40 forks source link

Backwards compatibility to VM Names instead of just UUIDs (or list UUID in entity attributes) #96

Open EpicLPer opened 9 months ago

EpicLPer commented 9 months ago

Is your feature request related to a problem? Please describe. As of 0.7.0 service calls now require the UUID of a VM instead of just the VM name. This breaks existing scripts/automations.

Describe the solution you'd like Instead of only allowing UUIDs it could be detected (as example by Regex) if the given string is either a UUID or just a simple name, which the script then handles accordingly. In addition to this a service call error could be adjusted in form of "Neither UUID nor VM Name were found".

Describe alternatives you've considered Getting the UUID is not easy to get and requires SSH access to the given host.

Additional context Alternatively the integration could get the UUID from a VM and display it as an entity attribute to make this step easier.

wielhelmus commented 9 months ago

Yes, this breaks my automations as well . thankfully i had a snapshot to revert to.
why only the UUID? vm name is much easier in my opinion.

wxt9861 commented 9 months ago

Are you using vCenter or direct connection to host?

wielhelmus commented 9 months ago

I use a direct connection. I did see that one of the two vm's "hassdb" did make a snapshot . and that the vm without a snapshot and the error is called Home Assistant with capitals.

wxt9861 commented 9 months ago

Can you please run diagnostics and post snippet of the output here?

You can go to Settings > Devices & Services > ESXi Stats > Click on the device > Click on Download Diagnostics

You don't need to post the entire file, just the part with the data from the VM that's having issues

wielhelmus commented 9 months ago

I think this is only possible with the latest version?

wxt9861 commented 9 months ago

Yes 0.7x can do diagnostics

wielhelmus commented 9 months ago

i tried to rename the machine from Home Assistant to home assistant. Unfortunately this didn't help

"home_assistant": { "name": "home_assistant", "vm_name": "home assistant", "status": "green", "state": "running", "uptime_hours": 96.5, "cpu_count": 2, "cpu_use_pct": 9.42, "memory_allocated_mb": 5140, "memory_used_mb": 5164, "memory_active_mb": 2313, "used_space_gb": 77.54, "tools_status": "toolsOk", "guest_os": "Other 2.6.x Linux (64-bit)", "guest_ip": "192.168.20.200", "snapshots": 4, "uuid": "564d8cf0-cc6f-b5ad-fc8a-efa2726b7a30", "host_name": "localhost.fritz.box"

wielhelmus commented 9 months ago

for some reason my update to the latess home assistant version killed the esxi integration. I updated and found out that using the name instead of vm_name solved it for me. So home_assistant for me.