-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect output of the az network vnet subnet list-available-ips
command
#23997
Comments
@necusjz for awareness |
#13853 can you take a look at this? |
Thank you for your feedback. This has been routed to the support team for assistance. |
@RakeshMohanMSFT : Thank you for the link. This leads me to another question. Does the option |
@subhasishdc Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update. |
@subhasishdc The portal shows how many available IP address exist in each subnet. Did you check if this number in portal matched what you got with CLI command response ? We can get the list of available Ips from Get-AzVirtualNetworkUsageList PS cmdlet as well, by subtracting the CurrentValue (no of IPs being used) from the Limit (total no of available IPs) Example:
Name : Subnet size and usage Name : Subnet size and usage Could you please try and check if the above command helps and returns the required value ? Also while debugging this further, I see that the REST API invoked by this CLI command is CheckIPAddressAvailability Rest API. The response (output) returned here is 'Private IP address availability and list of other free addresses if the requested one is not available'. Hope this helps. |
@navba-MSFT : Checked the portal. Under available ip's, portal shows |
@subhasishdc While I get you the answer for the |
@subhasishdc The In the screenshot, you can see its a gateway subnet. We can have gateways with multiple instances based on requirement and SKU. So it will be either a VPN gateway or Express Route gateway using this. Another example could be, if that subnet belongs to app gateway which internally uses VMSS and they keep scaling up and down. So you need to investigate which Azure resource is using that subnet. Hope this answers. |
@subhasishdc I wanted to do quick follow-up to check if you had a chance to look at my above comments. Please let us know if you had any updates on this. Awaiting your reply. |
@navba-MSFT : I will get back next week on this. |
@subhasishdc Thanks for your reply. I shall wait for the updates from you. |
@navba-MSFT: Checked using the
Why it displays the negative I do not know. However, the other subnets within the Vnet show their counts in numbers |
@subhasishdc Thanks for getting back. I am glad that the PS cmdlet is showing the right count in numbers. |
@navba-MSFT : That makes sense, thank you. Also, did you get a chance to figure out what's wrong with the |
@subhasishdc Thanks for your reply. Regarding the Similar question was raised here, here and here. The available workaround is to use the Get-AzVirtualNetworkUsageList PS cmdlet or use the below AzCLI command. This will show the limit ( available IP in the response for each subnet).
Hope this helps. |
@navba-MSFT : Thank you for the explanation. I get that part. However, the initial query remains the same. Does |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aznetsuppgithub. Issue DetailsI was checking the number of available ip addresses in the subnet where an application gateway is deployed using this:
Following shows my subnet size and the app gw instances deployed.
Based on the app gw documentation (https://docs.microsoft.com/en-us/azure/application-gateway/configuration-infrastructure#size-of-the-subnet), app gw uses one private IP address per instance, plus another private IP address if a private front-end IP is configured. Azure also reserves five IP addresses in each subnet for internal use: the first four and the last IP addresses. Taking the above example for reference, total available ip addresses in the subnet 10.0.36.240/28 is 16. Azure uses 5 ip addresses and app gw has 8 instances. There should be only 3 ip addresses remaining. However, the https://learn.microsoft.com/en-us/cli/azure/network/vnet/subnet?view=azure-cli-latest#az-network-vnet-subnet-list-available-ips -- This is the example in the documentation. It mentions "List some available ips in the subnet.". Does it mean it shows free ip addresses which are not used yet in the subnet or just it just display a few ip addresses belonging to the subnet irrespective of weather they are being used or not. Am I missing something here or is there an issue with what the command is showing.
|
@subhasishdc Thanks for your reply. I am adding the Service team to look into this ask and assist you further. @aznetsuppgithub Could you please look into this ask and provide an update ? Thanks in advance. |
I looked into the code as of 7/27/2023 the value 5 is hardcoded and it doesn't fetch the entire list.
|
I was checking the number of available ip addresses in the subnet where an application gateway is deployed using this:
schowdhu@schowdhu-mn1 ~ % az network vnet subnet list-available-ips --resource-group aag-rg --vnet-name aagVnet -n AAG1Subnet This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus [ "10.0.36.244", "10.0.36.245", "10.0.36.246", "10.0.36.247", "10.0.36.248" ]
Following shows my subnet size and the app gw instances deployed.
[schowdhu@schowdhu-ld3 ~]$ az network vnet subnet show -g aag-rg -n AAG1Subnet --vnet-name aagVnet | jq '.addressPrefix' "10.0.36.240/28"
[schowdhu@schowdhu-ld3 ~]$ az network application-gateway list -g aag-rg | jq '.[] | .name,.sku,.operationalState' "aag01" { "capacity": 8, "name": "Standard_Medium", "tier": "Standard" } "Running"
Based on the app gw documentation (https://docs.microsoft.com/en-us/azure/application-gateway/configuration-infrastructure#size-of-the-subnet), app gw uses one private IP address per instance, plus another private IP address if a private front-end IP is configured. Azure also reserves five IP addresses in each subnet for internal use: the first four and the last IP addresses. Taking the above example for reference, total available ip addresses in the subnet 10.0.36.240/28 is 16. Azure uses 5 ip addresses and app gw has 8 instances. There should be only 3 ip addresses remaining. However, the
az network vnet subnet list-available-ips
command shown above shows 5 ip addresses available.https://learn.microsoft.com/en-us/cli/azure/network/vnet/subnet?view=azure-cli-latest#az-network-vnet-subnet-list-available-ips -- This is the example in the documentation. It mentions "List some available ips in the subnet.". Does it mean it shows free ip addresses which are not used yet in the subnet or just it just display a few ip addresses belonging to the subnet irrespective of weather they are being used or not.
Am I missing something here or is there an issue with what the command is showing.
The text was updated successfully, but these errors were encountered: