Azure虚拟机规模集 - 检查是否通过Powershell停止或启动

时间:2017-12-13 18:24:10

标签: azure azure-powershell azure-automation

Azure有许多Powershell cmdlet可用于处理虚拟机规模集,例如"devDependencies": { "babel": "^6.23.0", "babel-core": "^6.26.0", "babel-loader": "^7.1.2", "sass-loader": "^6.0.6", "webpack": "^3.10.0", "webpack-dev-server": "^2.9.7" } 。但是,我还没有发现任何能够确定vm刻度集是停止还是启动的内容。有谁知道在Powershell中这是可能的?我怀疑它必须是,但我找不到支持。

1 个答案:

答案 0 :(得分:0)

使用以下PowerShell Cmdlet获取虚拟机规模集(VMSS)中虚拟机的状态

(Get-AzureRmVmssVM -ResourceGroupName {ResourceGroup-Name} -VMScaleSetName {VMSS-Name} -InstanceView -InstanceId "{Instance-ID}").Statuses
Example:  (Get-AzureRmVmssVM -ResourceGroupName vmss-rg -VMScaleSetName myvmss -InstanceView -InstanceId "1").Statuses

enter image description here