i have create a AKS using terraform, once the cluster is created, i ran the command
az vmss list -g <node-resource-group-name> --query [0].name -o tsv
but this command has given no result, but the expectation was to get the VMSS name.
i have create a AKS using terraform, once the cluster is created, i ran the command
az vmss list -g <node-resource-group-name> --query [0].name -o tsv
but this command has given no result, but the expectation was to get the VMSS name.
To view a list of VM instance in a scale set, use az vmss list-instances. The following example lists all VM instances in the scale set named myScaleSet in the myResourceGroup resource group. Provide your own values for these names:
az vmss list-instances \
--resource-group myResourceGroup \
--name myScaleSet \
--output table
Manage a virtual machine scale set with the Azure CLI
https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-manage-cli
If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.
hi @learn2skills thank you for your reply but , i have asked for how to get aks vmss's name.
i am not looking to get instances of every VMSS.
i am unable to get vmss name by running above command that i provided.
@MinorMona-1054 , Your question is answered at https://stackoverflow.com/a/68095827/16169604
Please use the following commands to get the name of the vmss associated with an AKS nodepool:
az aks nodepool list -g $ClusterRG --cluster-name $ClusterName -o table
Get the desired node pool name from the output. We shall refer to this later as <NODE_POOL_NAME>
CLUSTER_RESOURCE_GROUP=$(az aks show --resource-group YOUR_Resource_Group --name YOUR_AKS_Cluster --query nodeResourceGroup -o tsv)
az vmss list -g $CLUSTER_RESOURCE_GROUP --query "[?tags.poolName =='<NODE_POOL_NAME>'].{VMSS_Name:name}" -o tsv
Hope this helps.
Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.
10 people are following this question.