-
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
Operation ‘powerOff’ is not allowed (409 Conflict) #28218
Comments
I saw similar issue. It seems like MS change their API behavior. In the past, we can shutdown VM regardless the VM state. Currently, they only allow VM shutdown on turned on VM. As a workaround, we need to turn on the VM before we can shutdown without any error. Luckily, they don't force us to turn off VM before we can turn it on |
This is an issue with every VM in deallocated state. I tested this with latest 4.13.0 provider as well. But it does not matter given this is an API issue apparently. |
I also got this problem in two different environments. :( |
Hi @onur-ozguzel, FWIW, as a workaround, you may try to set graceful_shutdown or skip_shutdown_and_force_delete to skip the power-off step. |
graceful_shutdown doesn't seem to work, skip_shutdown_and_force_delete does. provider "azurerm" {
features {
virtual_machine {
skip_shutdown_and_force_delete = true
}
}
} |
In my case skip_shutdown_and_force_delete also worked. Thanks @j81blog |
Is there an existing issue for this?
Community Note
Terraform Version
1.7.5
AzureRM Provider Version
3.117.0
Affected Resource(s)/Data Source(s)
azurerm_windows_virtual_machine.windows_vm
Terraform Configuration Files
N/A
Debug Output/Panic Output
Expected Behaviour
After VM generalization, destroy command should destroy the VM.
Actual Behaviour
I started to get the error above since 6 December 24. Before that it was working just as expected.
Steps to Reproduce
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: