theforeman / foreman_fog_proxmox

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

Foreman can't delete host without VM #56

Closed SISheogorath closed 5 years ago

SISheogorath commented 5 years ago

Describe the bug Foreman fails to delete a node when the VM is no longer existing

error message:

Failed to destroy a compute Dev-vh (Proxmox) instance <host name>: 
Expected([200]) <=> Actual(500 InternalServerError) excon.error.response 
:body => "{\"data\":null}" 
:cookies => [ ] 
:headers => { "Cache-Control" => "max-age=0" "Connection" => "close" "Content-Length" => "13" "Content-Type" => "application/json;charset=UTF-8" "Date" => "Wed, 12 Dec 2018 14:40:17 GMT" "Expires" => "Wed, 12 Dec 2018 14:40:17 GMT" "Pragma" => "no-cache" "Server" => "pve-api-daemon/3.0" } 
:host => "<proxmox address>" 
:local_address => "<foreman address>" 
:local_port => 45622 
:path => "/api2/json/nodes/dev-vh001/qemu/110/status/current" 
:port => 8006 
:reason_phrase => "Configuration file 'nodes/dev-vh001/qemu-server/110.conf' does not exist" 
:remote_ip => "<proxmox ip>" 
:status => 500 
:status_line => "HTTP/1.1 500 Configuration file 'nodes/dev-vh001/qemu-server/110.conf' does not exist\r\n" 

To Reproduce Steps to reproduce the behavior:

  1. Create a new host in foreman using the proxmox compute resource provider
  2. Delete the VM that was created by this host in proxmox
  3. Try to delete the host in foreman

Expected behavior The host in foreman is deleted, maybe with a warning or an "Do you want to override"-question.

Desktop:

Additional context This actually doesn't only apply to deleted hosts, but also to hosts that are moved from one vhost to another within a proxmox datacenter.

tristanrobert commented 5 years ago

It is a Foreman feature: you could edit your host and disassociate it before deleting it.

oviliz commented 1 year ago

In my case it won't allow to Edit the host... image