terraform-provider-proxmox: failed to determine the IP address of "" when using `proxmox_virtual_environment_file`

Describe the bug When using proxmox_virtual_environment_file resources, the node_name doesn’t seem to resolve. When using Proxmox_virtual_environment_vm resources, the node_name works fine.

To Reproduce Not sure what precisely about my environment is making this happen, but I currently don’t have a dns server locally (I’m actually building the vm to host that with this at the moment) which might be causing this issue.

The following file will reproduce:

terraform {
  required_providers {
    proxmox = {
      source = "bpg/proxmox"
      version = "0.6.1"
    }
    cloudinit = {
      source = "hashicorp/cloudinit"
      version = "2.2.0"
    }
  }
}

provider "proxmox" {
  virtual_environment {
    endpoint = var.proxmox_endpoint
    username = var.proxmox_username
    insecure = true
  }
}


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

  source_raw {
    data = "blah"
    file_name = "cloud-config.yaml"
  }
}

Expected behavior The file to get created

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28 (10 by maintainers)

Most upvoted comments

Added a static IP to the management interface and works fine!

Hi @kunleoladimeji!

None of the interfaces from the list have a static IP, so the provider can’t determine the address it should use to connect to the pve-1 node.

Currently, the provider does not use DNS lookup to determine the node IP. There is an open PR to add it as a fallback mechanism. I’ll probably go ahead, clean up, and merge it for the next release.

In the meantime, you can specify an IP override for your PVE node(s) as described here in the section “Node IP address used for SSH connection.”

  1. First, appreciate your eyes on this. 😄

  2. It’s going to take me a minute but I will get some curls against the API and try to correlate that with logs and share them. The /nodes/<node>/network thing is interesting because I not only have a few interfaces in that server but I have quite a few VLANs as well.

Please stay tuned…

I’m re-tagging this issue as “question”, as there seems to be no unexpected behaviour with the provider.