【问题标题】:Multiple VMExtensions per handler not supported for OS type 'Linux操作系统类型“Linux”不支持每个处理程序多个 VMExtensions
【发布时间】:2017-08-14 14:30:00
【问题描述】:

我使用 ARM 模板创建了 Azure VM。现在我想在 Azure VM 上安装 Java 和 Mongodb。

当我尝试使用多个 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://..install-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"
        }
    }
},

有没有在 ARM 模板中使用 Multiple CustomScript 的解决方案?请帮我解决这个问题。

【问题讨论】:

  • 你可以使用嵌套模板链接那些

标签: mongodb azure azure-storage redhat azure-resource-manager


【解决方案1】:

操作系统类型“Linux”不支持每个处理程序多个 VMExtensions

目前,无法在部署时运行多个自定义脚本扩展。

根据您的方案,您可以编写一个调用依赖脚本的入口点脚本,然后将入口点脚本、依赖脚本和任何其他依赖二进制文件上传到脚本位置(Azure 存储 blob 或 GitHub)。更多信息请参考此link

另外,你可以参考这个类似的question

【讨论】:

    猜你喜欢
    • 2021-03-02
    • 1970-01-01
    • 2023-03-08
    • 1970-01-01
    • 2013-05-21
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 2022-06-30
    相关资源
    最近更新 更多