2017-03-22 34 views
0

我已經使用ARM模板創建了Azure VM。現在我想在Azure VM上安裝Java和Mongodb。每個處理程序的多個VMExtensions不支持操作系統類型'Linux

當我嘗試使用多個CustomScript,我碰到下面的錯誤。

Multiple VMExtensions per handler not supported for OS type 'Linux 

下面是我的配置: -

參數: -

"javaPackageName": { 
    "type": "string", 
    "defaultValue": "openjdk-7-jdk", 
    "allowedValues": [ 
     "openjdk-6-jdk", 
     "openjdk-7-jdk", 
     "openjdk-8-jdk" 
    ] 
}, 
"tomcatPackageName": { 
    "type": "string", 
    "defaultValue": "tomcat7", 
    "allowedValues": [ 
    "tomcat6", 
    "tomcat7", 
    "tomcat8" 
    ] 
} 

變量: -

「mongoInstallCentos」: 「HTTPS:/ ..安裝-mongo.json」

{ 
    "type": "Microsoft.Compute/virtualMachines/extensions", 
    "name": "[concat(parameters('virtualMachineName'),'/javainstall')]", 
    "apiVersion": "2015-05-01-preview", 
    "location": "[variables('location')]", 
    "dependsOn": [ 
     "[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]" 
    ], 
    "properties": { 
     "publisher": "Microsoft.Azure.Extensions", 
     "type": "CustomScript", 
     "typeHandlerVersion": "2.0", 
     "autoUpgradeMinorVersion": true, 
     "settings": { 
     "fileUris": ["https://..java-tomcat-install.sh"], 
     "commandToExecute": "[concat('sh java-tomcat-install.sh',' ',parameters('javaPackageName'),' ',parameters('tomcatPackageName'))]" 
     } 
    } 
}, 
{ 
    "type": "Microsoft.Compute/virtualMachines/extensions", 
    "name": "[concat(parameters('virtualMachineName'),'/mongoinstall')]", 
    "apiVersion": "2015-05-01-preview", 
    "location": "[variables('location')]", 
    "dependsOn": [ 
     "[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]" 
    ], 
    "properties": { 
     "publisher": "Microsoft.Azure.Extensions", 
     "type": "CustomScript", 
     "typeHandlerVersion": "2.0", 
     "autoUpgradeMinorVersion": true, 
     "settings": { 
     "fileUris": ["https://..mongo-install.sh"], 
     "commandToExecute": "sh mongo-install.sh" 
     } 
    } 
}, 

I有沒有解決方案在ARM模板中使用多個CustomScript?請幫我解決這個問題。每個處理器

+0

你可以鏈接那些使用嵌套模板 – 4c74356b41

回答

2

多VMExtensions不支持的操作系統類型「的Linux

目前,它是不可能在部署時間運行多個CustomScript擴展。

根據您的方案,您可以創建調用依賴腳本的入口點腳本,然後將入口點腳本,相關腳本和任何其他相關二進制文件上載到腳本位置(Azure存儲blob或GitHub)。更多信息請參考此link

此外,您可以參考這個類似question

相關問題