I have OpenNebula HA Cluster 6.0.0, Yesterday I added a new KVM host, then tried to deploy a new virtual machine on it (the virtual machine was stuck in the boot state, I deleted it). Now OpenNebula in the Infrasrtucture → Hosts section shows 1 VM on this host, although in fact there are no existing virtual machines on it.
Now I can’t remove this KVM host.
Error message is “Host still has associated VMs, aborting delete.”
Try running onedb fsck to fix database inconsistencies. If the VM is not listed on the VM pool but is referenced on the host template after running fsck you can manually edit the host template with onedb update-body <host_id> to manually remove such reference. Backup the database before doing so as manual database altering operations are inherently risky.