-
Notifications
You must be signed in to change notification settings - Fork 8
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
When removing a host from cluster and decommissioning it in the same change, the decommission is attempted first, and fails #126
Comments
I'm not sure if it is possible to force terraform to first update the cluster resource and only afterwards attempt to destroy the host resource. |
Hi @stoyanzhelyazkov , Moreover, cluster appears as "depending on" the hosts in the
in other words, even terraform should be smart enough to perform first host removal from the cluster, and then the deletion of the host resource. |
If you use a depends_on in the configuration, it should remove the host from the cluster prior to removing the host in the same run. |
According to what I read in the documentation and in several blogs, To summarise what I have learned:
Because of (1) above, TF knows to create first the domain before creating the cluster. When destroying resources, though, it seems like TF doesn't consider the dependency. |
'Marking this issue as stale due to inactivity. This helps us focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. |
Code of Conduct
Terraform
v1.7.3
Terraform Provider
v0.8.1
VMware Cloud Foundation
4.5.2
Description
I have TF file 1 domain, 2 clusters, 4 hosts in cluster #1 and 3 hosts in cluster #2.
I remove a host from cluster #1 and also remove the host resource itself.
The plan looks like that:
The host resource removal (decommissioning) is attempted first, and fails because it is not removed from the cluster yet.
Affected Resources or Data Sources
resources/vcf_domain
resources/vcf_host
resources/vcf_cluster
Terraform Configuration
N/A
Debug Output
│
│ Error: Task with ID = dfc83a78-69c5-4788-b941-ca11b8b42c5e , Name: "Decommissioning host(s) esxi-5.vrack.vsphere.local from VMware Cloud Foundation" Type: "HOST_DECOMMISSION" is in state Failed
│
│
│
Panic Output
No response
Expected Behavior
The host removal from the cluster should happen first, and then the resource should be destroyed
Actual Behavior
The host resource removal (decommissioning) is attempted first, and fails because it is not removed from the cluster yet.
Steps to Reproduce
vcf_host
resource and 1vcf_domain
, which cluster includes those 4 hostsvcf_host
resources and also remove the reference to it from the domain's clustervcf_host
, and it will failEnvironment Details
No response
Screenshots
No response
References
No response
The text was updated successfully, but these errors were encountered: