Can't create multiple resources using modules

Hello, need some help, I need to create multiple VMs using Azure Devops Pipelines. The pipeline works when creating one single or multiple when defining all the parameters in a single file. But I need to create dozens, so I created 2 modules, one for the windows VMs and one for the SQL VMs.

As a test I’m trying to create 2 for each module but when the main file runs It creates 1 VM for each module, but the second fail with this error message:

Error creating Windows Virtual Machine “vm02” (Resource Group “TerraformTestRG”): compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=0 – Original Error: autorest/azure: Service returned an error. Status= Code=“OperationNotAllowed” Message="Operation could not be completed as it results in exceeding approved standardDSv3Family Cores quota. Additional details - Deployment Model: Resource Manager, Location: eastus, Current Limit: 10, Current Usage: 8, Additional Required: 4, (Minimum) New Limit Required: 12. Submit a request for Quota increase at Microsoft Azure by specifying parameters listed in the ‘Details’ section for deployment to succeed. Please read more about quota limits at https://docs.microsoft.com/en-us/azure/azure-supportability/per-vm-quota-requests."e[0m

2021-08-07T02:08:09.8337109Z

2021-08-07T02:08:09.8338070Z e[0m on Modules\Windows\main.tf line 19, in resource “azurerm_windows_virtual_machine” “cboardvm”:

2021-08-07T02:08:09.8338940Z 19: resource “azurerm_windows_virtual_machine” “cboardvm” e[4m{e[0m

2021-08-07T02:08:09.8339485Z e[0m

2021-08-07T02:08:09.8339833Z e[0me[0m

2021-08-07T02:08:09.8340158Z e[31m

2021-08-07T02:08:09.8342801Z e[1me[31mError: e[0me[0me[1mError creating Windows Virtual Machine “vm01” (Resource Group “TerraformTestRG”): compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=0 – Original Error: autorest/azure: Service returned an error. Status= Code=“OperationNotAllowed” Message="Operation could not be completed as it results in exceeding approved standardDSv3Family Cores quota. Additional details - Deployment Model: Resource Manager, Location: eastus, Current Limit: 10, Current Usage: 8, Additional Required: 4, (Minimum) New Limit Required: 12. Submit a request for Quota increase at Microsoft Azure by specifying parameters listed in the ‘Details’ section for deployment to succeed. Please read more about quota limits at https://docs.microsoft.com/en-us/azure/azure-supportability/per-vm-quota-requests."e[0m

2021-08-07T02:08:09.8345629Z

2021-08-07T02:08:09.8346273Z e[0m on Modules\Windows\main.tf line 19, in resource “azurerm_windows_virtual_machine” “cboardvm”:

2021-08-07T02:08:09.8347122Z 19: resource “azurerm_windows_virtual_machine” “cboardvm” e[4m{e[0m

2021-08-07T02:08:09.8347703Z e[0m

2021-08-07T02:08:09.8348124Z e[0me[0m

Processing: main.tf…
Processing: variables.tf…

Does anybody has an idea how to make the modules to work for multiple resources?

As the error says you do not have enough permitted capacity to create more cores, so you need to request a quota increase.

1 Like

You are right, I must have missed that part of the log in the devops log output, thanks that was the fix, I changed the VM size and its indeed creating al required resources