【问题标题】:Create Vm in WAP using PowerShell, error 400使用 PowerShell 在 WAP 中创建 Vm,错误 400
【发布时间】:2016-09-12 09:56:15
【问题描述】:

我正在尝试使用 Windows Azure Pack 中的 PowerShell 创建一个 VM。 我已下载订阅,Get-WAPackVM 返回已创建的 VM。

我试过运行这两个脚本:

$OSDisk = Get-WAPackVMOSDisk -Name "W2012R2 Template_disk_1"
$SizeProfile = Get-WAPackVMSizeProfile -Name "Template"     
New-WAPackVM -Name "ContosoV073" -OSDisk $OSDisk -VMSizeProfile $SizeProfile

$Credentials = Get-Credential 
$Template = Get-WAPackVMTemplate -Name "Template 1"
New-WAPackVM -Name "VirShits7" -Template $Template -VMCredential $Credentials -Windows

两者都返回相同的错误:

New-WAPackVM : The remote server returned an error: (400) Bad Request.

所有 Get cmdlet 都返回值,并且似乎是正确的。 有谁知道我是如何让它工作的?

【问题讨论】:

    标签: powershell azure-pack


    【解决方案1】:

    您可以参考以下页面: https://msdn.microsoft.com/en-us/library/jj643289.aspx

    页面说: 您必须在与 Service Provider Foundation 服务一起使用的虚拟机对象上设置的关键属性如下:CloudId、StampId、VMTemplateId、Name。

    您可能需要分配 CloudId 和 StampId。 我是通过 RESTApi 完成的,它可以工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-22
      • 1970-01-01
      相关资源
      最近更新 更多