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

Wagner, Richard (Cognizant) 66 Reputation points
2023-11-02T20:13:43.7933333+00:00

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.
3,247 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,870 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. David Broggy 5,721 Reputation points MVP
    2023-11-03T02:52:19.7566667+00:00

    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.