【问题标题】:Stop-AzureVM does not shutdown my Azure-VM (Runbook)Stop-AzureVM 不会关闭我的 Azure-VM (Runbook)
【发布时间】:2015-05-15 15:54:55
【问题描述】:

Hy

我有一个安装了 Visual Studio 的 Azure VM。当我从这里运行关机脚本(Runbook)时: https://gallery.technet.microsoft.com/scriptcenter/Stop-Azure-Virtual-Machine-0b1fea97

脚本状态说它已完成,但它没有关闭我的虚拟机。输出显示正在关闭,但没有任何反应。

对此有何建议?

感谢您的帮助。 彼得

【问题讨论】:

    标签: azure jobs azure-vm-role azure-automation


    【解决方案1】:

    我会建议你几件事-

    一个。大多数印象 - 转到资产选项卡并添加正确的 windows powershell 凭据(只需使用用户名和密码,与登录 azure 门户相同)。

    b.在 Runbook 中添加您的代码。假设您的 powershell 自动化凭证名称是 StartVM,您的订阅名称是 xxx。在这种情况下,工作流程将是-

    workflow StartVM
    {
    $Cred = Get-AutomationPSCredential -Name
    StartVM' Add-AzureAccount -Credential $Cred
    Select-AzureSubscription -SubscriptionName “xxx”
    inlineScript
    {
    Start-AzureVM -Name TestServer -ServiceName CS12345
    }
    }
    

    c。在此之后,您可以根据需要安排 Runbook。

    希望这篇文章对你有所帮助-

    http://azure.microsoft.com/blog/2014/11/25/introducing-the-azure-automation-script-converter/http://azure.microsoft.com/en-us/documentation/articles/automation-create-runbook-from-samples/

    谢谢。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-11
      • 1970-01-01
      相关资源
      最近更新 更多