如何获取创建HDInsight群集时可以使用的VM大小列表

时间:2015-12-15 13:28:19

标签: azure azure-virtual-machine hdinsight

鉴于c#.net 4.5.2,在创建HDInsight群集时,我如何知道我可以在我所在地区的头/工作节点使用的尺寸?

在门户网站上我得到A3,A4,A6,A7,A10,A11,D3,D4,D12,D13和D14 https://portal.azure.com/#create/Microsoft.HDInsightCluster

在Powershell中我得到了 北欧 A10,A11,A5,A6,A7,A8,A9,Basic_A0,Basic_A1,Basic_A2,Basic_A3,Basic_A4,ExtraLarge,ExtraSmall,Large,Medium,Small,Standard_D1,Standard_D1_v2,Standard_D11,Standard_D11_v2 ,Standard_D12,Standard_D12_v2,Standard_D13,Standard_D13_v2,Standard_D14,Standard_D14_v2,Standard_D2,Standard_D2_v2,Standard_D3,Standard_D3_v2,Standard_D4,Standard_D4_v2,Standard_D5_v2,Standard_DS1,Standard_DS11,Standard_DS12,Standard_DS13,Standard_DS14,Standard_DS2,Standard_DS3,Standard_DS4
https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-size-specs/

我应该使用什么API调用来获取我可以创建的可用HDInsights?

请注意;这是使用Microsoft.WindowsAzure.Management.HDInsight,Version = 1.5.12.0作为最新的Microsoft.Azure.Management.HDInsight,正在预览中

             var clusterInfo = new ClusterCreateParametersV2
             {
                Name = clusterConfig.ClusterName,
                Location = clusterConfig.Location,
                DefaultStorageAccountName = clusterConfig.StorageAccount.StorageAccountName,
                DefaultStorageAccountKey = clusterConfig.StorageAccount.StorageAccountKey,
                DefaultStorageContainer = _storageConfiguration.Containers.HDInsightInstance,
                UserName = clusterConfig.UserName,
                Password = clusterConfig.Password,
                ClusterSizeInNodes = clusterConfig.ClusterSize,
                Version = clusterConfig.Version,
                HeadNodeSize = clusterConfig.NodeSize,
                DataNodeSize = clusterConfig.NodeSize,
            };

```

1 个答案:

答案 0 :(得分:0)

在c#中,使用“Microsoft.Azure.Management.HDInsight”version =“1.1.0”

var location = "North Europe";
using (var client = new HDInsightManagementClient(AzureActiveDirectory.GetTokenCloudCredentials(SubscriptionId)))
{
    var response = await client.Clusters.GetCapabilitiesAsync(location);
    var sizes = response.VmSizes["iaas"].AvailableVmSizes.ToArray()
};
    }

iaas或paas