Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows OS disk encryption (disk encryption set) cannot be updated after VM is created #6737

Closed
kumarkran opened this issue May 1, 2020 · 3 comments · Fixed by #6846
Closed

Comments

@kumarkran
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

`Terraform v0.12.18

  • provider.azurerm v2.7.0
    `

Affected Resource(s)

  • azurerm_windows_virtual_machine

Terraform Configuration Files

resource "azurerm_windows_virtual_machine" "windows_vm" {
  count               = local.is_windows ? var.vm_count : 0
  name                = local.vm_names[count.index]
  location            = var.vm_location
  resource_group_name = var.vm_resource_group_name
  availability_set_id = azurerm_availability_set.availability_set.id
  size                = var.vm_size
  network_interface_ids = [
    azurerm_network_interface.primary_network_interface[count.index].id
  ]
source_image_id = var.os_image_id
dynamic "source_image_reference" {
    for_each = var.os_image_id == null ? [1] : []
    content {
      publisher = local.resolved_image.publisher
      sku       = local.resolved_image.sku
      offer     = local.resolved_image.offer
      version   = local.resolved_image.version
    }
  }
  os_disk {
    name                   = "${local.vm_names[count.index]}-osdisk"
    caching                = "ReadWrite"
    storage_account_type   = var.data_disk_sku
    disk_encryption_set_id = var.disk_encryption_set_id
  }

  admin_username = var.admin_username
  admin_password = var.admin_password
}

Expected Behavior

Windows OS disk encryption set updated to existing VM's

Actual Behavior

Unable to update OS disk encryption (Disk encryption set) for existing VM's

Steps to Reproduce

  1. Terraform apply VM initially without disk encryption set
  2. Set Disk encryption set id
    3.Run terraform apply after updating disk encryption set id

Important Factoids

This issue is similar to #6183
Only Linux VM' got the fix in #6230

@ArcturusZhang
Copy link
Contributor

Hi @kumarkran thanks for this issue!
I can reproduce this and will work on a similar fix to the linux VMs on windows VMs.

@ArcturusZhang ArcturusZhang self-assigned this May 3, 2020
ArcturusZhang added a commit to ArcturusZhang/terraform-provider-azurerm that referenced this issue May 11, 2020
@tombuildsstuff tombuildsstuff added this to the v2.10.0 milestone May 11, 2020
katbyte pushed a commit that referenced this issue May 11, 2020
…n settings (#6846)

Fixes #6737

This applies the changes in PR #6230 to windows virtual machine which only fixes the problem in linux virtual machine despite its title says linux|windows.
jrauschenbusch pushed a commit to jrauschenbusch/terraform-provider-azurerm that referenced this issue May 13, 2020
…n settings (hashicorp#6846)

Fixes hashicorp#6737

This applies the changes in PR hashicorp#6230 to windows virtual machine which only fixes the problem in linux virtual machine despite its title says linux|windows.
@ghost
Copy link

ghost commented May 15, 2020

This has been released in version 2.10.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.10.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Jun 11, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Jun 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants