2015-07-01 27 views
0

我正尝试通过ARM(Azure资源管理器)模板创建一个带有厨师客户端的Windows VM。我找到一个示例模板在github上:未能在资源管理器模板中为VM添加主厨扩展

https://github.com/Azure/azure-quickstart-templates/tree/master/chef-extension-windows-vm

{ 
    "name": "[concat(variables('vmName'),'/',variables('chefClientName'))]", 
    "type": "Microsoft.Compute/virtualMachines/extensions", 
    "apiVersion": "2015-05-01-preview", 
    "location": "[variables('location')]", 
    "dependsOn": [ 
     "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]" 
    ], 
    "properties": { 
     "publisher": "Chef.Bootstrap.WindowsAzure", 
     "type": "ChefClient", 
     "typeHandlerVersion": "1201.12", 
     "settings": { 
      "client_rb": "[parameters('client_rb')]", 
      "runlist": "[parameters('runlist')]" 
     }, 
     "protectedSettings": { 
      "validation_key": "[parameters('validation_key')]" 
     } 
    } 
} 

我在PowerShell中部署该模板,storageAcount /的vNet/IP/NIC/VM创建成功。但厨师扩展名来创建失败,出现以下错误:

New-AzureResourceGroupDeployment : 3:44:51 PM - Resource Microsoft.Compute/virtualMachines/extensions 
'myVM/chefExtension' failed with message 'Extension with publisher 'Chef.Bootstrap.WindowsAzure', type 'ChefClient', 
and type handler version '1201.12' could not be found in the extension repository.' 
At line:1 char:1 
+ New-AzureResourceGroupDeployment -Name $deployName -ResourceGroupName $RGName -T ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (:) [New-AzureResourceGroupDeployment], Exception 
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.NewAzureResourceGroupDeploymentCommand 

如何创建一个虚拟机与ARM模板厨师? 谢谢。

回答

0

失败是由错误的“typeHandlerVersion”导致的,“1201.12”不再可用。 “1207.12”工作正常。要获得可用的扩展信息,请使用以下PowerShell命令: Get-AzureVMAvailableExtension |选择ExtensionName,Publisher,版本,发布日期

相关问题