-
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
changes to azurerm_virtual_machine.os_profile.custom_data
and .os_profile.admin_password
are not detected
#148
Comments
When I use Should |
I'm getting the same issue in 0.10.0 with the latest azurerm provider |
Hey @bsilverthorn Thanks for opening this issue - apologies for the delayed response on this. Taking a look into this issue - this is because the Instead - I think we should fix this by converting the In the interim I'm going to merge #211 as making the Thanks! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hello Azure Terraform Community, just today, I stumbled onto this issue. I reported earlier this month to my account manager at Microsoft that scale sets do not recognize changes in the user data as a reason to roll out new instances. This is why I switched to bare VM for now just to find out, that they do not recognize changes to the user data at all 🤣 I have exactly the same issue as the reporter of this issue, any changes to custom_data are ignored by terraform / azure. Expected behavior would be (as other cloud providers would) that the VM gets re-provisioned once the user data has changed. Are there any updates on this issue? Many thanks |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This behaviour is for historical reasons where VM's and VM Scale Sets previously didn't consider Custom Data to be updatable, and for a long time this information wasn't returned at all - as such it's ignored by Terraform. We have some plans in the future to make some major changes to the Whilst unfortunately I'm unable to give a timeframe for this - it's something we're thinking about (and will post an update for when we have more information). Although I realise this isn't an ideal solution, it's possible to work around this in the interim by tainting the Virtual Machine/Scale Set using Thanks! |
I am getting this issue as well. It is an issue for some of the items in the profile but not all and unfortunately it is an issue with the more commonly updated items like a password. In my case the ssh_keys key_data is not detected. I tested the password mentioned here is also an issue. The short term fix forcing the new resource is terrible. I don't want to rebuild a vm when I'm applying a new pub key. |
I'm running into same issue. It's fair to assume that ssh_keys and custom_data will be updated frequently. So, this is major bug from my perspective. It should be at least mentioned in the documentation. |
any plans to fix this soon? |
@zepptron we're planning on fixing this as a part of the new Virtual Machine/Virtual Machine Scale Set resources which will form part of v2.0 (more info can be found here) - which we're working towards at the moment. |
hi @bsilverthorn @romlinch @josmo @r7vme @brodriguesneto @calvix @holderbaum @warrenackerman @svetozar02 @zepptron We're currently working on version 2.0 of the Azure Provider which we previously announced in #2807. As a part of this we're introducing five new resources which will supersede the existing
We recently opened #5550 which adds support for the new Virtual Machine resources - and I'm able to confirm that this is fixed in the new Virtual Machine resources - however unfortunately we have no plans to backport this to the existing In order to get feedback on these new resources we'll be launching support for these new resources as an opt-in Beta in an upcoming 1.x release of the Azure Provider and ultimately release these as "GA" in the upcoming 2.0 release. We'll post an update in #2807 when both the opt-in Beta (1.x) & GA (2.0) are available - as such I'd recommend subscribing to that issue for updates. This issue's been assigned to the milestone "2.0" since this is where this will ship - however (due to the way that closing Github Issues from PR's works, to be able to track this back for future users) this issue will be closed once the first of the new resources have been merged. Thanks! |
This has been released in version 2.0.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.0.0"
}
# ... other configuration ... |
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 👉 hashibot-feedback@hashicorp.com. Thanks! |
Terraform Version
Affected Resource(s)
azurerm_virtual_machine
Terraform Configuration Files
Debug Output
Not including log output here because it doesn't seem critical to this issue and I'm concerned about secrets leakage. (For example, the
TF_LOG=TRACE
output contains anAuthorization: Bearer...
header. Is that safe?)Expected Behavior
After the HCL above is
apply
ed, if any attribute includingazurerm_virtual_machine.os_profile.custom_data
azurerm_virtual_machine.os_profile.admin_password
are changed, then re-planning should identify the changes made and trigger a destroy/re-create of the VM.
Actual Behavior
terraform plan
reports that it "did not detect any differences", even though changes were made:Changes to some other attributes, such as
.os_profile.admin_username
, did result in the expected destroy/re-create plan.Steps to Reproduce
terraform apply
with the HCL aboveterraform plan
and observe "did not detect any differences"The text was updated successfully, but these errors were encountered: