theforeman / foreman_fog_proxmox

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

When editing associated VM in Foreman 3.11, duplicate disk is created #353

Open brendan4linux opened 2 months ago

brendan4linux commented 2 months ago

Describe the bug When editing an associated VM in Foreman 3.11 (Katello 4.13), even when making unrelated (Puppet ENC/Parameter changes), it appears Foreman will try to change something on the VM's disk, which causes Proxmox to error with the following. It also creates a duplicate (And unused) disk on the Proxmox side, even though it errored:

update VM 140: -virtio0 HDDProx:100,cache=none virtio0: successfully created disk 'HDDProx:vm-140-disk-1,cache=none,size=100G' TASK ERROR: 400 Parameter verification failed. virtio0: hotplug problem - can't unplug bootdisk 'virtio0'

To Reproduce Steps to reproduce the behavior:

  1. Creat new VM in Foreman 3.11 associated to Proxmox server/cluster
  2. Edit VM after built, save changes
  3. Get error above, and:
  4. In proxmox, the original disk now shows as well as a duplicate (Unused) disk for each edit in Foreman.

Expected behavior No changes/duplication to the disk - expected only relevant/changes items to be modified on the Proxmox guest

Screenshots image image

Desktop (please complete the following information):

Additional context Tested on Proxmox VE 7.2, 7.4, and 8.2, with both BIOS and UEFI builds - please let me know if I can help in any way/test any fixes and thank you!

Manisha15 commented 2 months ago

Which foreman_fog_proxmox and fog-proxmox version you are using?

brendan4linux commented 2 months ago

Thank you very much for the quick response, we are using the following, which (I believe) was installed by foreman-installer: [root@ ~]# rpm -qa|egrep -i proxmox rubygem-foreman_fog_proxmox-0.16.1-1.fm3_11.el8.noarch rubygem-fog-proxmox-0.15.0-1.el8.noarch

And if helpful, the foreman-installer setting showing enabled: [root@ ~]# foreman-installer --help 2>&1|egrep -i proxmox --[no-]enable-foreman-plugin-proxmox Enable 'foreman_plugin_proxmox' puppet module (default: true)

Thanks, please let me know if I can provide anything else :)

brendan4linux commented 1 month ago

Hey hey, wanted to give this one a bump and see if anyone had any idea of what the problem/problem domain might be for this one?

If not, i'd like to ask if someone familiar with the plugin may have an idea of which file(s) or methods this problem may reside in? While i'd prefer to leave it to the pros, the amateur coder in me would love to have a look - if I can find a 'fix' maybe I can submit a pull request, just a thought.

Thanks for an amazing product btw, been using Katello for years and it's saved my job/sanity.