You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace a resource that is attached to a server causes the server to be turned off and turned on twice. This behavior takes longer time than just shut down and turn on the server only one time.
Expected behavior: the server foo will be turned off to remove the attached IPv4 foo and to attach a new IPv4 foo1. Then, it is turned on afterward.
Current behavior: the server foo will be turned off to remove the attached IPv4 foo. Then, it gets turned on and off again. IPv4 is attached to the server and the server is turned on.
The text was updated successfully, but these errors were encountered:
nvthongswansea
changed the title
Replacing a resource which is attached to a powered-on server causes server to be off and on multiple time
Replacing a resource which is attached to a powered-on server causes server to be off and on multiple times
Sep 6, 2021
The reason why the issue happens is because the deletion of ipv4 foo is executed first (which requires the server to be off) and then the change in server foo (which also requires the server to be off) is applied. If terraform executes them simultaneously, this issue does not appear (because gs terraform provider does have ability to handle concurrent server operations). I've found out why the change in the server foo has to wait for the deletion of the ipv4 foo to finish:
If you take a look at the change in the server foo, there is a line ipv4 = gridscale_ipv4.foo1.id telling the dependency of the server and a new ipv4 foo1. That implies, the new ipv4 foo1 needs to be created before applying the change to the server.
As a result, terraform decides to destroy the ipv4 foo and create the new ipv4 foo1 simultaneously. After finishing those two actions, it will apply the change in the server.
Note: Destroying the ipv4 foo will turn off the server foo, and turn on the server afterward (since the ipv4 foo is attached to the server foo). Changing ipv4 of a server also does those steps.
Replace a resource that is attached to a server causes the server to be turned off and turned on twice. This behavior takes longer time than just shut down and turn on the server only one time.
terraform apply
:foo
withfoo1
, doterraform apply
:Expected behavior: the server
foo
will be turned off to remove the attached IPv4foo
and to attach a new IPv4foo1
. Then, it is turned on afterward.Current behavior: the server
foo
will be turned off to remove the attached IPv4foo
. Then, it gets turned on and off again. IPv4 is attached to the server and the server is turned on.The text was updated successfully, but these errors were encountered: