theforeman / foreman_fog_proxmox

Foreman plugin to add Proxmox compute resource based on fog-proxmox gem
GNU General Public License v3.0
105 stars 30 forks source link

Cannot link existing hosts with Proxmox hosts #224

Closed Hedius closed 1 year ago

Hedius commented 2 years ago

Describe the bug I've found the following problem while linking an existing host to a VM

The puppet facts store the MAC in lower case.

The proxmox compute resource (this plugin) pulls the MAC in upper case from the Proxmox API (or Proxmox provides it in upper case)

Therefore, it is not possible to link an existing host with a proxmox host. (Since the comparison is case-sensitive)

I've created a pull request with a quick solution (converting both MACs to lower case before the comparison): #223 Furthermore, d30e1c435c2d456b9519bc74b407f6aa89a256e2 (also in the PR) converts the identity (int) to a string to fix a 500 when clicking on the “Associate VMs” button. Similar to #220

To Reproduce Steps to reproduce the behavior:

  1. Have an existing foreman/puppet host
  2. Attempt to associate proxmox hosts with foreman hosts
  3. Fails because of the mentioned MAC mismatch.

Expected behavior The check should be case-insensitive

Screenshots If applicable, add screenshots to help explain your problem. grafik grafik

Desktop (please complete the following information):

Additional context None

debdolph commented 2 years ago

Any progress on this?

Hedius commented 2 years ago

Any progress on this?

For now the only fix is that you manually edit the plugin files on your foreman server: not ideal :)

Hopefully, this plugin gets updated soon :)

Hedius commented 2 years ago

Look in the open pull requests. There are two.

KipourosV commented 2 years ago

Yeah found it, thanx!

tristanrobert commented 1 year ago

fixed with https://github.com/theforeman/foreman_fog_proxmox/pull/223