Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform breaks when NAT rule is deleted #165

Closed
z4ce opened this issue May 10, 2019 · 5 comments
Closed

Terraform breaks when NAT rule is deleted #165

z4ce opened this issue May 10, 2019 · 5 comments

Comments

@z4ce
Copy link

z4ce commented May 10, 2019

Expected behavior

When a previously created NAT rule is deleted and terraform apply is run, the NAT rule is recreated.

Observed behavior

When a previously created NAT rule is deleted and terraform apply is run, terraform produces an error and refuses to continue. Produces error like this:

Error: Error refreshing state: 1 error(s) occurred:

* nsxt_nat_rule.pks-dnat-api: 1 error(s) occurred:

* nsxt_nat_rule.pks-dnat-api: nsxt_nat_rule.pks-dnat-api: Error during NatRule read: Status: 400 , Body: {
  "httpStatus" : "BAD_REQUEST",
  "error_code" : 11013,
  "module_name" : "ROUTING",
  "error_message" : "[Routing] Invalid resource NAT rule 1064 for the logical router 8b6dbd75-4820-426c-b754-abf0ae62102a."
}

Steps to reproduce

  1. Create terraform that requires a NAT rule
  2. Run terraform apply against NSX-T
  3. Delete the NAT rule using the NSX-Manager GUI
  4. Run terraform apply
@annakhm
Copy link
Collaborator

annakhm commented May 14, 2019

Hi @z4ce, thanks for reporting this issue! Could you please provide your config, and NSXT version. The general case of deleting nat rule works for us. Thanks!

@z4ce
Copy link
Author

z4ce commented May 14, 2019

Hi @annakhm, I can confirm that Terraform can delete a NAT rule just fine. In this case the NAT rule is being deleted directly using the NSX-Manager GUI. I'm expecting Terraform to recreate the externally deleted NAT rule. I'll update my steps to reproduce to make that more clear. The version if NSXT we are using is 2.3.1. What config would help?

@annakhm
Copy link
Collaborator

annakhm commented May 14, 2019

Thanks for the detailed explanation, fixing with https://github.com/terraform-providers/terraform-provider-nsxt/pull/166

@z4ce
Copy link
Author

z4ce commented May 14, 2019

Thanks for the super quick resolution! Any idea when you'll cut the next release?

@annakhm
Copy link
Collaborator

annakhm commented May 15, 2019

Unfortunately release plan is not finalized yet. Hope we'll release the bugfix release soon!

@annakhm annakhm closed this as completed May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants