hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.64k forks source link

azurerm_managed_disk: ApplyResourceChange request was cancelled #23085

Open beparmentier opened 1 year ago

beparmentier commented 1 year ago

Is there an existing issue for this?

Community Note

Terraform Version

1.5.6

AzureRM Provider Version

3.71.0

Affected Resource(s)/Data Source(s)

azurerm_managed_disk

Terraform Configuration Files

resource "azurerm_managed_disk" "vm-tableau-node-02-disk-data" {
  name                 = "disk-vm-${local.global-env_name}-tableau-node-02-disk-data"
  count                = 1
  location             = azurerm_resource_group.tableau-resourcegroup.location
  resource_group_name  = azurerm_resource_group.tableau-resourcegroup.name
  storage_account_type = "Premium_LRS"
  create_option        = "Empty"
  zone                 = 2
  disk_size_gb         = local.tableau-tableaudatavmdisksize
  tags                 = local.tableau-tags
}

Debug Output/Panic Output

$ terraform init
Initializing the backend...
Successfully configured the backend "azurerm"! Terraform will automatically
use this backend unless the backend configuration changes.
Initializing provider plugins...
- Finding hashicorp/azurerm versions matching ">= 2.99.0"...
- Finding latest version of hashicorp/random...
- Installing hashicorp/random v3.5.1...
- Installed hashicorp/random v3.5.1 (signed by HashiCorp)
- Installing hashicorp/azurerm v3.71.0...
- Installed hashicorp/azurerm v3.71.0 (signed by HashiCorp)
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
$ terraform workspace select ${TERRAFORM_WORKSPACE} || terraform workspace new ${TERRAFORM_WORKSPACE}
Switched to workspace "npr".
$ terraform apply terraform_${TERRAFORM_WORKSPACE}.tfplan
azurerm_managed_disk.vm-tableau-node-03-disk-data[0]: Modifying... [id=/subscriptions/[MASKED]/resourceGroups/rg_npr_int_tableau_01/providers/Microsoft.Compute/disks/disk-vm-npr-tableau-node-03-disk-data]
azurerm_managed_disk.vm-tableau-node-02-disk-data[0]: Modifying... [id=/subscriptions/[MASKED]/resourceGroups/rg_npr_int_tableau_01/providers/Microsoft.Compute/disks/disk-vm-npr-tableau-node-02-disk-data]
azurerm_managed_disk.vm-tableau-node-03-disk-data[0]: Still modifying... [id=/subscriptions/fd503310-20e6-4af0-b5fe-.../disk-vm-npr-tableau-node-03-disk-data, 10s elapsed]
azurerm_managed_disk.vm-tableau-node-02-disk-data[0]: Still modifying... [id=/subscriptions/fd503310-20e6-4af0-b5fe-.../disk-vm-npr-tableau-node-02-disk-data, 10s elapsed]
╷
│ Error: Request cancelled
│ 
│   with azurerm_managed_disk.vm-tableau-node-02-disk-data[0],
│   on 05-compute-tableau.tf line 2[46](https://gitlab.com/mobivia/sysops/digidata/ops-infra/terraform/digidata-provisioning/-/jobs/4951693757#L46), in resource "azurerm_managed_disk" "vm-tableau-node-02-disk-data":
│  246: resource "azurerm_managed_disk" "vm-tableau-node-02-disk-data" {
│ 
│ The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.
╵
╷
│ Error: Request cancelled
│ 
│   with azurerm_managed_disk.vm-tableau-node-03-disk-data[0],
│   on 05-compute-tableau.tf line 327, in resource "azurerm_managed_disk" "vm-tableau-node-03-disk-data":
│  327: resource "azurerm_managed_disk" "vm-tableau-node-03-disk-data" {
│ 
│ The plugin.(*GRPCProvider).ApplyResourceChange request was cancelled.
╵

### Expected Behaviour

Applying terraform plan 

Terraform will perform the following actions:

azurerm_managed_disk.vm-tableau-node-02-disk-data[0] will be updated in-place

~ resource "azurerm_managed_disk" "vm-tableau-node-02-disk-data" { ~ disk_size_gb = 1024 -> 2048 id = "/subscriptions/[MASKED]/resourceGroups/rg_npr_int_tableau_01/providers/Microsoft.Compute/disks/disk-vm-npr-tableau-node-02-disk-data" name = "disk-vm-npr-tableau-node-02-disk-data" tags = { "appteam" = "pfrh" "billing" = "D1105" "bu" = "int" "codeproject" = "D1105" "country" = "int" "createdby" = "terraform" "domain" = "data" "env" = "qualif" "meta_environment" = "npr" "service" = "tableau" "status" = "used" "subscription_name" = "sub_npr_int_digidata" "team" = "infra:sysops" }

(15 unchanged attributes hidden)

}

azurerm_managed_disk.vm-tableau-node-03-disk-data[0] will be updated in-place

~ resource "azurerm_managed_disk" "vm-tableau-node-03-disk-data" { ~ disk_size_gb = 1024 -> 2048 id = "/subscriptions/[MASKED]/resourceGroups/rg_npr_int_tableau_01/providers/Microsoft.Compute/disks/disk-vm-npr-tableau-node-03-disk-data" name = "disk-vm-npr-tableau-node-03-disk-data" tags = { "appteam" = "pfrh" "billing" = "D1105" "bu" = "int" "codeproject" = "D1105" "country" = "int" "createdby" = "terraform" "domain" = "data" "env" = "qualif" "meta_environment" = "npr" "service" = "tableau" "status" = "used" "subscription_name" = "sub_npr_int_digidata" "team" = "infra:sysops" }

(15 unchanged attributes hidden)

}


### Actual Behaviour

terraform crash

### Steps to Reproduce

just increase disk size

### Important Factoids

_No response_

### References

_No response_
jchenbl commented 1 year ago

also have the same issue on latest version (3.72.0), when I lock the provider to the version 3.64.0 it works

mpjtaylor commented 1 year ago

We also have this issue with : Terraform Version 1.5.0

AzureRM Provider Version 3.75.0 (and tested with versions 3.76, 3.77 and 3.78)

msl0 commented 9 months ago

I had the same problem. It worked for me in the versions listed below, but I didn't investigate it further, I don't have a debug log, and I executed the terraform apply command on another machine, so I can't clearly say whether the problem concerns the terraform version, the provider, or whether it is something else.

terraform version
Terraform v1.6.3
on windows_amd64
+ provider registry.terraform.io/azure/azapi v1.12.0
+ provider registry.terraform.io/hashicorp/azurerm v3.88.0
+ provider registry.terraform.io/hashicorp/null v3.2.2
+ provider registry.terraform.io/hashicorp/random v3.6.0

Your version of Terraform is out of date! The latest version
is 1.7.0. You can update by downloading from https://www.terraform.io/downloads.html
samehsalhi commented 9 months ago

We also have the issue with: Terraform version 1.5.7 AzureRM provider version 3.84.0 disk_size_gb = 2048 -> 4096

And issue resolved with: upgrading AzureRM version to 3.90.0

msl0 commented 8 months ago

@rcskosir do you know if anyone is working on it? In general, I wonder if it's a problem with the provider or with Terraform