【问题标题】:Getting 'BadRequest' error when provisioning Azure VM (Ubuntu image) with reserved IP via Azure PowerShell通过 Azure PowerShell 预配具有保留 IP 的 Azure VM(Ubuntu 映像)时出现“BadRequest”错误
【发布时间】:2015-12-04 23:18:12
【问题描述】:

我正在尝试使用 Ubuntu 14.04 服务器和保留 IP 配置新的 Azure VM。我正在使用 Azure PowerShell 来执行此操作。当一切都说完了,我最终得到了错误:New-AzureVM : BadRequest: Disktype Linux cannot be used with WindowsProvisioningConfigurationSet。我该如何解决这个问题?


背景:我从Add-AzureAccountSet-AzureSubscription 开始。然后我为:$vmName$username$password$location$reservedIP$imageFamily$imageName 设置值。

仅供参考,$imageFamily = "Ubuntu Server 14.04 LTS"

$imageName = Get-AzureVMImage | where { $_.ImageFamily -eq $imageFamily } | sort PublishedDate -Descending | select -ExpandProperty ImageName -First 1

我终于执行了New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Windows -AdminUsername $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location,最终得到了上述错误。

注意:如果我将Add-AzureProvisioningConfig -Windows 更改为Add-AzureProvisioningConfig -Linux,则会出现错误:parameter set cannot be resolve using the specified named parameters.

【问题讨论】:

    标签: powershell ubuntu azure


    【解决方案1】:

    那个 Add-AzureVMConfig 命令是错误的。在这种情况下正确的命令应该是:New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Linux -LinuxUser $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location

    可以在https://msdn.microsoft.com/en-us/library/azure/dn495299.aspx找到相关文档

    【讨论】:

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