Repository navigation
Deprovisioning failures #38
Description
Activity
Any updates for this issue? I'm seeing almost the same error suddenly and the suggestions I found here didn't resolve it for me: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/image-builder-troubleshoot#sysprep-timing
My error is slightly different, though. Exception thrown trying to get the
WindowsAzureTelemetryServicejust before attempting to get theWindowsAzureGuestAgentFrom my logs:
[1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: Write-Output '>>> Waiting for GA Service (RdAgent) to start ...' [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT ==> azure-arm: Get-Service : Cannot find any service with service name 'WindowsAzureTelemetryService'. [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT ==> azure-arm: At C:\DeprovisioningScript.ps1:4 char:9 [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT ==> azure-arm: + while ((Get-Service WindowsAzureTelemetryService) -and ((Get-Service ... [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: while ((Get-Service RdAgent).Status -ne 'Running') { Start-Sleep -s 5 } [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT ==> azure-arm: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: Write-Output '>>> Waiting for GA Service (WindowsAzureTelemetryService) to start ...' [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: while ((Get-Service WindowsAzureTelemetryService) -and ((Get-Service WindowsAzureTelemetryService).Status -ne 'Running')) { Start-Sleep -s 5 } [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: Write-Output '>>> Waiting for GA Service (WindowsAzureGuestAgent) to start ...' [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: while ((Get-Service WindowsAzureGuestAgent).Status -ne 'Running') { Start-Sleep -s 5 } [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: Write-Output '>>> Sysprepping VM ...' [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER ERR ==> azure-arm: Deleting individual resources ... [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: if( Test-Path $Env:SystemRoot\system32\Sysprep\unattend.xml ) { [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: Remove-Item $Env:SystemRoot\system32\Sysprep\unattend.xml -Force [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: } [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: & $Env:SystemRoot\System32\Sysprep\Sysprep.exe /oobe /generalize /quiet /quit [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: while($true) { [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: $imageState = (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State).ImageState [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: Write-Output $imageState [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: if ($imageState -eq 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { break } [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: Start-Sleep -s 5 [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: } [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: Write-Output '>>> Sysprep complete ...' [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: >>> Waiting for GA Service (RdAgent) to start ... [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT azure-arm: >>> Waiting for GA Service (WindowsAzureTelemetryService) to start ... [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT ==> azure-arm: + CategoryInfo : ObjectNotFound: (WindowsAzureTelemetryService:String) [Get-Service], ServiceCommandExcep [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT ==> azure-arm: tion [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT ==> azure-arm: + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT ==> azure-arm: [1e333e01-b8d7-45d3-9295-1f49870c39e1] PACKER OUT ==> azure-arm: Provisioning step had errors: Running the cleanup provisioner, if present...MichaelRandall-CFS commented
on Jun 26, 2023 More actionsI am sure most of these issues are related to Microsoft Defender for Endpoint (MDE). you can see more information here on a related issue with packer.
https://github.com/actions/runner-images/discussions/6251
the problem with packer and azure can be solved with a tag
"ExcludeMdeAutoProvisioning": "True"however, I have no idea if there is work around for image builder. Microsoft can we please have some advice on this?
I'm getting the following error in the deprovisioning phase of my Windows image:
Relevant info from my template includes:
Is there anything obvious I'm missing here? I took the customization steps from the Windows Managed Image template, and customized the setup script. My setup script runs without error.