VM Agent available for Azure VMs

The VM agent for Windows Azure Virtual Machines is now installed by default when creating new VMs in the management portal or with Azure PowerShell (February release 0.7.3). Currently the BGInfo extension is enabled by default which displays VM information on the desktop using the BGInfo tool, and additional VM agent extensions are planned for release in the near term.

If you do not want the VM agent installed, you can use the From Gallery method in the portal instead of Quick Create and uncheck the VM Agent check box that is selected by default. To prevent it from being installed if you are creating a VM with Azure PowerShell you would use Add-AzureProvisioningConfig -DisableGuestAgent with New-AzureVM.

The agent is installed to C:\WindowsAzure and extensions are installed in C:\Packages. There is no entry added to Programs and Features for it when it gets installed during provisioning.

An installer package is planned that will allow you to install the agent on existing VMs, but that is not yet available.

Both the New-AzureVM and New-AzureQuickVM cmdlets by default will install the agent.

New-AzureQuickVM syntax:

New-AzureQuickVM -Windows -ServiceName <Service Name> -Name <VM Name> -ImageName <image name> -Password <password> -Location <location> -AdminUsername <admin name> -InstanceSize <instance size>

For example:

New-AzureQuickVM -Windows -ServiceName 'CLFeb19WS12R2A' -Name 'CLFeb19WS12R2A' -ImageName (Get-AzureVMImage | where ImageFamily -eq 'Windows Server 2012 R2 Datacenter' | select -last 1).ImageName -Password $password -Location 'West US' -AdminUsername 'Craig' -InstanceSize 'Small'

To enable the BGInfo extension:

Get-AzureVM -ServiceName <service name> -Name <VM name> | Set-AzureVMBGInfoExtension | Update-AzureVM

For example:

Get-AzureVM -ServiceName 'CLFeb19WS12R2A' -Name 'CLFeb19WS12R2A' | Set-AzureVMBGInfoExtension | Update-AzureVM

Use -Disable to disable the extension:

Get-AzureVM -ServiceName 'CLFeb19WS12R2A' -Name 'CLFeb19WS12R2A' | Set-AzureVMBGInfoExtension -Disable | Update-AzureVM

If you get error below, add -ReferenceName 'BGInfo' after the -Disable parameter.

Update-AzureVM : BadRequest: Invalid update to extension reference for role: <VM name> and reference: MyBGInfoExtension.

For example:

Get-AzureVM -ServiceName 'CLFeb19WS12R2A' -Name 'CLFeb19WS12R2A' | Set-AzureVMBGInfoExtension -Disable -ReferenceName 'BGInfo' | Update-AzureVM

When you enable it, the next time you login you will see the desktop wallpaper includes VM information. If you were already signed in, you would need to sign out and sign back in again to see it.

There are three services/processes relevant to the agent:

  • RdAgent service (WaAppAgent.exe)
  • WindowsAzureGuestAgent service (WindowsAzureGuestAgent.exe)
  • WindowsAzureTelemetryService service (WindowsAzureTelemetryService.exe)

Running netstat -anob will show WindowsAzureGuestAgent.exe and WaAppAgent.exe:

 [WindowsAzureGuestAgent.exe]
  TCP    10.79.24.59:49169      10.79.24.70:80         ESTABLISHED     2300
 [WaAppAgent.exe]
  TCP    10.79.24.59:49174      204.79.197.200:80      ESTABLISHED     156

You can see if the agent was installed during provisioning and which extensions are available by expanding the VM property from Get-AzureVM and looking at the ProvisiongGuestAgent and ResourceExtensionReferences.

Get-AzureVM -ServiceName <service name> -Name <VM name> | select -expandproperty VM

For example:

Get-AzureVM -ServiceName 'CLFeb19WS12R2A' -Name 'CLFeb19WS12R2A' | select -expandproperty VM | Format-List ProvisionGuestAgent,ResourceExtensionReferences

ProvisionGuestAgent : True
ResourceExtensionReferences : {BGInfo}

Log files:

C:\WindowsAzure\Logs\WappAgent.log
C:\WindowsAzure\Logs\AppAgentRuntime.log
C:\WindowsAzure\Logs\TransparentInstaller.log
C:\WindowsAzure\Logs\Plugins\AggregateStatus.log
C:\WindowsAzure\Logs\Plugins\Microsoft.Compute.BGInfo\1.1\BGInfoLauncher.log
C:\WindowsAzure\Packages\Telemetry\WindowsAzureTelemetryService.InstallLog
C:\WindowsAzure\Packages\GuestAgent\WindowsAzureGuestAgent.InstallLog

C:\WindowsAzure\Logs\Plugins\Microsoft.Compute.BGInfo\1.1\BGInfoLauncher.log file will show the following when you enable the extension:

[00000001] [02/19/2014 21:40:52.12] [INFO]  Starting...
[00000001] [02/19/2014 21:40:52.17] [INFO]  Setting registry key Software\Microsoft\Windows Azure\BGInfo entry DeploymentId to 7d889482b1fa4bdea260427f2a7fa96a
[00000001] [02/19/2014 21:40:52.17] [INFO]  Setting registry key Software\Microsoft\Windows Azure\BGInfo entry PublicIp to 168.62.206.36
[00000001] [02/19/2014 21:40:52.17] [INFO]  Setting registry key Software\Microsoft\Windows Azure\BGInfo entry InternalIp to 10.79.24.59
[00000001] [02/19/2014 21:40:52.17] [INFO]  Setting registry key Software\Microsoft\Windows\CurrentVersion\Run entry BGInfo to "C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\BGInfo.exe" "C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\config.bgi" /NOLICPROMPT /timer:0 /log:C:\WindowsAzure\Logs\Plugins\Microsoft.Compute.BGInfo\1.1\BGInfo.log
[00000001] [02/19/2014 21:40:52.17] [INFO]  The BGInfo extension is set to be enabled on next login.

C:\WindowsAzure\Logs\WappAgent.log will show:

[00000004] [02/19/2014 21:40:51.20] [INFO]  Driving to new goal state (V:2012-11-30 I:2 M:(ES:Started) C:(ID:f212cae9-b13b-4ea8-8446-d5799bc11dde R:[(ID:7d889482b1fa4bdea260427f2a7fa96a.CLFeb19WS12R2A S:Started),]))
[00000004] [02/19/2014 21:40:51.25] [INFO]  Extension Plugins Found.
[00000004] [02/19/2014 21:40:51.33] [INFO]  C:\WindowsAzure\Config is already set up.
[00000004] [02/19/2014 21:40:51.33] [INFO]  Successfully retrieved transport certificate.
[00000004] [02/19/2014 21:40:51.43] [INFO]  Successfully imported cert Cert0My into the store My
[00000004] [02/19/2014 21:40:51.44] [INFO]  Starting installation of plugins. Incarnation: 2 Plugin size: 1
[00000004] [02/19/2014 21:40:51.46] [INFO]  Downloading version manifest for plugin Microsoft.Compute.BGInfo from https://rdfepirv2by1prdstr01.blob.core.windows.net/bfd5c281a7dc4e4b84381eb0b47e3aaf/Microsoft.Compute_BGInfo_uswest_manifest.xml.
[00000004] [02/19/2014 21:40:51.71] [INFO]  AutoUpgrade for plugin Microsoft.Compute.BGInfo is set to True.
[00000004] [02/19/2014 21:40:51.74] [INFO]  No plugin settings received.
[00000006] [02/19/2014 21:40:51.74] [INFO]  Launching plugin health monitor.
[00000006] [02/19/2014 21:40:51.76] [INFO]  Plugin health monitor: Waiting for the install script of the plugins to exit.
[00000004] [02/19/2014 21:40:51.82] [INFO]  Plugin Microsoft.Compute.BGInfo 1.1 not found in cache.
[00000004] [02/19/2014 21:40:51.84] [INFO]  Starting download of plugin Microsoft.Compute.BGInfo from location: https://rdfepirv2by1prdstr01.blob.core.windows.net/bfd5c281a7dc4e4b84381eb0b47e3aaf/Microsoft.Compute__BGInfo__1.1.
[00000004] [02/19/2014 21:40:51.88] [INFO]  Download finished for plugin Microsoft.Compute.BGInfo 1.1.
[00000004] [02/19/2014 21:40:51.88] [INFO]  Extracting plug-in zip file to folder. Zip file: C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\Microsoft.Compute.BGInfo_1.1.zip
[00000004] [02/19/2014 21:40:51.96] [INFO]  Successfully created runtime settings folder C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\RuntimeSettings for plugin Microsoft.Compute.BGInfo version 1.1.
[00000004] [02/19/2014 21:40:51.96] [INFO]  Successfully created Status folder C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\Status for plugin Microsoft.Compute.BGInfo version 1.1.
[00000004] [02/19/2014 21:40:51.96] [INFO]  Successfully created Log folder C:\WindowsAzure\Logs\Plugins\Microsoft.Compute.BGInfo\1.1 for plugin Microsoft.Compute.BGInfo version 1.1.
[00000004] [02/19/2014 21:40:51.97] [INFO]  Running install command of Microsoft.Compute.BGInfo. command file: C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\BGInfoLauncher.exe
[00000004] [02/19/2014 21:40:51.99] [INFO]  Beginning installation of plugin Microsoft.Compute.BGInfo 1.1.
[00000004] [02/19/2014 21:40:52.08] [INFO]  Waiting installer of Microsoft.Compute.BGInfo to finish...
[00000004] [02/19/2014 21:40:52.19] [INFO]  Successfully installed plugin Microsoft.Compute.BGInfo 1.1.
[00000004] [02/19/2014 21:40:52.20] [INFO]  No RuntimeSettings for plugin Microsoft.Compute.BGInfo version 1.1.
[00000006] [02/19/2014 21:40:52.33] [INFO]  Health file does not exist for plugin Microsoft.Compute.BGInfo. It will not be monitored.

When you disable the extension, BGInfoLauncher.log will show:

[00000001] [02/20/2014 16:43:09.73] [INFO]  Starting...
[00000001] [02/20/2014 16:43:09.74] [INFO]  Setting registry key Software\Microsoft\Windows\CurrentVersion\Run entry BGInfo to "C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\BGInfo.exe" "C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\emptyConfig.bgi" /NOLICPROMPT /timer:0 /log:C:\WindowsAzure\Logs\Plugins\Microsoft.Compute.BGInfo\1.1\BGInfo.log
[00000001] [02/20/2014 16:43:09.74] [INFO]  The BGInfo extension is set to be disabled on next login.

And WappAgent.log will show:

[00000004] [02/20/2014 16:43:09.36] [INFO]  Driving to new goal state (V:2012-11-30 I:3 M:(ES:Started) C:(ID:f212cae9-b13b-4ea8-8446-d5799bc11dde R:[(ID:7d889482b1fa4bdea260427f2a7fa96a.CLFeb19WS12R2A S:Started),]))
[00000004] [02/20/2014 16:43:09.36] [INFO]  Extension Plugins Found.
[00000004] [02/20/2014 16:43:09.36] [INFO]  C:\WindowsAzure\Config is already set up.
[00000004] [02/20/2014 16:43:09.37] [INFO]  Successfully retrieved transport certificate.
[00000004] [02/20/2014 16:43:09.45] [INFO]  Successfully imported cert Cert0My into the store My
[00000004] [02/20/2014 16:43:09.47] [INFO]  Starting installation of plugins. Incarnation: 3 Plugin size: 1
[00000004] [02/20/2014 16:43:09.47] [INFO]  Downloading version manifest for plugin Microsoft.Compute.BGInfo from https://rdfepirv2by1prdstr01.blob.core.windows.net/bfd5c281a7dc4e4b84381eb0b47e3aaf/Microsoft.Compute_BGInfo_uswest_manifest.xml.
[00000004] [02/20/2014 16:43:09.58] [INFO]  AutoUpgrade for plugin Microsoft.Compute.BGInfo is set to True.
[00000004] [02/20/2014 16:43:09.58] [INFO]  No plugin settings received.
[00000005] [02/20/2014 16:43:09.58] [INFO]  Launching plugin health monitor.
[00000005] [02/20/2014 16:43:09.58] [INFO]  Plugin health monitor: Waiting for the install script of the plugins to exit.
[00000004] [02/20/2014 16:43:09.58] [INFO]  Plug-in Microsoft.Compute.BGInfo 1.1 found in cache.
[00000004] [02/20/2014 16:43:09.58] [INFO]  Extracting plug-in zip file to folder. Zip file: C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\Microsoft.Compute.BGInfo_1.1.zip
[00000004] [02/20/2014 16:43:09.64] [INFO]  Successfully created runtime settings folder C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\RuntimeSettings for plugin Microsoft.Compute.BGInfo version 1.1.
[00000004] [02/20/2014 16:43:09.64] [INFO]  Successfully created Status folder C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\Status for plugin Microsoft.Compute.BGInfo version 1.1.
[00000004] [02/20/2014 16:43:09.64] [INFO]  Successfully created Log folder C:\WindowsAzure\Logs\Plugins\Microsoft.Compute.BGInfo\1.1 for plugin Microsoft.Compute.BGInfo version 1.1.
[00000004] [02/20/2014 16:43:09.64] [INFO]  Running install command of Microsoft.Compute.BGInfo. command file: C:\Packages\Plugins\Microsoft.Compute.BGInfo\1.1\BGInfoLauncher.exe
[00000004] [02/20/2014 16:43:09.64] [INFO]  Beginning installation of plugin Microsoft.Compute.BGInfo 1.1.
[00000004] [02/20/2014 16:43:09.70] [INFO]  Waiting installer of Microsoft.Compute.BGInfo to finish...
[00000004] [02/20/2014 16:43:09.74] [INFO]  Successfully installed plugin Microsoft.Compute.BGInfo 1.1.
[00000004] [02/20/2014 16:43:09.74] [INFO]  No RuntimeSettings for plugin Microsoft.Compute.BGInfo version 1.1.
[00000005] [02/20/2014 16:43:09.76] [INFO]  Health file does not exist for plugin Microsoft.Compute.BGInfo. It will not be monitored.

Binaries and logs are located in C:\WindowsAzure and C:\Packages:

C:\WINDOWSAZURE
+---Config
|       7d889482b1fa4bdea260427f2a7fa96a.7d889482b1fa4bdea260427f2a7fa96a.CLFeb19WS12R2A.1.xml
|       7d889482b1fa4bdea260427f2a7fa96a.7d889482b1fa4bdea260427f2a7fa96a.CLFeb19WS12R2A.2.xml
|      
+---Dumps
|       WindowsAzureGuestAgent.exe.Full.dmp
|       WindowsAzureGuestAgent.exe.Normal.dmp
|      
+---Logs
|   |   AppAgentRuntime.log
|   |   MonitoringAgent.txt
|   |   RuntimeEvents_000001.etl
|   |   TransparentInstaller.log
|   |   WaAppAgent.log
|   |   WaAppAgent_000001.etl
|   |  
|   \---Plugins
|       |   AggregateStatus.log
|       |  
|       \---Microsoft.Compute.BGInfo
|           \---1.1
|                   BGInfoLauncher.log
|                  
\---Packages
    |   CommonAgentConfig.config
    |   dbghelp.dll
    |   Microsoft.WindowsAzure.GuestAgent.ContainerStateMachine.dll
    |   Microsoft.WindowsAzure.RoleContainer.dll
    |   Package.dll
    |   PackageInformation.txt
    |   TransparentInstaller.dll
    |   TransparentInstaller.dll.config
    |   TransparentInstallerWrapper.dll
    |   WaAppAgent.exe
    |   WaAppAgent.exe.config
    |   WindowsAzureEventSource.dll
    |   WindowsAzureTelemetryEvents.dll
    |  
    +---GuestAgent
    |   |   AppAgentRuntime.dll
    |   |   AppAgentRuntime.ini
    |   |   AppAgentRuntime.mcf
    |   |   AzureEvents.man
    |   |   IISConfigurator-Ipv4only.exe.config
    |   |   IISConfigurator-Ipv6andIpv4.exe.config
    |   |   IpAddressAssignment.exe
    |   |   IpAddressAssignment.exe.config
    |   |   Microsoft.WindowsAzure.GuestAgent.AppAgentRuntime.dll
    |   |   Microsoft.WindowsAzure.GuestAgent.ContainerStateMachine.dll
    |   |   Microsoft.WindowsAzure.GuestAgent.EmulatorRuntime.dll
    |   |   Microsoft.WindowsAzure.GuestAgent.IaaSAppAgentRuntimeInterop.dll
    |   |   Microsoft.WindowsAzure.RoleContainer.dll
    |   |   Microsoft.WindowsAzure.RuntimeInstaller.dll
    |   |   Package.dll
    |   |   PluginLauncher.exe
    |   |   PluginLauncher.exe.config
    |   |   ProviderGuids.txt
    |   |   RdCertificateFactory.dll
    |   |   RdCrypt.dll
    |   |   WindowsAzureEventSource.dll
    |   |   WindowsAzureGuestAgent.exe
    |   |   WindowsAzureGuestAgent.exe.config
    |   |   WindowsAzureGuestAgent.InstallLog
    |   |   WindowsAzureGuestAgent.InstallState
    |   |   WindowsAzureTelemetryEvents.dll
    |   |  
    |   \---LegacyRuntime
    |       +---x64
    |       |       rdrtl.dll
    |       |      
    |       \---x86
    |               rdrtl.dll
    |              
    +---Runtime
    |   +---1.8
    |   |   \---base
    |   |       +---x64
    |   |       |       WaHostBootstrapper.exe
    |   |       |      
    |   |       \---x86
    |   |               WaHostBootstrapper.exe
    |   |              
    |   \---2.0
    |       \---base
    |           +---x64
    |           |       WaHostBootstrapper.exe
    |           |      
    |           \---x86
    |                   WaHostBootstrapper.exe
    |                  
    \---Telemetry
            Microsoft.WindowsAzure.GuestAgent.ContainerStateMachine.dll
            Microsoft.WindowsAzure.RoleContainer.dll
            TraceEvent.dll
            WindowsAzureEventSource.dll
            WindowsAzureTelemetryEvents.dll
            WindowsAzureTelemetryService.exe
            WindowsAzureTelemetryService.exe.config
            WindowsAzureTelemetryService.InstallLog
            WindowsAzureTelemetryService.InstallState

 

C:\PACKAGES
\---Plugins
    \---Microsoft.Compute.BGInfo
        \---1.1
            |   BGInfo.def.xml
            |   Bginfo.exe
            |   BGInfoLauncher.exe
            |   BGInfoLauncher.pdb
            |   config.bgi
            |   config.txt
            |   emptyConfig.bgi
            |   Microsoft.Compute.BGInfo_1.1.zip
            |   PackageInformation.txt
            |   PluginManifest.xml
            |  
            +---RuntimeSettings
            \---Status