-
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
Update azurerm_linux|windows_virtual_machine
- make dedicated_host_id
updatable
#9264
Update azurerm_linux|windows_virtual_machine
- make dedicated_host_id
updatable
#9264
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR.
I've taken a look through and left some comments inline but if we can fix those up then we can run the tests and see how this looks 👍
Thanks!
@@ -741,6 +740,13 @@ func resourceLinuxVirtualMachineUpdate(d *schema.ResourceData, meta interface{}) | |||
update.Identity = identity | |||
} | |||
|
|||
if d.HasChange("dedicated_host_id") { | |||
shouldUpdate = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presumably this also needs to be shut-down and de-allocated - or does the API support live-migration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it needs to be deallocated. But shutdown might not be required, the API does not return any error on that and the update was successful
@@ -786,6 +785,18 @@ func resourceWindowsVirtualMachineUpdate(d *schema.ResourceData, meta interface{ | |||
update.Identity = identity | |||
} | |||
|
|||
if d.HasChange("dedicated_host_id") { | |||
shouldUpdate = true | |||
shouldDeallocate = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presumably this also needs to be shut-down too?
azurerm/internal/services/compute/tests/windows_virtual_machine_resource_scaling_test.go
Show resolved
Hide resolved
azurerm/internal/services/compute/tests/linux_virtual_machine_resource_scaling_test.go
Show resolved
Hide resolved
56a01ac
to
9dda6fb
Compare
9dda6fb
to
f743d96
Compare
Hi @tombuildsstuff thank you for review.
But I have to write the config with a lot of redundant resources to avoid the terraform bug (I am not sure whether it is resolved). |
And @tombuildsstuff amazingly actually this update of dedicated host id does not requires a shutdown of the VM - at least my tests could work properly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ArcturusZhang - this LGTM now 👍
This has been released in version 2.37.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.37.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! |
No description provided.