Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

terraform apply always results in change despite not change to .tf #56

Closed
t-settle opened this issue Apr 8, 2020 · 3 comments · May be fixed by #66
Closed

terraform apply always results in change despite not change to .tf #56

t-settle opened this issue Apr 8, 2020 · 3 comments · May be fixed by #66

Comments

@t-settle
Copy link

t-settle commented Apr 8, 2020

vRA 7.x version
7.6
Terraform version
Terraform v0.12.18
terraform-provider-vra7 plugin version

  • provider.vra7 v1.0.0

Describe the bug
After upgrading to vra7 provider v1.0.0, I noticed executing terraform apply multiple times in a row results in a change, when nothing has been changed.

To Reproduce
provider "vra7" {
tenant = "acme"
host = "https://xxxx.xxxx.com"
insecure = "true"
}
resource "vra7_deployment" "myDeployment" {
count = 1
catalog_item_name = "bp_acme_develop"
businessgroup_name = "bizgroup1"
description = "Test Terraform deployment"
reasons = "Testing the vRA 7 Terraform plugin"
resource_configuration {
component_name = "vm"
cluster = 2
configuration = {}
}
}

Run "terraform apply"
get "Resources: 1 added, 0 changed, 0 destroyed."
Run "terraform apply" again
get "Resources: 0 added, 1 changed, 0 destroyed."
where it Null's out all the resources and then reapplies them all exactly the same.

Expected behavior
"Resources: 0 added, 0 changed, 0 destroyed."
on subsequent "terraform apply" with no change to the .tf file

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
Attach logs to help debug the issue

  1. Attach vra-terraform.log
  2. Attach Terraform console log (Enable terraform logs following the steps mentioned in https://www.terraform.io/docs/configuration/environment-variables.html)
  3. crash.log(if any)

Desktop (please complete the following information):

  • OS: [e.g. iOS]

Additional context
Add any other context about the problem here.

@mcascone
Copy link

mcascone commented May 1, 2020

Same issue here. A plan immediately after an apply shows many changes pending. They all appear to be in attributes that are not explicitly set in the main.tf file.

@t-settle
Copy link
Author

t-settle commented May 8, 2020

In my testing I think this issue results in the following outcomes. Terraform has no knowledge of scaled-out VMs. Or perhaps this is a different issue?

Create deployment = success
Destroy deployment = success
Scale out VM count = success
Scale in VM count from original qty of VMs = success
Scale in VM count from scaled-out qty of VMs = failure
Reconfigure original qty of VMs (CPU, Memory changes) = success
Reconfigure scaled-out qty of VMs = failure

@Prativa20
Copy link
Contributor

@t-settle the original issue in this bug has been fixed. The plan will not show any diff if .tf file has no change.

The scale out issue is reproducible. It is due to the vRA API limitation. Please open another bug for that for easy tracking.

Thanks,
Prativa

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants