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.
- Do
terraform apply:
resource "gridscale_ipv4" "foo" {
name = "ip-test"
}
resource "gridscale_server" "foo" {
name = "test"
cores = 2
memory = 2
power = true
ipv4 = gridscale_ipv4.foo.id
}
- Replace ipv4 resource
foo with foo1, do terraform apply:
resource "gridscale_ipv4" "foo1" {
name = "ip-test"
}
resource "gridscale_server" "foo" {
name = "test"
cores = 2
memory = 2
power = true
ipv4 = gridscale_ipv4.foo1.id
}
-
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.