Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.
This repository was archived by the owner on Feb 24, 2021. It is now read-only.

MSFT_Archive: Failed to execute Set-TargetResource #316

@ChrisFg

Description

@ChrisFg

An azure arm vm is being provisioned, which failed, using a dsc resource, Unzip-coronaBenchmarkDsc.ps1.zip, located on an azure storage account. The vm dsc extension config is initiated from a powershell runbook. To reproduce the issue the specific runbook code was isolated and invoked from an automation engineer’s workstation via the ISE and azure sdk. The zip extract did succeed, but the portal, and powershell on the workstation, reported an error.

Azure portal > Virtual Machine > Extensions > Microsoft.Poweshell.DSC
Status Provisioning failed.
Portal error message extract

[2017-08-28 06:23:46Z] [VERBOSE] [cjfle1vm]: LCM: [ End Set ] [[Archive]CoronBenchmarkUnzip] in 12.8170 seconds.\r\n[2017-08-28 06:23:46Z] [ERROR] PowerShell DSC resource MSFT_Archive failed to execute Set-TargetResource functionality with error message: Exception setting "LastWriteTime": "The process cannot access the file 'C:\Temp\Corona1.3.Benchmark.exe' because it is being used by another process." \r\n[2017-08-28 06:23:46Z] [VERBOSE] [cjfle1vm]: LCM: [ End Set ]\r\n[2017-08-28 06:23:47Z] [ERROR] The SendConfigurationApply function did not succeed.\r\n[2017-08-28 06:23:47Z] [VERBOSE] Operation 'Invoke CimMethod' complete.\r\n[2017-08-28 06:23:47Z] [VERBOSE] Time taken for configuration job to complete is 19.166 seconds"

DSC resource: Unzip-coronaBenchmarkDsc.ps1.zip
Runs on arm vm: cjfle1vm
ARM AzureRM modules version: either 3.3.1 or 4.3.1.

DSC resource filename: Unzip-coronaBenchmarkDsc.ps1.zip
DSC resource content:
Configuration Unzip-coronaBenchmarkDsc {
Import-DscResource -ModuleName 'PSDscResources'
Node localhost {
Archive CoronBenchmarkUnzip {
Ensure = "Present"
Path = "C:\Temp\Corona1.3.Benchmark.zip"
Destination = "C:\Temp"
Force = $true
}
}
}
Located at: https://xxx.blob.core.windows.net/yyy/Unzip-coronaBenchmarkDsc.ps1.zip

Published from workstation to azure storage account by:
Publish-AzureRmVMDscConfiguration -ConfigurationPath '.\StorageBackendVmExtentsions\Unzip-coronaBenchmarkDsc.ps1'
-ResourceGroupName $resourcegroupName -StorageAccountName $storageAccountName `
-ContainerName $blobContainerName –Force

Published from:
Automation engineer’s workstation
Workstation ISE v5.1.15063.502
AzureRM 4.3.1
PSDscResources Manifest 2.8.0.0

Install of DSC vm extension is invoked from automation engineer’s workstation by:
Set-AzureRmVMDscExtension -ResourceGroupName 'zzz' -VMName 'cjfle1vm' -Name 'Unzip-coronaBenchmarkDsc'
-ArchiveResourceGroupName 'TRigsSa' -ArchiveStorageAccountName 'xxx'
-ArchiveContainerName 'yyy' -ArchiveBlobName 'Unzip-coronaBenchmarkDsc.ps1.zip'
-ConfigurationName 'Unzip-coronaBenchmarkDsc' -Version "2.26"
-WmfVersion 5.1

Let me know if you need more or different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions