-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Force recreation if storage_data_disk.creation_option changes #218
Conversation
Hey @thiagocaiubi Thanks for opening this PR :)
So the best way to do this is to add an acceptance test which has multiple phases - for instance in this example. Essentially, we'd need to create a Virtual Machine with Those tests can then be run via:
.. where I'm hoping that makes sense? However this change looks sensible to me - I'd actually run into this earlier today too :) Thanks! |
22117e8
to
e81330c
Compare
Hi @tombuildsstuff, thanks for the very informative explanation.
|
Hey @thiagocaiubi Thanks for pushing those updates :) I may be wrong, but taking a quick glance I think the issue may be that the disks are being deleted when the Original VM is - would it be possible to check by removing those two fields? Terraform will automatically clear up the config once it's finished the test, so they shouldn't be needed :) Thanks! |
Hi @tombuildsstuff , thanks! 😄 👍
|
@thiagocaiubi apologies, I pushed a commit to this branch (to switch the OS version to Ubuntu 16 after #237) which apparently closed this PR.. I'll re-open it, sorry! |
@thiagocaiubi I can't see how to re-open this PR unfortunately (the button's greyed out). I've opened #240 which includes your commits + git authorship history where we'll merge this, I'm really sorry about that! |
@tombuildsstuff there is nothing to apologize for. The more important is making terraform better each day. I'm very happy to contribute back every now and then. 👍 |
Force recreation if storage_data_disk.creation_option changes (#218)
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! |
I'm not sure how to test this change, please provide any feedback to help me with it.
Azure Resource Manager API doesn't support changes to this field. It
should recreate the virtual machine and attach the disks again.
Actual Behaviour:
module.xpto.azurerm_virtual_machine.prometheus_virtual_machine:
Modifying... (ID: /subscriptions/xxxxx...ute/virtualMachines/vm)
delete_data_disks_on_termination: "" => "false"
delete_os_disk_on_termination: "" => "true"
storage_data_disk.0.create_option: "Empty" => "Attach"
storage_data_disk.1.create_option: "Empty" => "Attach"
tags.%: "0" => "1"
tags.role: "" => "xpto"
Error applying plan:
1 error(s) occurred:
module.xpto.azurerm_virtual_machine.vm: 1 error(s) occurred:
azurerm_virtual_machine.prometheus_virtual_machine:
compute.VirtualMachinesClient#CreateOrUpdate: Failure responding to
request: StatusCode=409 -- Original Error: autorest/azure: Service
returned an error. Status=409 Code="PropertyChangeNotAllowed"
Message="Changing property 'dataDisk.createOption' is not allowed."