NetApp / terraform-provider-netapp-cloudmanager

Terraform provider to create NetAPP OCCM instances, CVO resources, volumes, snapshots, ... in Azure, AWS, GCP.
Mozilla Public License 2.0
17 stars 27 forks source link

code 504 cloud_connector & cvo_svm terraform destroy bug #158

Closed lomar92 closed 1 year ago

lomar92 commented 1 year ago

terraform ressources for cloud_connector can and svm can not be destroyed. sometimes it destroys the cvo_svm in aws successfull but destroy process stops immidiately with code 504 and I can not do a terraform destroy again. Cloud conncetor can not be found / working environment id not available even though the cloud connector is still there. Therefore all my other ressources I am deploying together with cvo ontap can not be destroyed due to this error and I have to manually delete them on the aws management console.

image

wenjun666 commented 1 year ago

I understand you are trying to delete a series of resources. What is the sequence of the actions will get you the above 504?

lomar92 commented 1 year ago

terraform destroy after a succesfull apply. not sure what you mean, but the ressources (OCM and CVO_SVM) are still there when looking on the aws management console. And it looks like the remaining network resources in the VPC as well as the VPC itself cannot be deleted, if the two resources are still present. Which is strange, because on BlueXP there is no working environment and also no connector, but the screenshot here shows something else and that is that despite a terraform destroys the NetApp resources are still available. And it fails to terminate the instance to to its "disableApiTerminiation" on instance attribute.

Bildschirm­foto 2023-03-18 um 19 43 59 image

image image

wenjun666 commented 1 year ago

okay, the OCCM and CVO are created successfully. After that, when you do terraform destroy, is the destroy successful or fail? Or the first destroy runs through, and get the above error on the second attempt to destroy?

lomar92 commented 1 year ago

Both. First and second attempt fails. I can share my tf code to reproduce the issue.

wenjun666 commented 1 year ago

Can you please share the tf code so I can try to reproduce?

lomar92 commented 1 year ago

Sure. Here is the code Snippet: https://gist.github.com/lomar92/0d369a618bc2c474c24fa02b59167836

wenjun666 commented 1 year ago

I was able to create an aws connector and cvo in the same resource and destroy successfully.

resource "netapp-cloudmanager_connector_aws" "cm-aws" {
  provider = netapp-cloudmanager
  name = "TerraformTest”
  region = "us-west-1"
  company = "NetApp"
  key_name = "dev_xxx”
  instance_type = "t3.xlarge"
  subnet_id = "subnet-xxx”
  security_group_id = "sg-xxx”
  iam_instance_profile_name = “xxxx”
  associate_public_ip_address = true
  account_id = "account-xxx”

}

resource "netapp-cloudmanager_cvo_aws" "cvo-aws" {
 provider = netapp-cloudmanager
 name = "TerraformCVO3"
 region = "us-west-1"
 subnet_id = "subnet-xxx”
 vpc_id = "vpc-xxx”
 svm_password = “xxx”
 client_id = netapp-cloudmanager_connector_aws.cm-aws.client_id
 writing_speed_state = "NORMAL"
}
wenjun666 commented 1 year ago

Please reopen this issue if issue remains