SKU 利用不可エラーを解決する

この記事では、Azure サブスクリプションのリージョンまたは可用性ゾーンで SKU を使用できない場合のエラーを解決する方法について説明します。 リソース SKU の例として、仮想マシン (VM) のサイズやストレージ アカウントの種類があります。 エラーは、Azure Resource Manager テンプレート (ARM テンプレート) または Bicep ファイルを使用するデプロイ中に発生します。 このエラーは、使用できない SKU の size パラメーターを指定する New-AzVMaz vm create などのコマンドでも発生します。

症状

使用できない SKU に対して VM をデプロイすると、エラーが発生します。 Azure CLI と Azure PowerShell デプロイ コマンドで、要求されたサイズが場所またはゾーンで使用できないというエラー メッセージが表示されます。 Azure portal のアクティビティ ログに、エラー コード SkuNotAvailable または InvalidTemplateDeployment が表示されます。

この例では、New-AzVM に、使用できない SKU の -Size パラメーターが指定されています。 ポータルのアクティビティ ログにエラー コード SkuNotAvailable が示されます。

The requested size for resource '<resource ID>' is currently not available in location '<location>'
zones '<zones>' for subscription '<subscription ID>'.
Please try another size or deploy to a different location or zones.

使用できない SKU に対して ARM テンプレートまたは Bicep ファイルを使用して VM をデプロイすると、検証エラーが発生します。 エラー コード InvalidTemplateDeployment とエラー メッセージが表示されます。 デプロイは開始していないのでデプロイ履歴は表示されませんが、エラーがポータルのアクティビティ ログに記録されます。

Error: Code=InvalidTemplateDeployment
Message=The template deployment failed with error: The resource with id: '<resource ID>' failed validation
with message: The requested size for resource '<resource ID>' is currently not available in
location '<location>' zones '<zones>' for subscription '<subscription ID>'.
Please try another size or deploy to a different location or zones.

原因

このエラーは、次のシナリオで発生します。

  • 選択したリソース SKU (VM サイズなど) が、場所またはゾーンで使用できない場合。
  • Azure Spot VM または Spot スケール セット インスタンスをデプロイしていて、この場所に Azure Spot 用の容量がない場合。 詳細については、スポットのエラー メッセージに関する記事を参照してください。

解決策

ビジネス ニーズを満たす場所またはゾーンのお使いのサブスクリプションで SKU を使用できない場合は、Azure サポートに SKU 要求を送信します。

ローカルまたはゾーンで使用できる SKU を特定するには、az vm list-skus コマンドを使用します。

az vm list-skus --location centralus --size Standard_D --all --output table
  • --location では、出力を場所別にフィルター処理します。
  • --size では、サイズ名の一部で検索します。
  • --all では、すべての情報を表示し、現在のサブスクリプションで使用できないサイズを含みます。
ResourceType     Locations    Name               Zones    Restrictions
---------------  -----------  --------------     -------  --------------
virtualMachines  centralus    Standard_D1        1        None
virtualMachines  centralus    Standard_D11       1        None
virtualMachines  centralus    Standard_D11_v2    1,2,3    None
virtualMachines  centralus    Standard_D16ds_v4  1,2,3    NotAvailableForSubscription, type: Zone,
                                                          locations: centralus, zones: 1,2,3

可用性ゾーン

場所の可用性ゾーンのすべてのコンピューティング リソースを表示できます。 既定では、制限のない SKU だけが表示されます。 制限のある SKU を含めるには、--all パラメーターを使用します。

az vm list-skus --location centralus --zone --all --output table
ResourceType      Locations    Name                 Zones    Restrictions
----------------  -----------  -------------------  -------  --------------
disks             centralus    Premium_LRS          1,2,3    None
disks             centralus    Premium_LRS          1,2,3    None
virtualMachines   centralus    Standard_A2_v2       1,2,3    None
virtualMachines   centralus    Standard_D16ds_v4    1,2,3    NotAvailableForSubscription, type: Zone,
                                                             locations: centralus, zones: 1,2,3

可用性ゾーンでは、VM などの resourceType によってフィルター処理できます。

az vm list-skus --location centralus --resource-type virtualMachines --zone --all --output table
ResourceType      Locations    Name                 Zones    Restrictions
----------------  -----------  -------------------  -------  --------------
virtualMachines   centralus    Standard_A1_v2       1,2,3    None
virtualMachines   centralus    Standard_A2m_v2      1,2,3    None
virtualMachines   centralus    Standard_A2_v2       1,2,3    None
virtualMachines   centralus    Standard_D16ds_v4    1,2,3    NotAvailableForSubscription, type: Zone,
                                                             locations: centralus, zones: 1,2,3