Closed ganhuang closed 2 years ago
I'm not sure if it's an issue that terraform should handle, or simply an issue of IBM cloud. Please kindly let me what I can assist here.
VSI's on Classic infrastructure (SoftLayer) are asynchronously deleted by SoftLayer. I believe there is a sweeper job that runs on a set timescale. Similarly I have seen them take up to 30 mins to disappear from the portal. My past experience is that the IBM Cloud API/Provider considers these as having been deleted and they do not affect future operations.
What issue is this causing in your pipeline?
we're using the bakery model to deploy our applications. So each time on the deployment, the instance will be re-created. If the provisioning/destroying time frame takes too long, that will make the whole deployment process lasts too long (we observed it took 6 hours even longer to destroy the instances in some cases by terraform)
This is the code sample:
resource "ibm_compute_vm_instance" "instances" {
count = "${var.instance_count}"
hostname = "xxxxx"
domain = "xxxxx"
lifecycle {
create_before_destroy = true
}
image_id = "xxx"
flavor_key_name = "x"
datacenter = "x"
network_speed = "x"
}
saying that destroying the instances
is part of terraform apply
, if it takes too long to complete, the pipeline would also get stuck there.
closing the issue due to no recent activity. Please feel free to open new issue
Terraform Version
Terraform v0.11.11
Affected Resource(s)
Expected Behavior
The VSI should be destroyed immediately.
Actual Behavior
Some VSI took 30 mins or longer to be destroyed, which leads our pipeline continuously failed.
Steps to Reproduce
terraform destroy
Important Factoids
This seems occurs very frequently lately. Previously the destroy process is pretty fast, and got finished immediately.
For now, some instances will take a long time to be destroyed by terraform. From the portal, I can see those instances are already
Pending Transactions
. But terraform still recognize them asNot Destroyed
.