Freigeben über


Install the VM Agent on an existing Azure VM

The Windows Installer MSI package to install the VM Agent on an existing Azure VM is available for download at the following location:

https://go.microsoft.com/fwlink/?LinkID=394789&clcid=0x409

The MSI must be run from an elevated command prompt.

After installing the VM agent, you must also use Azure PowerShell to update the ProvisionGuestAgent property so Azure knows the VM has the agent installed. This is also documented on MSDN at Manage Extensions.

$vm = Get-AzureVM –ServiceName <cloud service name> –Name <VM name>
$vm.VM.ProvisionGuestAgent = $true
Update-AzureVM –Name <VM name> –VM $vm.VM –ServiceName <cloud service name>

Now if you run Get-AzureVM again, the GuestAgentStatus property should be populated instead of blank:

Get-AzureVM –ServiceName <cloud service name> –Name <VM name>

GuestAgentStatus:Microsoft.WindowsAzure.Commands.ServiceManagement.Model.PersistentVMModel.GuestAgentStatus

Updating the ProvisionGuestAgent property is only necessary if the VM is already running in Azure and the agent was not provisioned when the VM was created. When creating a VM from an image (including from custom image), by default the VM agent is installed and that property is updated automatically.

Note that when creating a VM from an existing, specialized VHD (sysprep was not run generalize it), selecting Install the VM Agent in the portal only sets the property and does not install the agent. In that scenario you must install the agent after the VM is provisioned in Azure.

Comments

  • Anonymous
    April 15, 2014
    Installed the tool and ran the Powershell commands as instructed, but the background hasn't shown yet (despite reboot). The WindowsAzureGuestAgent service is running, but the Azure Portal doesn't reflect the extension as well.

  • Anonymous
    May 01, 2014
    The MSI install freezes at configuring services (this may take a few seconds). Is there a way to confirm the service started anyway from services.msc?

  • Anonymous
    June 20, 2014
    Try running it from an elevated command prompt. I've updated the post to reflect an issue we've found related to elevation.

  • Anonymous
    July 31, 2014
    The comment has been removed

  • Anonymous
    September 08, 2015
    i am facing the same problem with linux vm. i want to know how to update/ install VM agent and extension. please add a solution ASAP. Thank you in advance.

  • Anonymous
    December 14, 2015
    Hi @Craig Landis, I installed the agent for which I need to perform the backup. what could be a possible reason that when I try to set the property above, I get a no default subscription set error. I try the select-azuresubscription - default - subscriptionname "mysubscriptionname" command but it says that it did not find any subscription with that name. On the other hand, another machine shows up in the discovery of the VMs. Surprisingly, I get the same errors on it as well. But it still does appear under the list of discovered VMs. What exactly am I missing on the other VM?

  • Anonymous
    February 17, 2016
    Greetings to all, I'm getting the following error after Update-AzureVM: Update-AzureVM : Networking.DeploymentVNetAddressAllocationFailure : Unable to allocate the required address spaces for the deployment in a new or predefined subnet that is contained within the specified virtual network. Is it required that the VMs are stopped for the update? Thanks in advance

  • Anonymous
    February 24, 2016
    Found a solution to this using the new management portal - download the agent installer from the link provided on the new Azure Management Portal - the link will appear when you try to pick an extension to install for the first time. Install the Agent on the VM (I just right clicked install on the MSI file once downloaded logged in as administrator profile). Then install the BGInfo extension from within the new Management Portal - this will in effect finalize the VM Agent installation rather than having to use the powershell script above. Bit of a hacky workaround but did the job.