Search code examples
azure-automationazure-log-analytics

Same SourceComputerId in Log Analytics for cloned machines


Recently we had cloned new machines to our system but they are still reporting to Log Analytics with the SourceComputerId property from the source machine (which new ones was cloned from). How to fix it?

We tried to reinstall the agents but it didn't help. This query still returns duplicates.

let duplicates = Heartbeat
| summarize dcount(Computer) by SourceComputerId
| where dcount_Computer > 1
| project SourceComputerId;
Heartbeat
| where SourceComputerId in (duplicates)
| distinct Computer, SourceComputerId
| order by Computer asc

This isn't a big deal for montiroing but we cannot setup update schedule from OMS (Azure Automation) because the new machines are unavailable - Update Solution relies on SourceComputerId (ref link: https://learn.microsoft.com/pl-pl/azure/automation/automation-update-management)


Solution

  • Reinstalling the agent by itself will not solve the problem. This usually happens when the cloned image was not sysprepped correctly. You will need to first sysprep the machine and then reinstall the agent. Detailed steps are documented here:

    enter image description here