Giter VIP home page Giter VIP logo

Comments (6)

rgl avatar rgl commented on August 9, 2024 1

For that, and the system extension(s).

BTW, I'm also using this in the talos example at https://github.com/rgl/terraform-proxmox-talos.

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024

Hi @rgl, could you use proxmox_virtual_environment_download_file instead, to download directly to the proxmox host from a remote URL?

If not, you might need to switch the temp directory used by the provider from default /tmp to somewhere else, if /tmp is mounted to a ram drive on your host.

from terraform-provider-proxmox.

rgl avatar rgl commented on August 9, 2024

The file is not available remotely. Its created locally, and only then it can be uploaded. So, I think I cannot use that resource.

Can the implementation of proxmox_virtual_environment_file be changed not to use a temporary file at all? And directly upload the local file?

PS Ah, its due to https://registry.terraform.io/providers/bpg/proxmox/latest/docs/resources/virtual_environment_file#important-notes.

I will try to trigger the SFTP branch instead

default:
// For all other content types, we need to upload the file to the node's
// datastore using SFTP.

from terraform-provider-proxmox.

rgl avatar rgl commented on August 9, 2024

Trying with content_type = "dump" as:

resource "proxmox_virtual_environment_file" "talos" {
  datastore_id = "local"
  node_name    = "pve"
  content_type = "dump"
  overwrite    = false
  source_file {
    path      = "tmp/talos/talos-${var.talos_version}.img"
    file_name = "${var.talos_version}.img"
  }
}

produced an unexpected result:

roxmox_virtual_environment_file.talos: Creating...
proxmox_virtual_environment_file.talos: Still creating... [10s elapsed]
proxmox_virtual_environment_file.talos: Still creating... [20s elapsed]
╷
│ Warning: the datastore "local" does not support content type "dump"; supported content types are: [backup images iso rootdir snippets vztmpl]
│ 
│   with proxmox_virtual_environment_file.talos,
│   on main.tf line 45, in resource "proxmox_virtual_environment_file" "talos":
│   45: resource "proxmox_virtual_environment_file" "talos" {
│ 
╵
╷
│ Error: failed to read file from "local:dump/1.6.7.img"
│ 
│   with proxmox_virtual_environment_file.talos,
│   on main.tf line 45, in resource "proxmox_virtual_environment_file" "talos":
│   45: resource "proxmox_virtual_environment_file" "talos" {
│ 

It seems dump is no longer a valid content type for Proxmox 8.1.10. Is this expected?

Also, it tried to create a file named dump/1.6.7.img instead of talos-1.6.7.img (as defined by file_name = "${var.talos_version}.img"). oh my mistake... I did not set it correctly. sorry! this is working correctly after using file_name = "talos-${var.talos_version}.img".

from terraform-provider-proxmox.

rgl avatar rgl commented on August 9, 2024

I ended up following https://registry.terraform.io/providers/bpg/proxmox/latest/docs/resources/virtual_environment_file#important-notes, and that did the trick for me. Sorry for all the noise!

The final result is at https://github.com/rgl/terraform-proxmox-upload-talos-img

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024

@rgl I glad you found the solution!

Just curious, why you're rebuilding talos image in the first place? I don't see much of customization in your image, except perhaps https://github.com/rgl/terraform-proxmox-upload-talos-img/blob/main/do#L34?

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.