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

Error on trying to make new host #114

Closed aurochsen closed 4 years ago

aurochsen commented 4 years ago

Describe the bug Using foreman_fox_proxmox 0.8.3 upon trying to create new host I get the error -

Failed to create a compute d720 (Proxmox) instance alvin-mudge.vt6.org: Expected([200]) <=> Actual(400 Bad Request) excon.error.response :body => "{\"errors\":{\"net0\":\"invalid format - missing key in comma-separated list property\\n\",\"id\":\"property is not defined in schema and the schema does not allow additional properties\"},\"data\":null}" :cookies => [ ] :headers => { "Cache-Control" => "max-age=0" "Connection" => "close" "Content-Length" => "190" "Content-Type" => "application/json;charset=UTF-8" "Date" => "Fri, 08 Nov 2019 16:22:23 GMT" "Expires" => "Fri, 08 Nov 2019 16:22:23 GMT" "Pragma" => "no-cache" "Server" => "pve-api-daemon/3.0" } :host => "d720.vt6.org" :local_address => "10.10.202.99" :local_port => 55452 :path => "/api2/json/nodes/d720/qemu" :port => 8006 :reason_phrase => "Parameter verification failed." :remote_ip => "10.10.10.200" :status => 400 :status_line => "HTTP/1.1 400 Parameter verification failed.\r\n"

What is weird is the remote_ip => "10.10.10.200" is not an ip I use. The ip address to the network is 10.10.200.0. So an ip would be 10.10.200.XXX not sure where the 10.10.10.200 address came from but I double checked my subnet and all the ip settings point to 10.10.200.XXX network.

To Reproduce Subnet is set to 10.10.200.0/24 and is set to use external DHCP. Create new host provision on proxmox. In interface I set hostname, and subnet and leave the rest blank. Upon hitting submit the error is displayed.

Expected behavior The new host is automatically provisions and pxe boot starts

Desktop (please complete the following information): Proxmox 5.4.13 Foreman 1.23 Katello 3.13 Foreman_fox_proxmox 0.8.3

aurochsen commented 4 years ago

I see this is similar to #97 except I am not provisioning a container. I think the issue is that the option to choose the network adapter is missing in 0.83. Under interface at the bottom the options to select the interface on proxmox is gone. In my proxmox I have multiple interfaces and provision on 0.83 it sets the interface to the first one in the list which is my case is not correct which also prevent pxe boot since using the wrong interface puts the vm on the wrong network.

tristanrobert commented 4 years ago

@mbj047 I don't find hostname field in interface form. I just see DNS name. Could you please activate debug level in your log and show the plugin log with parse_attr, etc. The net0 field seems wrong with unnecesseray id in it. I can't reporduce it.