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

Warn when proxmox plugin is used instead of proxmox-iso #12309

Closed
sebastian-de opened this issue Mar 10, 2023 · 1 comment · Fixed by hashicorp/packer-plugin-proxmox#175
Closed
Labels

Comments

@sebastian-de
Copy link

Currently Packer includes the plugin alias proxmox:

"proxmox": new(proxmoxiso.Builder),

The alias was added for backwards compatibility when the plugin was split into proxmox-iso and proxmox-clone: a140c13

This works fine until a user that has proxmox in their template wants to use a specific version of the plugin, using a packer block.

In this case the internal plugin is used instead of the one specified in the packer block:

2023/03/10 12:48:36 [TRACE] Found the following "github.com/hashicorp/proxmox" installations: [{/home/user/.packer.d/plugins/github.com/hashicorp/proxmox/packer-plugin-proxmox_v1.1.2_x5.0_linux_amd64 v1.1.2}]
2023/03/10 12:48:36 [INFO] found external [clone iso] builders from proxmox plugin
2023/03/10 12:48:36 [TRACE] Starting internal plugin packer-builder-proxmox
2023/03/10 12:48:36 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-builder-proxmox"}

See the example template and full log below.

This behavior is quite confusing and there are a number of reported issues because of that (and possibly more):

Therefore I suggest to issue a warning with packer validate, when proxmox is used instead of proxmox-iso.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Simplified Packer Template

packer {
  required_plugins {
    proxmox = {
      version = ">= 1.1.2"
      source  = "github.com/hashicorp/proxmox"
    }
  }
}

source "proxmox" "alpine" {
  iso_url                  = "https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.1-x86_64.iso"
  iso_checksum             = "sha256:19d22173b53cd169f65db08a966b51f9ef02750a621902d0d784195d7251b83b"
  iso_storage_pool         = "local"
  network_adapters {
    bridge = "vmbr0"
    model  = "virtio"
    mtu    = 1200
  }
  node            = "pve"
  token           = "mytoken"
  proxmox_url     = "https://proxmox.example.com:8006/api2/json"
  ssh_username    = "root"
  username        = "packer@pam!packer"
}

build {
  sources = ["source.proxmox.alpine"]
}

Log Fragments and crash.log files

2023/03/10 12:48:36 [INFO] Packer version: 1.8.6 [go1.18.9 linux amd64]
2023/03/10 12:48:36 Old default config directory found: /home/user/.packer.d
2023/03/10 12:48:36 [TRACE] discovering plugins in /usr/bin
2023/03/10 12:48:36 Old default config directory found: /home/user/.packer.d
2023/03/10 12:48:36 [TRACE] discovering plugins in /home/user/.packer.d/plugins
2023/03/10 12:48:36 [DEBUG] Discovered plugin: proxmox = /home/user/.packer.d/plugins/github.com/hashicorp/proxmox/packer-plugin-proxmox_v1.1.2_x5.0_linux_amd64
2023/03/10 12:48:36 [INFO] found external [clone iso] builders from proxmox plugin
2023/03/10 12:48:36 [TRACE] discovering plugins in .
2023/03/10 12:48:36 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/03/10 12:48:36 [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/user/.packerconfig
2023/03/10 12:48:36 [WARN] Config file doesn't exist: /home/user/.packerconfig
2023/03/10 12:48:36 Old default config directory found: /home/user/.packer.d
2023/03/10 12:48:36 [INFO] Setting cache directory: /home/user/.cache/packer
2023/03/10 12:48:36 Old default config directory found: /home/user/.packer.d
2023/03/10 12:48:36 [TRACE] listing potential installations for "github.com/hashicorp/proxmox" that match ">= 1.1.2". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/usr/bin/packer", ".", "/home/user/.packer.d/plugins"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000740100)}}}}
2023/03/10 12:48:36 [TRACE] Found the following "github.com/hashicorp/proxmox" installations: [{/home/user/.packer.d/plugins/github.com/hashicorp/proxmox/packer-plugin-proxmox_v1.1.2_x5.0_linux_amd64 v1.1.2}]
2023/03/10 12:48:36 [INFO] found external [clone iso] builders from proxmox plugin
2023/03/10 12:48:36 [TRACE] Starting internal plugin packer-builder-proxmox
2023/03/10 12:48:36 Starting plugin: /usr/bin/packer []string{"/usr/bin/packer", "plugin", "packer-builder-proxmox"}
2023/03/10 12:48:36 Waiting for RPC address for: /usr/bin/packer
2023/03/10 12:48:36 packer-builder-proxmox plugin: [INFO] Packer version: 1.8.6 [go1.18.9 linux amd64]
2023/03/10 12:48:36 packer-builder-proxmox plugin: Old default config directory found: /home/user/.packer.d
2023/03/10 12:48:36 packer-builder-proxmox plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/03/10 12:48:36 packer-builder-proxmox plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /home/user/.packerconfig
2023/03/10 12:48:36 packer-builder-proxmox plugin: [WARN] Config file doesn't exist: /home/user/.packerconfig
2023/03/10 12:48:36 packer-builder-proxmox plugin: Old default config directory found: /home/user/.packer.d
2023/03/10 12:48:36 packer-builder-proxmox plugin: [INFO] Setting cache directory: /home/user/.cache/packer
2023/03/10 12:48:36 packer-builder-proxmox plugin: args: []string{"packer-builder-proxmox"}
2023/03/10 12:48:36 packer-builder-proxmox plugin: Old default config directory found: /home/user/.packer.d
2023/03/10 12:48:36 packer-builder-proxmox plugin: Plugin address: unix /tmp/packer-plugin1584658829
2023/03/10 12:48:36 packer-builder-proxmox plugin: Waiting for connection...
2023/03/10 12:48:36 Received unix RPC address for /usr/bin/packer: addr is /tmp/packer-plugin1584658829
2023/03/10 12:48:36 packer-builder-proxmox plugin: Serving a plugin connection...

  on alpine-issue.pkr.hcl line 17:
  (source code not available)

An argument named "mtu" is not expected here.

Error: Unsupported argument
2023/03/10 12:48:36 [INFO] (telemetry) Finalizing.

  on alpine-issue.pkr.hcl line 17:
  (source code not available)

An argument named "mtu" is not expected here.


2023/03/10 12:48:36 waiting for all plugin processes to complete...
2023/03/10 12:48:36 /usr/bin/packer: plugin process exited
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant