Subnet aks-subnet is in use and cannot be updated (AKS)

Admin OpenKonsequenz 21 Reputation points
2022-10-18T13:40:43.263+00:00

Hello all,

we have a couple of aks cluster running with stop start automation. Since today all clusters failed to start (failed state, Failed (Running)) with the following message:

Failed to start the Kubernetes service 'CLUSTERNAME'.
Error: Reconcile VNet failed.
Details: VNetReconciler retry failed: Category: ClientError; Code: Unspecified; SubCode: InUseSubnetCannotBeUpdated; Message: ; InnerMessage: ; Dependency: Microsoft.Network/virtualNetworks; OrginalError: Code="InUseSubnetCannotBeUpdated" Message="Subnet aks-subnet is in use and cannot be updated." Details=[]; AKSTeam: Networking, Retriable: false.

We didn't change anything and we are not using a custom subnet (default kubenet). Google isn't helpful here either (stackoverflow, github, mailinglist), there no topics which are helpful right now.

Cluster was created with
...
--enable-aad ^
--enable-azure-rbac ^
--disable-local-accounts ^
--load-balancer-sku basic ^
...

The basic sku public ip address shouldn't be a problem until 30 September 2025.
Kubernetes Versions is out of support 1.22.4 is currently beeing used but we can't updated it since the cluster doesn't start
in the first place. I don't think this is the issue though.

Can anyone help here or maybe has the same issue?

Best
Simon

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,950 questions
0 comments No comments
{count} votes

Accepted answer
  1. shiva patpi 13,161 Reputation points Microsoft Employee
    2022-10-21T18:43:37.46+00:00

    Hello @Admin OpenKonsequenz , @Nils Gruson , @Liebau, Robert ,
    If you are coming across the error message : InUseSubnetCannotBeUpdated , please run below commands:

    Refresh the VNET using the command:
    az resource update --ids /subscriptions/subId/resourceGroups/MC_resourcegroup/providers/Microsoft.Network/virtualNetworks/vnetname

    Refresh the AKS cluster using the command::
    az resource update --ids /subscriptions/ subId /resourceGroups/resourcegroupname/providers/Microsoft.ContainerService/managedClusters/aksclustername

    regards,
    Shiva.


5 additional answers

Sort by: Most helpful
  1. shiva patpi 13,161 Reputation points Microsoft Employee
    2022-10-18T15:31:27.177+00:00

    Hello @Admin OpenKonsequenz ,
    Can you try running the below command on your AKS cluster , below command will try to refresh your AKS cluster and restore to last known good state.

    az resource update -n aksclustername -g aksresourcegroup --namespace Microsoft.ContainerService --resource-type ManagedClusters

    Regards,
    Shiva.

    0 comments No comments

  2. Nils Gruson 1 Reputation point
    2022-10-18T19:28:50.833+00:00

    I have the same problem since yesterday, I cannot start my AKS cluster anymore.
    No changes were recently made to the cluster configuration.
    When I try Shiva's suggestion, the command fails after 15 minutes or so.

    From the activity log:

    Operations are not allowed when the managed cluster is not in the Running power state.


  3. Liebau, Robert 6 Reputation points
    2022-10-19T11:27:53.12+00:00

    I have the same problem since yesterday and also using start/stop automation to save budget over the night.


  4. Admin OpenKonsequenz 21 Reputation points
    2022-10-19T17:28:51.417+00:00

    Can you try running the below command on your AKS cluster , below command will try to refresh your AKS cluster and restore to last known good state.

    az resource update -n aksclustername -g aksresourcegroup --namespace Microsoft.ContainerService --resource-type ManagedClusters

    Thanks Siva for your quick answer.

    After running the command I get the same error like ngruson:

    (InternalOperationError) Operation failed after exceeding the maximum retry count.
    Code: InternalOperationError
    Message: Operation failed after exceeding the maximum retry count.

    0 comments No comments