Open dehouwerd opened 3 months ago
Hi @dehouwerd I am unable to reproduce your problem. I can deploy the workspace fine with the configuration you posted above, with some modification related to virtual network / subnet config (refer to Modules/databricks_workspace/main.tf).
I recommend checking your virtual network / subnet configuration as recommended by the error message "The subnet privdbxs CIDR range '<null>' is not within the Virtual Network CIDR range '192.168.2.0/24'
, probably it is referencing to the wrong subnet / misconfigured.
Example of a valid subnet config that is "within virtual network CIDR range":
10.179.0.0/16
10.179.1.0/24
Note that you can also use terraform data sources to refer to existing virtual network, subnets, etc. to reduce brittleness of referring things by its string id.
Hi @gerrytan, the provided value is correct. The apply command fails when a non-existing subnet name is provided. An API call looks to be made but the value mentioned in the response has an s appended to the output.
API Response:
│
│ ----[start]----
│ {
│ "status": "Failed",
│ "error": {
│ "code": "SubnetIsNotWithinVnetError",
│ "message": "The subnet privdbxs CIDR range '<null>' is not within the Virtual Network CIDR range '192.168.2.0/24'"
│ }
│ }
@dehouwerd there's definitely no logic in the code that appends an s
suffix at the end of subnet. My suspicion are either a stray terraform variable override, or the NSG association id you set references a different subnet with an s
suffix.
Can you please double check the list of subnets currently available in the virtual network?
If still no luck can you please try again with a different subnet (with different name and CIDR range) ?
@dehouwerd can you please also refer to this doc: https://learn.microsoft.com/en-us/azure/databricks/security/network/classic/vnet-inject
The subnet
<subnet-id>
is already in use by workspace<workspace-id>
Possible cause: you are creating a workspace in a VNet with host and container subnets that are already being used by an existing Azure Databricks workspace. You cannot share multiple workspaces across a single subnet. You must have a new pair of host and container subnets for each workspace you deploy.
You did not encounter that exact error, but isolating your problem by deploying your workspace against a new pair of subnet will give us more clue towards the root cause.
Hi everyone, facing the same issue BUT using bicep template deployment. So the piece of template is the following:
resource workspace 'Microsoft.Databricks/workspaces@2023-02-01' = {
name: workspaceName
location: location
tags: tags
sku: {
name: pricingTier
}
properties: {
managedResourceGroupId: managedResourceGroupId
parameters: {
customVirtualNetworkId: {
value: virtualNetworkId
}
customPublicSubnetName: {
value: publicSubnetName
}
customPrivateSubnetName: {
value: privateSubnetName
}
The parameters for the subnet names in .parameters.json are the following:
"privateSubnetName": {
"value": "...-dbr-snet01"
},
"publicSubnetName": {
"value": "...-dbr-snet02"
},
During today's deployment I am catching the following error:
Status Message: The subnet ...-dbr-snet01s CIDR range '<null>' is not within the Virtual Network CIDR range
'10.141.0.0/20,10.141.16.0/20' (Code:SubnetIsNotWithinVnetError)
The template is quite simple, and there are no code where the 's' suffix at the end of the subnet name could have appended.
Both subnet with the correct CIDR are exist in the Virtual Network.
Hi @Anton-Kalashnik88 , can you please post the virtual network configuration with az network vnet show -n [virtual-network-name] -g [resource-group-name]
. Please redact any sensitive information.
Alternatively you can also raise a support request through the portal to have us investigate a specific Databricks workspace deployment.
This is not a terraform or databricks issue. It is a Microsoft Azure Bug. This happens with vnet injection. When creating a subnet from the portal, it creates as "addressPrefixes" instead of "addressPrefix", the difference is in the plural. This causes Terraform or ARM deployment to fail because it looks for the singular, not the plural. Since it does not find it, it creates the error. I raised the issue with Microsoft. In the meantime, a temporal solution is to create the subnet using AZ CLI, this will create the subnets with the correct parameter name, and you'll be able to deploy.
Is there an existing issue for this?
Community Note
Terraform Version
1.6.2
AzureRM Provider Version
3.115.0
Affected Resource(s)/Data Source(s)
azurerm_databricks_workspace
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Succesfull resource deployment
Actual Behaviour
Terraform fails to deploy the resource. The subnet in the error message has an extra 's' appended at the end of the subnet. The resouce in the Azure portal (failed state) has the correct Custom public subnet name JSON value.
Steps to Reproduce
terraform init terraform apply --auto-approve
Important Factoids
No response
References
No response