How can I install the Azure MOnitor Agent on thousands of VMs even if many are turned off?

Wagner, Richard (Cognizant) 66 Reputation points

Hello, we have over 40,000 VMs used for Citrix virtual desktop. When a virtual desktop is idle for 30 minutes Citrix shuts down the VM for cost purposes. We have regions is Europe, US and Asia. I need to monitor how many VMs are up at any given time so I created a log analytic workspace in each region and I created a data collection rule in each region to send heartbeat data to the LAW and then I can query uptime data.

When I configured my data collection rule I checked all the subscriptions for a particular region and azure installed the azure monitor agent but it didn't install them on any VMs that were turned off.It shows all the VMs are connected to the Log Analytic WorkSpace but it shows only the VMs that were turned on during the creation of the DAta Collection rule as having agents installed and sending data. During the US daytime most offshore VMs are turned off so what is the best way to get the agent installed? I can disassociate each VM that was turned off, turn them on and reassociate the VM with the Data Collection Rule but that would take forever. Should I do a policy to install the agent?

Since I have thousands of VMs that need the agent I can't log into a VM and manually run the agent installer since that would also take forever. I need way to install the agent on thousands of VMs regardless of power state. Thanks!

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,488 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
6,350 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. David Broggy 5,416 Reputation points MVP

    Hi Richard,

    Unfortunately the VM will need to be powered up to install the agent.

    I may have misunderstood, but you shouldn’t have to apply the DCR at the VM level, you apply it at the subscription level so when the server is powered up the AMA agent is automatically applied for all VMs in the subscription or subscription group.

    Good luck.

    0 comments No comments