Forum Discussion

rcole-radix's avatar
rcole-radix
Copper Contributor
Nov 17, 2021

Should I provision the VM Agent when creating a VM to be used as the basis of a VM Image Definition?

Hello,

 

My goal is to create a VM Image Definition that has some initial software installed on it. I want to be able to use this VM Image Definition to subsequently create VMs using this same VM Image Definition so that we don't have to install this base software every time.

 

When provisioning a Windows VM, the VM automatically has the Azure VM Agent installed on it.

 

My question is: Should I include this Agent in my VM Image Definition?

 

I ask this because I see that when provisioning a VM via ARM template, you can disable the auto provisioning of the Agent.

 

I also ask this because wouldn't the Agent get installed on a VM provisioned from an Image Definition anyway? So the Agent wouldn't necessarily be needed in the Image Definition? Or would it?

 

I've looked over various docs pages but haven't seen a recommendation regarding the Agent software on an Image Definition.

 

We've had issues recently with our VMs not being able to report health metrics and such to Azure Monitor, Security Center, etc. I'm wonder if my current VM Image Definition, which has the Agent installed on it, is somehow carrying along bad Agent configuration from that initial VM used to create the original Image Definition of mine.

 

Thanks!

3 Replies

  • Seshadrr's avatar
    Seshadrr
    Iron Contributor
    Azure Virtual Machine Agent (VM Agent) interacts with the Azure Fabric controller, which will enable the Post-deployment configuration of VM. The Azure VM Agent for Windows is automatically upgraded on images deployed from the Azure Marketplace.

    Note: If you have installed the agent manually or are deploying custom VM images you will need to manually update to include the new VM agent at image creation time.

    I would suggest you to while preparing the custom image with specified software along with the latest VM agent to communicate the fabric controller and also necessary guest logs collection.
  • How frequently you are updating your base Image dictates if you should install the agents on the base image or not . If the process is not frequent then don't install the VM agents on the base image and use ARM template to install that way you are up to date with the agents version. The common problem that I see we update images with agents and they are never updated when new version is released by Microsoft refer my URL on understanding agents and best best practices https://techcommunity.microsoft.com/t5/azure-compute/understanding-azure-vm-agents-recommendation/m-p/2860650
    • rcole-radix's avatar
      rcole-radix
      Copper Contributor
      OK. This is what I've done and it seems to be working well. We won't be updating the base image very frequently.

Resources