Giter VIP home page Giter VIP logo

Comments (8)

codestrong avatar codestrong commented on August 9, 2024 2

I get the same error and my template had source_file from the beginning, never used source_raw.

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024 1

Version v0.18.0 may produce a better error message for such use cases.

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024 1

Ahhh, yes, that was it. Thanks for the details!
I was able to reproduce this error on Windows. The classic problem -- \ vs / path separator, plus a logic bug in the code.

Will make a fix later this week.

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024

Hey @mikwaluk, thanks for the report!

I'd like to clarify the exact use case -- have you applied the original template first, then replaced source_raw with source_file, and then tried to apply the updated template when you've got this error message?

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024

Hey @codestrong! Would you mind to share your template?
(please redact any private data in it)

from terraform-provider-proxmox.

vctrferreira avatar vctrferreira commented on August 9, 2024

I'm having a pretty similar problem...

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024

Hi @vctrferreira! Would you mind sharing your template and giving a bit more detail about the use case, so I can reproduce it and identify the error? It doesn't seem like I'm able to reproduce it.

My template:

resource "proxmox_virtual_environment_vm" "ubuntu_vm" {
  name        = "211-test"

  node_name = var.virtual_environment_node_name
  vm_id       = 211

  agent {
    enabled = true
  }

  cpu {
    cores = 2
  }

  memory {
    dedicated = 2048
  }

  disk {
    datastore_id = "local"
    file_id      = proxmox_virtual_environment_file.ubuntu_cloud_image.id
    interface    = "virtio0"
    iothread     = true
    discard      = "on"
    size         = 20
  }

  initialization {
    ip_config {
      ipv4 {
        address = "dhcp"
      }
    }

    user_data_file_id = proxmox_virtual_environment_file.cloud_config.id
 }

  network_device {
    bridge = "vmbr0"
  }

}

resource "proxmox_virtual_environment_file" "ubuntu_cloud_image" {
  content_type = "iso"
  datastore_id = "local"
  node_name    = var.virtual_environment_node_name

  source_file {
    path = "https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img"
  }
}

resource "proxmox_virtual_environment_file" "cloud_config" {
  content_type = "snippets"
  datastore_id = "local"
  node_name    = var.virtual_environment_node_name

  source_file {
    path = "files/cloud-config.yaml"
    file_name = "terraform-provider-proxmox-example-cloud-config.yaml"
  }
}

and files/cloud-config.yaml

#cloud-config
users:
  - default
  - name: ubuntu
    groups:
      - sudo
    shell: /bin/bash
    ssh_authorized_keys:
      - ssh-rsa AAAAB3NzaC1yc2EAxxxxxxxxxxxxxxxxxxxxxxxx
    sudo: ALL=(ALL) NOPASSWD:ALL
runcmd:
  - apt update
  - apt install -y qemu-guest-agent net-tools
  - timedatectl set-timezone America/Toronto
  - systemctl enable qemu-guest-agent
  - systemctl start qemu-guest-agent
  - echo "done" > /tmp/cloud-init-done

works fine 🤔

from terraform-provider-proxmox.

vctrferreira avatar vctrferreira commented on August 9, 2024

I've already updated the package to the latest version available, still got some errors

this is my resource:

resource "proxmox_virtual_environment_file" "cloud_config" {
  content_type = "snippets"
  datastore_id = "local"
  node_name    = "Default"

  source_file {
    path      = "user-data/cloud-config.yaml"
    file_name = "cloud-config.yaml"
  }

}

The current error:

proxmox_virtual_environment_file.cloud_config: Creating...
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to
│ proxmox_virtual_environment_file.cloud_config, provider 
│ "provider[\"registry.terraform.io/bpg/proxmox\"]"       
│ produced an unexpected new value: Root resource was     
│ present, but now absent.
│
│ This is a bug in the provider, which should be reported 
│ in the provider's own issue tracker.

I don't know if this is important but I'm using terraform with Windows 11. maybe this information could be relevant but I also try it with WSL, but got the same error

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.