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

Terraform refresh does not work as intended. #38

Closed
soumik612 opened this issue Nov 21, 2019 · 2 comments
Closed

Terraform refresh does not work as intended. #38

soumik612 opened this issue Nov 21, 2019 · 2 comments
Assignees

Comments

@soumik612
Copy link

vRA 7.x version
7.4
Terraform version
v0.12.13
terraform-provider-vra7 plugin version
provider.vra7 v0.5.0

Describe the bug
During deployment of VM resource, TF timesout (using default timeout value) although the VM request is still "IN PROGRESS" on VRA.
TF show output when TF timesout:

vra7_deployment.Windows_machine_01[0]: (tainted)

resource "vra7_deployment" "Windows_machine_01" {
businessgroup_name = "CP_PROD_CF_OBO_01"
catalog_item_id = "3a8b1715-7917-4589-b934-9c444184a642"
catalog_item_name = "IAAS-W2012-R2-Standard-x64-CF"
id = "ed158554-8395-4d5d-a39f-a7ca4c77662a"
request_status = "IN_PROGRESS"
resource_configuration = {

Once the VM is deployed, I assumed that using terraform refresh, the state file would be updated with current status.
TF refresh output once VM is successfully deployed:

vra7_deployment.Windows_machine_01[0]: (tainted)

resource "vra7_deployment" "Windows_machine_01" {
businessgroup_name = "CP_PROD_CF_OBO_01"
catalog_item_id = "3a8b1715-7917-4589-b934-9c444184a642"
catalog_item_name = "IAAS-W2012-R2-Standard-x64-CF"
id = "ed158554-8395-4d5d-a39f-a7ca4c77662a"
request_status = "IN_PROGRESS"
resource_configuration = {

Problem arises when I do a TF plan, since the VM is already deployed, TF should show that no changes are required.
However, I get a mesage that the "resource is tainted, so must be replaced"

image

Expected behavior
The resource status should be updated after terraform refresh.

@Prativa20
Copy link
Contributor

@soumik612 Created a PR as an enhancement that will take care of this
#41

Please provide your feedback

@Prativa20 Prativa20 self-assigned this Apr 5, 2020
Prativa20 referenced this issue Apr 6, 2020
Prativa20 referenced this issue Apr 6, 2020
Prativa20 referenced this issue Apr 6, 2020
Prativa20 referenced this issue Apr 6, 2020
Prativa20 referenced this issue Apr 7, 2020
Prativa20 referenced this issue Apr 7, 2020
Prativa20 referenced this issue Apr 8, 2020
markpeek referenced this issue Apr 8, 2020
@Prativa20
Copy link
Contributor

@soumik612 This is fixed in v1.0.0. Please refer to the README, examples and documentation to migrate to the latest version

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

No branches or pull requests

2 participants