我正在尝试更新我的服务结构集群的节点计数。我使用PowerShell用以下命令部署下面的模板:New-AzureRmResourceGroupDeployment -name "ExampleDeployment3" -ResourceGroupName "myResourceGroup" -TemplateFile "template.json"
.
当我运行Get-AzureRmResourceGroupDeployment
时,我得到了以前所有部署尝试的列表。只有最新的ExampleDeployment3
是"Running"
{
"$schema":"http://schema.management.azure.com/schemas/2015-01-01-preview/deploymentTemplate.json",
"contentVersion":"1.0.0.0",
"parameters":{
"existingVMSSName":{
"type":"string",
"metadata":{
"description":"Name of existing VM Scale Set"
}
},
"newCapacity":{
"type":"int",
"metadata":{
"description":"Number of desired VM instances"
}
},
"vmSku": {
"type": "string",
"defaultValue": "Standard_A1",
"metadata": {
"description": "Size of VMs in the VM Scale Set."
}
}
},
"resources":[
{
"type":"Microsoft.Compute/virtualMachineScaleSets",
"apiVersion":"2016-03-30",
"name":"[parameters('existingVMSSName')]",
"location":"[resourceGroup().location]",
"sku":{
"name":"[parameters('vmSku')]",
"tier":"Standard",
"capacity":"[parameters('newCapacity')]"
}
}
]
}
当我这样做时,部署运行,运行,运行,再运行。在Azure Portal中,我可以看到2个新实例是"创建…",5个默认实例中有4个是"更新…"。6/7节点的状态为"虚拟机已停止"。唯一正在运行的是第一个Node。
然而,它似乎永远不会完成。我点击了"开始"在一个"虚拟机停止"节点,但它似乎不工作。仍然卡在"更新"或"创建"中
我没有通过powershell做这件事的经验,所以我不能在那里提供帮助,但在过去我总是通过azure资源浏览器实现这一点。您可以通过订阅->资源组->{{资源组名称}}->计算->虚拟机规模集找到您的节点。你可以点击右上角的读/写来编辑手臂模板。从这里开始,只需增加vmss上的实例数并保存即可。