-
Notifications
You must be signed in to change notification settings - Fork 25
terraform apply
forces new resource
#162
Comments
Can you provide the Terraform configuration for your instance |
resource "opc_compute_storage_volume" "os" {
name = "${var.inst["name"]}${var.storageOS["name"]}"
size = "${var.storageOS["size"]}"
bootable = true
image_list = "${var.os["image_list"]}"
image_list_entry = "${var.os["image_list_entry"]}"
}
resource "opc_compute_instance" "stage" {
name = "${var.inst["name"]}${var.inst["name"]}"
label = "${var.inst["name"]}"
shape = "${var.inst["shape"]}"
image_list = "${var.os["image_list"]}"
hostname = "${var.inst["name"]}"
boot_order = [1]
desired_state = "inactive"
ssh_keys = "${var.ssh_keys}"
depends_on = ["opc_compute_storage_volume.os"]
storage {
volume = "${var.inst["name"]}${var.storageOS["name"]}"
index = 1
}
networking_info {
index = 0
vnic = "${var.inst["name"]}_eth0"
vnic_sets = ["${var.net["vnic_sets"]}"]
is_default_gateway = true
ip_network = "${var.net["ip_network"]}"
dns = ["${var.inst["name"]}${var.net["dns"]}"]
nat = ["${var.net["nat"]}"]
search_domains = "${var.search_domains}"
}
} |
Remove the Also a suggestion - rather than manually declaring the storage {
volume = "${opc_compute_storage_volume.os.name}"
index = 1
} |
This is an invalid value for the desired state, to shutdown an instance the option would be |
Although these are valuable inputs, it does not affect the problem per se. As long as the ID of the VM forces a redeploy, VM will shut down when running |
Did you try after removing the Note: the only updatable attribute for the |
Ok, we tried several things now: As soon as the attribute |
Do you have multiple |
The ssh_keys and networking_info params are always in the same order. |
I have already provided a full |
Terraform Version
terraform 0.11.4
provider.opc 1.3.2
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
When I do not change anything in my configuration, I expect a second
terraform apply
not to do anything.Actual Behavior
When I create an instance by using
terraform apply
and re-runterraform apply
it forces a new resource to be created (VM gets deleted and a new one is created).Gist
Steps to Reproduce
opc_compute_instance
terraform apply
, your VM is being createdterraform apply
, it wants to re-create the VMThe text was updated successfully, but these errors were encountered: