Azure Linux VMSS 添加扩展
Azure Linux VMSS add extension
我已经使用 Azure 门户创建了一个 VMSS(VM 规模集),我想向其添加自定义脚本扩展以在其上安装一些软件。我该怎么做呢?我试过将 azure vmss config extensions set
与 json 文件一起使用,但这似乎不起作用。我的 json 文件看起来像
{
"extensionProfile":{
"extensions": [
{
"name": "bigstream spark",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [<some files....>
],
"commandToExecute": "./installspark2.sh"
},
"protectedSettings": {
"storageAccountName": <accountname>,
"storageAccountKey": <secret>
}
}
}]
}
}
Azure CLI 1.x 没有很好的扩展支持 - 'config' 用法令人困惑,我不推荐它。幸运的是,基于 Python 的新 CLI 2.0 确实具有适用于规模集的明智的添加扩展命令。当你创建一个时,我不会在扩展名称中添加 space。
还有一点,看看这个工具:https://github.com/gbowerman/vmsstools/tree/master/vmssextn -
它有助于基本扩展 CRUD(尽管在 CLI 2.0 之后不需要那么多)。
我已经使用 Azure 门户创建了一个 VMSS(VM 规模集),我想向其添加自定义脚本扩展以在其上安装一些软件。我该怎么做呢?我试过将 azure vmss config extensions set
与 json 文件一起使用,但这似乎不起作用。我的 json 文件看起来像
{
"extensionProfile":{
"extensions": [
{
"name": "bigstream spark",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [<some files....>
],
"commandToExecute": "./installspark2.sh"
},
"protectedSettings": {
"storageAccountName": <accountname>,
"storageAccountKey": <secret>
}
}
}]
}
}
Azure CLI 1.x 没有很好的扩展支持 - 'config' 用法令人困惑,我不推荐它。幸运的是,基于 Python 的新 CLI 2.0 确实具有适用于规模集的明智的添加扩展命令。当你创建一个时,我不会在扩展名称中添加 space。
还有一点,看看这个工具:https://github.com/gbowerman/vmsstools/tree/master/vmssextn - 它有助于基本扩展 CRUD(尽管在 CLI 2.0 之后不需要那么多)。