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

Manually deleted resources break resource state #574

Open
dgarcia18 opened this issue Oct 17, 2024 · 0 comments
Open

Manually deleted resources break resource state #574

dgarcia18 opened this issue Oct 17, 2024 · 0 comments

Comments

@dgarcia18
Copy link
Contributor

Description

Manually deleting resources using OpenNebula interfaces leads to resource state inconsistency not being handled. This is happening for different resources. This is a generic issue to handle them all.

Terraform and Provider version

Terraform v1.9.7
on linux_amd64

Affected resources and data sources

Issue currently tested for resources:

  • opennebula_virtual_network
  • opennebula_template

More resources to be tested.

Terraform configuration

resource "opennebula_template" "template" {
  name = "terra-tpl"
  permissions = "660"
  group = "oneadmin"
  cpu = "0.5"
  vcpu = "1"
  memory = "512"
  description = "New template"
}

Expected behavior

The resource should be removed from the TF state. This is the current behavior for the opennebula_virtual_machine resource (handling code here)

Actual behavior

Unhandled error:

root@localhost:~/tf-test-template# terraform plan
opennebula_template.template: Refreshing state... [id=15]

Planning failed. Terraform encountered an error while generating this plan.


│ Error: OpenNebula error [NO_EXISTS]: [one.template.info] Error getting virtual machine template [15].

│ with opennebula_template.template,
│ on main.tf line 19, in resource "opennebula_template" "template":
│ 19: resource "opennebula_template" "template" {

Steps to Reproduce

Create one of the resources specified above, manually delete it and force state update with terraform plan.

Debug output

https://gist.github.com/dgarcia18/cdd4aa4d056b9e7c396220fa3f734145

Panic output

No response

Important factoids

No response

References

No response

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

No branches or pull requests

1 participant