powershell - 通过 Azure PowerShell 预配 Azure VM 时出现“角色大小”错误

标签 powershell azure

我正在尝试通过 Azure PowerShell 配置 Azure VM,如下所示:New-AzureVMConfig -Name $vmName -InstanceSize "Medium"-ImageName $imageName |添加-AzureProvisioningConfig -Linux -LinuxUser $用户名 -密码 $密码| New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location

当然,变量的所有值都已设置。当我执行上述命令时,出现错误:New-AzureVM : BadRequest: Role size: Medium is not support in a Provisioned storage account.

我使用的替代方案是“Medium”(而不是“Medium”)、“Small”、“Large”和“Standard_D1”。什么都不起作用!我错过了什么?

<小时/>

请注意,我在订阅中设置的存储帐户 (Set-AzureSubscription) 使用高级存储。它是通过 sort New-AzureStorageAccount -StorageAccountName "yourpremiumaccount"-Location "West US"-Type "Premium_LRS" 命令创建的(文档 here )。

不用说,如果我将其设置为使用非高级存储的帐户,则上述 New-AzureVMConfig 命令有效。

最佳答案

根据 Microsoft 的说法,高级存储虚拟机不支持您正在使用的虚拟机 (Standard_Dx),您可以查看完整文章 here .

Premium Storage Disks: Azure Premium Storage supports VM disks that can be attached to DS, DSv2 or GS series Azure VMs.

尝试更改为受支持的系列之一,例如 DS1,它应该可以工作:

New-AzureVMConfig -Name $vmName -InstanceSize "Standard_DS1" -ImageName $imageName | Add-AzureProvisioningConfig -Linux -LinuxUser $username -Password $password | New-AzureVM -ServiceName $serviceName -ReservedIPName $reservedIP -Location $location

关于powershell - 通过 Azure PowerShell 预配 Azure VM 时出现“角色大小”错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34040793/

相关文章:

powershell - 查找和替换多行字符串

date - PowerShell - 将日期格式化为 yyMMdd 格式

powershell - FFMPEG HLS 多个音轨不同步

asp.net-mvc - 发布到Azure并启动应用程序后,表没有自动生成?

powershell - 如何在PowerShell中捕获icacls.exe的所有输出

azure - ARM 模板 - 部署链接服务时错误请求失败

Azure Function App忽略依赖关系

azure - 如何在 Azure Active Directory Graph API 中创建具有指定目录角色的用户(工作帐户)

azure - 如何使用Azure Cloud Functions将所有Azure存储队列消息批处理成Blob?

arrays - 是否可以在 PowerShell 中使 IndexOf 不区分大小写?