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

failed to delete a compute cluster with ha_admission_control_policy = "failoverHosts" #891

Closed
aeremenk0 opened this issue Nov 1, 2019 · 1 comment

Comments

@aeremenk0
Copy link

Terraform Version

Terraform v0.12.12

vSphere Provider Version

commit a4b6343

Affected Resource(s)

affected resource: vsphere_compute_cluster

Terraform Configuration Files

go test -v -run=TestAccResourceVSphereComputeCluster_explicitFailoverHost -timeout 240m

Debug Output

--- FAIL: TestAccResourceVSphereComputeCluster_explicitFailoverHost (28.59s)
testing.go:630: Error destroying resource! WARNING: Dangling resources
may exist. The full state and error is shown below.

    Error: errors during apply: error force-removing old hosts out of cluster: error moving host "host1" out of cluster "terraform-compute-cluster-test": The current operation cannot be performed on the host 'host1' because it has been configured as a failover host for a cluster.

Pre-condition

in TestAccResourceVSphereComputeCluster_explicitFailoverHost file: resource_vsphere_compute_cluster_test.go:104 - 113
comments from the test:
// This step is required to remove the dedicated failover host in
// admission control - otherwise cleanup will fail.
this test case hides the problem if it is removed a compute cluster delete will fail.
That is why I think that code between lines 104 - 113 should be removed.

Expected Behavior

When removing a compute cluster with Admission Policy set to FailoverHost spec.DasConfig.Enabled should be set to structure.BoolPtr(false) first. And then the cluster remove command should be issued.

Actual Behavior

Error during the compute cluster delete:

Error: errors during apply: error force-removing old hosts out of cluster: error moving host "host1" out of cluster "terraform-compute-cluster-test": The current operation cannot be performed on the host 'host1' because it has been configured as a failover host for a cluster.

Steps to Reproduce

comment out those lines of the code:
resource_vsphere_compute_cluster_test.go:104 - 113

cd vsphere
and run:

go test -v -run=TestAccResourceVSphereComputeCluster_explicitFailoverHost -timeout 240m

@koikonom
Copy link
Contributor

koikonom commented Nov 5, 2019

Hi @aeremenk0, thanks for filing this issue! I see you have already opened a PR against this issue so I'll close this and continue the discussion in #892.

@koikonom koikonom closed this as completed Nov 5, 2019
@hashicorp hashicorp locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants