-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Can't migrate azurerm_virtual_machine with custom_data to azurerm_linux_virtual_machine #7234
Comments
Hi @brownoxford Thanks for opening this issue! In Azure, the Since Azure would not return the Based on the nature of
to let terraform ignore the changes on |
Hi, If the custom_data is a ForceNew attribute, I would have expected this to be marked in the plan with "# forces replacement". Especially because in the previous "azurerm_virtual_machine" resource, changes to the custom_data did not have the same effect. It took my quite a while to understand the custom_data was the reason terraform wanted to recreate my virtual machine. |
Hi @kev-in-shu the reason why terraform is not directly telling you that it is |
Hi, I still face the same issue. I already have a
When I run |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.12.17
Affected Resource(s)
azurerm_virtual_machine
azurerm_linux_virtual_machine
Terraform Configuration Files
Old Config
New Config
Debug Output
Panic Output
Expected Behavior
I expected
terraform import
to import the existing configuration fully so that I would be able to migrate from legacyazurerm_virtual_machine
toazurerm_linux_virtual_machine
without having to destroy and re-create vm instances.Actual Behavior
The
terraform import
does not seem to recognize existingos_profile.custom data
and subsequent plan or apply viewscustom_data
as being new and triggers a destroy/recreate.Steps to Reproduce
azurerm_virtual_machine
with custom data specified inos_profile.custom_data
.azurerm_linux_virtual_machine
configuration using values translated from existingazurerm_virtual_machine
terraform state rm <your old azurerm_virtual_machine>
azurerm_linux_virtual_machine
withterraform import ...
terraform plan
Important Factoids
N/A
References
N/A
The text was updated successfully, but these errors were encountered: