Giter VIP home page Giter VIP logo

Comments (4)

bpg avatar bpg commented on September 14, 2024

Hi @aleprovencio! 👋🏼

Was there any error messages reported by PVE? These issues are quite hard to debug without reproducing, which means quite a bit of efforts with reinstalling PVE. So any additional details is really appreciated.

In general, if you reset the remote state of the resource (i.e. deleted the resource outside of terraform), the local TF state should be also deleted, so there is no inconsistency or "state drift" for the provider to reconcile.

from terraform-provider-proxmox.

aleprovencio avatar aleprovencio commented on September 14, 2024

Hello @bpg, thanks for the reply and of course, also for this awesome project.

It does makes sense to me that I should probably remove all proxmox related resources from terraform state prior reinstalling it, in order to prevent the so called "state drift".

However I still would like to understand why resources like proxmox_virtual_environment_vm or proxmox_virtual_environment_container get recreated while resources mentioned on this issue do not, on a test like I did without manual interventions on the terraform state.

Regarding errors, I don't see anything special on PVE's side and on terraform's, besides the HTTP 500 it just says that those resources do not exist. I wish I could give you additional details on the problem, but that's all I have for now, maybe I could try better debugging with your help.

from terraform-provider-proxmox.

bpg avatar bpg commented on September 14, 2024

It looks like the affected resource are "compound resources", i.e. they have references to other separate proxmox entities that are on different API paths. When provider applies a change, first it has to read the resource state from the remote to detect the "drift". I think there are logical or implementation bugs in those resources,they probably are trying to read the dependent objects first (like ACLs for a user, or rules for a security group) using the "parent" object ID as a request criteria. Those parents do not exist, and requests fail.

That's my hypothesis, without any actual debugging. There is definitely something in the provider's implementation that can be improved in this regard, though a proper investigation is needed to make a fix.

from terraform-provider-proxmox.

aleprovencio avatar aleprovencio commented on September 14, 2024

Yeah I guess you are on the right path.

I've done a new test where I did remove those resources from state, reinstalled proxmox and although terraform apply seemed worked flawlessly the first time, issuing the same command again still suggested changes on these resources we talk about.

from terraform-provider-proxmox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.