I am currently using the Cloudera Manager API to automatically register hosts into Cloudera Manager while bootstrapping. However, there is a bug I have encountered where hosts that are registered via the API show up twice, once as a live host and once as a dead host. This issue only occurs for Flume hosts.
Here is a screenshot showing the issue (some sensitive info removed):
This typically occurs if you end up overwriting the /var/lib/cloudera-scm-agent/uuid file. To resolve the issue, you can delete the duplicated host (if no roles are on it, this is straight forward) or fix the UUID file with the right value and restart the agent (if there are roles on the now-bad host, but none on the new dupe host).
What API calls are you using that reproduces this? Ideally adding a host twice via the API shouldn't work, but perhaps if you can share the reproduction code it will help us analyse the underlying issue further.