Fix the issue for two instances sometimes after booting vm

1. Add debug logs to sync code
2. fix an issue found the new added instance scg_id is None, there will
be an AttributeError thrown. 

Closes-Bug: #1391875
Change-Id: Idaa6ec9982e915d8fec0e2e6d32d5bb5e49a674f
(cherry picked from commit 7a82ac4a321052b1461eb5857f581d2fa16de7bc)