Azure上の新しいWindows Server VMにAzureリソーステンプレートを展開しようとしていますが、AzureにはMicrosoft.Powershell.DSCリソースがVMに含まれています。拡張子 'Microsoft.Powershell.DSC'を処理するときにエラーが発生する
私が確認した公開アクセス可能Azure Storage BlobコンテナにDSC設定ファイルがプッシュされました。URLにアクセスするブラウザからダウンロードできます。
新しいVMを正常にデプロイした後、上記のAzureブロブコンテナに格納されたDSC設定ファイルを実行する拡張サブリソースを追加しました。
なぜ失敗しているのかわかりません。
私は、このコマンドを使用してデプロイメントを実行します。ここでは
New-AzureRmResourceGroupDeployment `
-Name $resourceDeploymentName `
-ResourceGroupName $rscrcGrpName `
-TemplateFile $templatePath `
-TemplateParameterFile $parameterPath `
-Verbose
は誤りである:ここでは
New-AzureRmResourceGroupDeployment : 3:56:46 PM - Resource Microsoft.Compute/virtualMachines 'DC1' failed with message '{
"status": "Failed",
"error": {
"code": "ResourceDeploymentFailure",
"message": "The resource operation completed with terminal provisioning state 'Failed'.",
"details": [
{
"code": "VMExtensionProvisioningError",
"message": "VM has reported a failure when processing extension 'Microsoft.Powershell.DSC'. Error message: \"The DSC Extension failed to install:
Error unpacking 'DomainController-DSC.ps1'; verify this is a valid ZIP package.\nError details: Exception calling \"ExtractToDirectory\" with \"2\"
argument(s): \"End of Central Directory record could not be found.\".\r\nMore information about the failure can be found in the logs located under
'C:\\WindowsAzure\\Logs\\Plugins\\Microsoft.Powershell.DSC\\2.20.0.0' on the VM.\r\nTo retry install, please remove the extension from the VM first. \"."
}
]
}
}'
At line:1 char:1
+ New-AzureRmResourceGroupDeployment `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
New-AzureRmResourceGroupDeployment : 3:56:46 PM - VM has reported a failure when processing extension 'Microsoft.Powershell.DSC'. Error message: "The DSC
Extension failed to install: Error unpacking 'DomainController-DSC.ps1'; verify this is a valid ZIP package.
Error details: Exception calling "ExtractToDirectory" with "2" argument(s): "End of Central Directory record could not be found.".
More information about the failure can be found in the logs located under 'C:\WindowsAzure\Logs\Plugins\Microsoft.Powershell.DSC\2.20.0.0' on the VM.
To retry install, please remove the extension from the VM first. ".
At line:1 char:1
+ New-AzureRmResourceGroupDeployment `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
New-AzureRmResourceGroupDeployment : 3:56:46 PM - Template output evaluation skipped: at least one resource deployment operation failed. Please list
deployment operations for details. Please see https://aka.ms/arm-debug for usage details.
At line:1 char:1
+ New-AzureRmResourceGroupDeployment `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
New-AzureRmResourceGroupDeployment : 3:56:46 PM - Template output evaluation skipped: at least one resource deployment operation failed. Please list
deployment operations for details. Please see https://aka.ms/arm-debug for usage details.
At line:1 char:1
+ New-AzureRmResourceGroupDeployment `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet
は、VMリソースの定義です:
{
"name": "[parameters('virtualMachineName')]",
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2015-06-15",
"location": "[parameters('location')]",
"tags": {
"displayName": "vm-DC1"
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]",
"[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', parameters('diagnosticsStorageAccountName'))]"
],
"properties": {
"osProfile": {
"computerName": "[parameters('virtualMachineName')]",
"adminUsername": "[parameters('vmAdminUsername')]",
"adminPassword": "[parameters('vmAdminPassword')]",
"windowsConfiguration": {
"provisionVmAgent": "true"
}
},
"hardwareProfile": {
"vmSize": "[parameters('virtualMachineSize')]"
},
"storageProfile": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2012-R2-Datacenter",
"version": "latest"
},
"osDisk": {
"name": "[parameters('virtualMachineName')]",
"vhd": {
"uri": "[concat(concat(reference(resourceId(resourceGroup().name, 'Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2015-06-15').primaryEndpoints['blob'], 'vhds/'), parameters('virtualMachineName'), '2016812162929.vhd')]"
},
"createOption": "fromImage"
},
"dataDisks": [ ]
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]"
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": "[reference(resourceId(resourceGroup().name, 'Microsoft.Storage/storageAccounts', parameters('diagnosticsStorageAccountName')), '2015-06-15').primaryEndpoints['blob']]"
}
}
},
"resources": [
{
"name": "Microsoft.Powershell.DSC",
"type": "extensions",
"location": "[parameters('location')]",
"apiVersion": "2015-06-15",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]"
],
"tags": {
"displayName": "dsc-DomainController"
},
"properties": {
"publisher": "Microsoft.Powershell",
"type": "DSC",
"typeHandlerVersion": "2.9",
"autoUpgradeMinorVersion": true,
"forceUpdateTag": "1.0",
"settings": {
"configuration": {
"url": "https://armstore0.blob.core.windows.net/dsc/DomainController-DSC.ps1.zip",
"script": "DomainController-DSC.ps1",
"function": "FileResourceDemo"
},
"configurationArguments": {
"nodeName": "[parameters('virtualMachineName')]"
}
}
}
}
]
}
これは関連していますが、テンプレートがスクリプトによって受け入れられないconfigArgを渡すかどうかはわかりません。それを削除し、それが役立つかどうかを確認してください。また、「hello world」サンプルがあります。https://github.com/bmoore-msft/AzureRM-Samples/tree/master/VMDSCInstallFile –