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

changes to custom data should force new resource #211

Merged
merged 1 commit into from
Aug 8, 2017

Conversation

josmo
Copy link
Contributor

@josmo josmo commented Aug 3, 2017

Fixes #148

custom-data changes should force a new resource creation.

@josmo
Copy link
Contributor Author

josmo commented Aug 3, 2017

@tombuildsstuff Let me know if this seems unreasonable, however it seems any change to the custom-data should forceNew.

@thiagocaiubi
Copy link
Contributor

thiagocaiubi commented Aug 7, 2017

Hi @josmo,

How could you get the current customData from virtual machine? I wasn't able to retrieve this information using the API thought https://resources.azure.com. Maybe it's a tool limitation.
The API docs describe customData as an exported field:

https://docs.microsoft.com/en-us/rest/api/compute/virtualmachines/virtualmachines-get

@thiagocaiubi
Copy link
Contributor

Hi @josmo, never mind.

Just realize terraform refresh is able to retrieve the info. Thanks!

@josmo
Copy link
Contributor Author

josmo commented Aug 7, 2017

@thiagocaiubi cool :)

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @josmo

Thanks for this PR - I've taken a look and can confirm this issue:

compute.VirtualMachinesClient#CreateOrUpdate: Failure responding to request: StatusCode=409 -- Original Error: autorest/azure: Service returned an error. Status=409 Code="PropertyChangeNotAllowed" Message="Changing property 'customData' is not allowed."

We're currently using version 2016-04-30-preview of the Compute API which doesn't allow updating the CustomData field - however there's an issue open to update to a newer API version (later than 2016-08-30 which supports updating the CustomData field.

Once the Swagger / SDK exists for this we'll investigate this (and presumably revert this change) - but for the moment this change LGTM :)

Thanks!

@tombuildsstuff
Copy link
Contributor

tombuildsstuff commented Aug 8, 2017

Actually, investigating this further it appears this value is missing from Hash - which is why changes aren't being picked up. I've posted more details in #148 - however this needs some larger changes (i.e. switching from a Set to a List, and a State Migration) to fix that.

As such this change doesn't fix the issue where changes to custom_data aren't detected - however it does solve the issue when running terraform apply -refresh=false in the interim; and as such I'm going to merge this issue anyway for the moment, since updating customData isn't supported right now. However I'm going to leave the issue #148 open until this is fully detected, as it's still an active issue.

(edit: sorry, posted before finishing writing!)

@ghost
Copy link

ghost commented Apr 1, 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 Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

changes to azurerm_virtual_machine.os_profile.custom_data and .os_profile.admin_password are not detected
3 participants