共用方式為


疑難排解 InvalidParameter 錯誤

本文討論如何識別和解決 InvalidParameter 您嘗試建立和部署 Microsoft Azure Kubernetes Service (AKS) 叢集時發生的錯誤。

先決條件

  • Azure CLI 2.0.81 版或更新版本。 如果已安裝 Azure CLI,您可以執行 az --version來尋找版本號碼。

癥狀

當您建立 AKS 叢集時,通常會在建立叢集之前驗證提供的設定。 不過,在極少數情況下,參數會在建立 AKS 叢集之前通過驗證,但在建立叢集的資源時造成錯誤。 與無效參數相關的錯誤可能類似下列範例:

  • 情境:選取的 VM 大小無法使用

    Code="InvalidParameter"
    
    Message="**The requested VM size Standard_D4s_v3 is not available in the current region. The sizes available in the current region are: ExtraSmall_Internal, Small_Internal, Medium_Internal, Large_Internal, ExtraLarge_Internal, Standard_DC2as_v5, Standard_DC4as_v5, Standard_DC8as_v5, Standard_DC16as_v5, Standard_DC32as_v5, Standard_DC48as_v5, Standard_DC64as_v5, Standard_DC96as_v5, Standard_DC2ads_v5, Standard_DC4ads_v5, Standard_DC8ads_v5, Standard_DC16ads_v5, Standard_DC32ads_v5, Standard_DC48ads_v5, Standard_DC64ads_v5, Standard_DC96ads_v5, Standard_EC2as_v5, Standard_EC4as_v5, Standard_EC8as_v5, Standard_EC16as_v5, Standard_EC20as_v5, Standard_EC32as_v5, Standard_EC48as_v5, Standard_EC64as_v5, Standard_EC96as_v5, Standard_EC96ias_v5, Standard_EC2ads_v5, Standard_EC4ads_v5, Standard_EC8ads_v5, Standard_EC16ads_v5, Standard_EC20ads_v5, Standard_EC32ads_v5, Standard_EC48ads_v5, Standard_EC64ads_v5, Standard_EC96ads_v5, Standard_EC96iads_v5.\r\nFind out more on the available VM sizes in each region at <https://aka.ms/azureregions>."
    
    Target="vmSize"
    
  • 案例:叢集名稱無法使用或與 Azure 保留值衝突

    • 範例 1

      Code="InvalidParameter"
      
      Message="The value of parameter name is invalid. Error details: "omsagent-aks-dev-microsoft" managed cluster name is invalid because 'MICROSOFT' and 'WINDOWS' can't be used as either a whole word or a substring in the name.. Please see https://aka.ms/aks-naming-rules for more details."
      
    • 範例 2

      Message="The value of parameter name is invalid. Error details: "login" managed cluster name is invalid because 'LOGIN' and 'XBOX' can't be used at the start of a resource name, but can be used later in the name.. Please see https://aka.ms/aks-naming-rules for more details."
      
    • 範例 3

      Message=" The value of parameter name is invalid. Error details: "azure" managed cluster name is invalid because it is reserved.. Please see https://aka.ms/aks-naming-rules for more details.
      Target: name"
      

原因

發生此問題是因為以下其中一個條件成立:

  • Azure 虛擬機器 SKU 在選取的區域中無法使用。
  • 服務主體無效。
  • 虛擬網路、子網路或路由表無效。
  • Azure CLI 參數無效。
  • 參數名稱的值無法使用或由 Azure 保留。

叢集建立嘗試失敗也可能有其他原因。

Solution

在下表中,請遵循適當的疑難排解步驟的連結。

疑難排解步驟 參考連結
檢查SKU是否可用 解決 SKU 無法取得的錯誤
確認服務主體有效 服務主體與 AKS
確認用來建立叢集的任何命令都有效 az aks (Azure CLI 參考)
確認用來建立叢集的任何自訂網路資源都有效 在 AKS 中設定 Azure CNI 網路 ,並 使用使用者定義的路由自訂叢集輸出
請避免使用無法使用或 Azure 保留的值作為名稱 請參閱提供的錯誤訊息

詳細資訊

與我們連絡,以取得說明

如果您有疑問,可以詢問 Azure 社群支援。 您也可以將產品意見反應提交至 Azure 意見反應社群