Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
384 stars 1.25k forks source link

az ml computetarget create aks is always ignoring --service-cidr value and use default one #4555

Open naimadswdn opened 2 years ago

naimadswdn commented 2 years ago

Extension name (the extension in question)

azure-cli-ml

Description of issue (in as much detail as possible)

Version details: { "azure-cli": "2.33.0", "azure-cli-core": "2.33.0", "azure-cli-telemetry": "1.0.6", "extensions": { "azure-cli-ml": "1.37.0", "azure-devops": "0.23.0" } }

Issue: Seems like when running az ml computetarget create aks it always want to create it with service CIDR 10.0.0.0/16, even when different value has been provided.

Prerequisites for reproduction:

Run following command:

az ml computetarget create aks --name testaks --resource-group test-rg --subnet-name test-subnet--vnet-name test-vnet --workspace-name test-ml --vnet-resourcegroup-name test-rg --docker-bridge-cidr 172.17.0.1/16 --service-cidr 10.10.0.0/16 --dns-service-ip 10.10.0.10 -v

It will throw error like:

{'Azure-cli-ml Version': '1.37.0', 'Error': ComputeTargetException:
        Message: Compute object provisioning polling reached non-successful terminal state, current provisioning state: Failed
Provisioning operation error:
{'code': 'BadRequest', 'message': 'Cluster Deployment failed. Service invocation failed!\r\nRequest: PUT https://westeurope.management.azure.com//subscriptions/****/resourceGroups/***/providers/Microsoft.ContainerService/managedClusters/***?api-version=2020-09-01\r\nStatus Code: 400 BadRequest\r\nReason Phrase: Bad Request\r\nResponse Body: {\n  "code": "ServiceCidrOverlapExistingSubnetsCidr",\n  "message": "The specified service CIDR 10.0.0.0/16 is conflicted with an existing subnet CIDR 10.0.0.0/24",\n  "target": "networkProfile.serviceCIDR"\n }'}
        InnerException None
        ErrorResponse
{
    "error": {
        "message": "Compute object provisioning polling reached non-successful terminal state, current provisioning state: Failed\nProvisioning operation error:\n{'code': 'BadRequest', 'message': 'Cluster Deployment failed. Service invocation failed!\\r\\nRequest: PUT https://westeurope.management.azure.com//subscriptions/****/resourceGroups/****/providers/Microsoft.ContainerService/managedClusters/***?api-version=2020-09-01\\r\\nStatus Code: 400 BadRequest\\r\\nReason Phrase: Bad Request\\r\\nResponse Body: {\\n  \"code\": \"ServiceCidrOverlapExistingSubnetsCidr\",\\n  \"message\": \"The specified service CIDR 10.0.0.0/16 is conflicted with an existing subnet CIDR 10.0.0.0/24\",\\n  \"target\": \"networkProfile.serviceCIDR\"\\n }'}"
    }
}}

Whatever I specified for --service-cidr it always want to create it with default 10.0.0.0/16. I tried with 10.1.0.0/16, 10.2.0.0/16 etc -> always the same. To fix it, I had to edit my default subnet range (10.0.0.0/24) to 10.1.0.0/24.

So tu summarize, it looks like whatever is passed to --service-cidr it is ignored and command is trying to use default 10.0.0.0/16.


yonzhan commented 2 years ago

route to CXP team

YutongTie-MSFT commented 2 years ago

@naimadswdn Sorry for the late reply, product team is double checking on this item to make sure the right operation. Thanks.

microsoft-github-policy-service[bot] commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureml-github.