Cannot find any service with service name 'WindowsAzureTelemetryService'

Hi.

I am unable to properly create Windows images on Azure, because the deprovision step is stuck in an infinite loop.

The error:

1589606815,,ui,error,==> azure-arm: Get-Service : Cannot find any service with service name 'WindowsAzureTelemetryService'. 

1589606815,,ui,error,==> azure-arm: At C:\Windows\Temp\script-5ebf7849-741e-b3ca-88f5-82f1f7d320aa.ps1:3 char:11 

1589606815,,ui,error,==> azure-arm: + while ((Get-Service WindowsAzureTelemetryService).Status -ne 'Runni ... 

The deprovision step (as you can see in the documentation):

{
"provisioners": [
      {
      "type": "powershell",
      "inline": [
         " # NOTE: the following *3* lines are only needed if the you have installed the Guest Agent.",
         "  while ((Get-Service RdAgent).Status -ne 'Running') { Start-Sleep -s 5 }",
         "  while ((Get-Service WindowsAzureTelemetryService).Status -ne 'Running') { Start-Sleep -s 5 }",
         "  while ((Get-Service WindowsAzureGuestAgent).Status -ne 'Running') { Start-Sleep -s 5 }",

         "& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit /mode:vm",
         "while($true) { $imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10  } else { break } }"
       ]
     }
   ]
}

I started a Windows VM, logged in and the WindowsAzureTelemetryService is not running, but we didn’t change anything.
If we remove the line with the WindowsAzureTelemetryService it just fails with other errors.

Anyone else seen this issue?
Any ideas how to solve it?

Regards,

Adam

Yes! Windows image pipelines were working fine until 5/15, then I started getting these very failures for all Windows images. No changes had been made to the image pipelines or (to my knowledge) our Azure configuration.

I did some investigation today, and found:

  • Of the three components to the Azure Guest Agent, RdAgent and WindowsAzureGuestAgent were both running normally. However, the WindowsAzureTelemetryService was not installed.
  • If I deploy a VM from a previously created image, that image does not have the WindowsAzureTelemetryService installed, either.
  • If I deploy a bare VM directly from the Marketplace, the WindowsAzureTelemetryService was not installed.

This leads me to believe that his is a result of a change made by Microsoft, and not a Hashicorp issue. I can only speculate that either the Windows Azure Guest Agent package has been changed to omit the installation of that service, or that something has changed in the way images are deployed that does the same thing. I’ve removed the service check, and so far I haven’t had any failures this afternoon. However, I don’t know what, if any, issues may be caused by not having the telemetry service running.

Tomorrow I will see if installing the guest agent package manually still installs the service. I’m interested to see if anyone else is having this issue.

Thanks,
Bruce

1 Like

Hi Bruce,

Just found out with the latest agent telemetry no longer a separate service, telemetry now wrapped in the RDAgent so for my own pipelines have removed any reference / checks for the telemetry service.

Cheers

Steve