简体   繁体   English

通过Azure PowerShell用保留的IP设置Azure VM(Ubuntu映像)时出现“ BadRequest”错误

[英]Getting 'BadRequest' error when provisioning Azure VM (Ubuntu image) with reserved IP via Azure PowerShell

I'm trying to provision a new Azure VM w/ Ubuntu 14.04 server and a reserved IP. 我正在尝试使用Ubuntu 14.04服务器配置一个新的Azure VM,并保留一个IP。 I'm using Azure PowerShell for doing this. 我正在使用Azure PowerShell来执行此操作。 When everthing's said and done, I end up getting the error: New-AzureVM : BadRequest: Disktype Linux cannot be used with WindowsProvisioningConfigurationSet. 说完一切后,我最终得到以下错误: New-AzureVM:BadRequest:磁盘类型Linux无法与WindowsProvisioningConfigurationSet一起使用。 How do I solve this problem? 我该如何解决这个问题?


Background: I began via Add-AzureAccount and Set-AzureSubscription . 背景:我从Add-AzureAccountSet-AzureSubscription I then set values for: $vmName , $username , $password , $location , $reservedIP , $imageFamily and $imageName . 然后,我为以下$vmName设置值: $vmName$username$password$location$reservedIP$imageFamily$imageName

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

and

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

I finally executed New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Windows -AdminUsername $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location 我终于执行了New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Windows -AdminUsername $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Windows -AdminUsername $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Windows -AdminUsername $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location and ended up getting the aforementioned error. New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Windows -AdminUsername $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location并最终得到上述错误。

Note: If I change Add-AzureProvisioningConfig -Windows to Add-AzureProvisioningConfig -Linux , I get the error: parameter set cannot be resolved using the specified named parameters. 注意:如果将Add-AzureProvisioningConfig -Windows更改为Add-AzureProvisioningConfig -LinuxAdd-AzureProvisioningConfig -Linux出现错误: 无法使用指定的命名参数来解析参数集。

That Add-AzureVMConfig command is erroneous. 该Add-AzureVMConfig命令是错误的。 The correct command in this case ought to be: New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Linux -LinuxUser $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location 在这种情况下,正确的命令应该是: New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Linux -LinuxUser $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location New-AzureVMConfig -Name $vmName -InstanceSize Small -ImageName $imageName | Add-AzureProvisioningConfig -Linux -LinuxUser $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location

Documentation for this can be found at https://msdn.microsoft.com/en-us/library/azure/dn495299.aspx 可以在https://msdn.microsoft.com/zh-cn/library/azure/dn495299.aspx中找到有关此文档的信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过Azure PowerShell配置Azure VM时出现``角色大小''错误 - 'Role size' error when provisioning Azure VM via Azure PowerShell 通过Powershell在云服务上设置Azure预留IP - Set Azure Reserved IP on cloud service via powershell 使用Powershell使用现有映像在Azure RM中创建VM时出错 - getting error when creating VM in Azure RM using an existing image using powershell 如何通过Powershell获取新创建的Azure VM的IP地址 - How to get the IP address of the newly created Azure VM via Powershell 无法通过PowerShell和门户在Azure上创建自定义映像VM - Unable to create custom image VM's on Azure via powershell & portal 使用 PowerShell 和 AzureRm 模块创建 Azure 数据工厂触发器时获取 HTTP 状态代码:BadRequest - Getting HTTP Status Code: BadRequest when creating Azure Data Factory Trigger using PowerShell with AzureRm module 无法通过PowerShell在Azure VM连接中建立SSL连接错误 - SSL Connection cannot be established error in Azure VM Connection via powershell 使用 powershell 在 Azure 中创建 VM,没有公共 IP - Create VM in Azure with powershell with no public IP 如何使用 Powershell 7 将保留的 IP 地址分配给 Azure 上的云服务? - How to assign a reserved IP address to a cloud service on Azure using Powershell 7? 通过 VM 的 powershell 管理 azure 存储帐户 - Managed azure storage account via powershell for VM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM