MySQL host record disappeared

My MySQL table got corrupted and lost from host_pool a host record. This caused opennebula to not dislay my host but wouldn’t allow me to readdit throwing error that host with that name already exists (not that I wanted to, I wanted to recover it).

What I did next is that I connected to mysql and duplicated a host record and changed oid and name, trouble is now that it reports that it has the same VM’s as the host that I duplicated. Is there a way to manually force a resyncronization for that host ?

I deleted /var/tmp/one on the problematic node and executed onehost sync --force on frontend, unfortunately the host still doesn’t have attached the VMs that it should have, instead it displays the VMs from the host I duplicated. I updated the body in host_pool with the correct VM ids and someway it adds them back :frowning:

This is the body of the host:


The correct VMs are reported as zombies.

If I remove a host, will VMs suffer or get removed ? I’m thinking of removing the troubled host and add it back but the VMs are in production and I want to make sure nothing bad happens to them.


I suspect you are meddling with the database contents with opennebula still running, and that’s why it complains about the name already taken, and why the host VMs are added back.

You can try the onedb fsck tool to see if it fixes the list of VMs for your hosts:


@cmartin You are totaly right!. onedb fsck also fixed my issue with the host, if only I knew of it before :frowning:

Command line works just fine now, sunstone on the other hand doesn’t show any data anymore even after restarting opennebula and opennebula-sunstone. nothing in the logs either, I’ll keep playing around, maybe I can fix it.

Thanks @cmartin for all your help!

Actually, I can see now sunstone works but with ~60s delay until it gets results wherever I go (viewing hosts, dashboard data, VM details, etc).