Create a backgroud thread to register static list of machines.

DO NOT MERGE

Depends on #2250.  It will keep retrying due to the bug in apiserver.  Also extend tests to cover error cases.

Fix #2181