How to clean the metadata of redeployed Hosts in a Hosted Engine setup

Solution Verified - Updated -

Environment

  • Red Hat Virtualization 3.x, 4.x

Issue

I have re-deployed a Host without cleaning first the metadata and now i can see multiple entries for this Host in:

# hosted-engine --vm-status

Resolution

1. Stop the High Availability Agent on the Host, which was re-deployed without cleaning first the metadata:

     # systemctl stop ovirt-ha-agent

2. Clean its metadata

     # hosted-engine --clean-metadata --host-id=$old_ID --force-clean

3. Start again the ha-agent

     # systemctl start ovirt-ha-agent

4. Verify on this and the rest of hosts of the Hosted Engine environment with:

       # hosted-engine --vm-status

5. Repeat for every Host with the same "issue".


For example, you have Host 5 with two IDs in "hosted-engine --vm-status" output

Hostname : Host05
Host ID : 9

Hostname : Host05
Host ID : 8

and the current ID is 9. You can verify it on Host05 at /etc/ovirt-hosted-engine/hosted-engine.conf
...
host_id=9
...

Follow the above procedure and in the second step run:

# hosted-engine --clean-metadata --host-id=8 --force-clean

Note: RHV 4.x solution: How to undeploy Hosted Engine hosts via command line?

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments