【发布时间】: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-AzureAccount 和Set-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