Open BenCamareno opened 6 years ago
Was the resource created using the Terraform plugin?
And what does the .tf file look like?
Thx
@raghavav Yes, the resource was provisioned with the Terraform plugin.
provider "vra7" {
username = "${var.username}"
password = "${var.password}"
tenant = "${var.tenant}"
host = "${var.host}"
insecure = false
}
resource "vra7_resource" "server_1" {
catalog_name = "catalog item"
catalog_configuration = {
Deployment = "server_1"
OSversion = "Windows"
Environment = "Production"
Backup = "true"
Size = "SMALL1_1CPU_4GBRAM_80GBDISK"
SupportTier = "Medium Touch"
Site = "Site01"
DiskSize = "10"
NumberOfInstances = "1"
}
deployment_configuration = {
reasons = "Deployment"
description = "Deployment via terraform"
}
resource_configuration {
ip_address = ""
}
count = "1"
wait_timeout = "5"
}
This path is certainly not tested or even supported yet, but it is worth following up on.
Does the XaaS blueprint produce a resource? Can you give some more details of the XaaS blueprint and what it produces?
Thanks
The XaaS Blueprint deploys 1 or more DB servers.
It seems that the resource ID that Terraform retrieves is the Request ID and not the Deployment ID. So when it tries to Destroy there are no items that match that ID.
I was able to successfully Destroy a resource with Terraform if I manually change the resource ID to the Deployment ID in the .tfstate file.
Yes, the current resource ID is actually a catalog request ID. We need to fix that at some point.
Surely the current code didn't just work for you when you changed the resource ID in the .tfstate file. You must have had to make some changes to the delete code ... did you?
It actually worked just like that, only thing I changed was the ID and away it went. I also had my doubts, but I reproduced it several times.
Okay, thanks. I have to connect the dots by looking at the code and then get back to you. Something isn't adding up in my head.
@raghavav how's this going? Anything I could help you with?
any updates on this issue?
How are you getting the proper names for the values needed in the XaaS blueprint for catalog configuration ? I have several XaaS blueprints, and in them are validations (i.e. external API/DB lookups).
The Terraform plugin is not able to destroy Items provisioned by an XaaS blueprint:
vra7_resource.control_server: Refreshing state... (ID: 002c1893-2c8a-450d-889c-1079a3f3b820)
An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
Plan: 0 to add, 0 to change, 1 to destroy.
Do you really want to destroy? Terraform will destroy all your managed infrastructure, as shown above. There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes
module.server_1.vra7_resource.server_1: Destroying... (ID: 002c1893-2c8a-450d-889c-1079a3f3b820)
Error: Error applying plan:
1 error(s) occurred:
module.server_1.vra7_resource.server_1 (destroy): 1 error(s) occurred:
module.server_1.vra7_resource.server_1: possibly resource got deleted outside terraform