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

error creating vm failing on interface identifier #137

Closed aurochsen closed 4 years ago

aurochsen commented 4 years ago

Hi, I posted this several months back on I think v 0.8 but was called away on other project. I have returned updated to the newest versions and have the same issue as before. My lab environment has two network interfaces. Interface 1 is proxmox management untagged. Interface 2 is for all the vms and is tagged. In network setup the part to select which proxmox interface to use is blank. To get around this I setup a compute resource where I can select the interface and the vlan tag. The same environment at my office works fine but I only have one network interface on that server. Describe the bug When creating a new host on a proxmox machine with more than one network interface an error prevents the provisioning of the new host. The logs states the failure is due to net0 invalid format missing key in comma separated list.

To Reproduce Creating a vm with mostly default settings. Using DHCP through my own router netboot. parse_server_vm args={"type"=>"qemu", "vmid"=>"100", "config_attributes"=>{"description"=>"", "boot"=>"", "onboot"=>"0", "agent"=>"0", "kvm"=>"1", "keyboard"=>"en-us", "vga"=>"std", "cpu_type"=>"kvm64", "sockets"=>"2", "cores"=>"2", "vcpus"=>"", "cpulimit"=>"", "cpuunits"=>"", "numa"=>"0", "pcid"=>"0", "spectre"=>"0", "memory"=>"4096", "min_memory"=>"", "balloon"=>"0", "cdrom"=>"none", "cdrom_storage"=>"", "cdrom_iso"=>"", "ostype"=>"l26", "shares"=>nil, "swap"=>nil}, "volumes_attributes"=>{"0"=>{"storage"=>"store1", "controller"=>"scsi", "device"=>"0", "cache"=>"none", "size"=>"32", "id"=>"scsi0"}}, "name"=>"ida-radder.vt6.org", "provision_method"=>"build", "firmware_type"=>:bios, "interfaces_attributes"=>{"0"=>{"id"=>"net0", "ip"=>nil, "gw"=>nil, "ip6"=>"", "gw6"=>nil}}}

Expected behavior Expected is provisioned vm according to spec on proxmox ready for kickstart.

Production.log exerts - debug 2020-02-20T15:39:42 [D|app|80306932] new_container_vm() vm.config= <Fog::Proxmox::Compute::ServerConfig vmid="100", description=nil, ostype="l26", smbios1=nil, numa="0", kvm="1", vcpus=nil, cores=2, bootdisk=nil, onboot="0", boot=nil, agent="0", scsihw=nil, sockets="2", memory=4294967296, min_memory=nil, shares=nil, balloon=0, name=nil, cpu="cputype=kvm64", cpulimit=nil, cpuunits=nil, keyboard="en-us", vga="std", storage=nil, template=nil, arch=nil, swap=nil, hostname=nil, nameserver=nil, searchdomain=nil, password=nil, startup=nil, console=nil, cmode=nil, tty=nil, force=nil, lock=nil, pool=nil, bwlimit=nil, unprivileged=nil, interfaces= <Fog::Proxmox::Compute::Interfaces [

  ]
>,

disks= <Fog::Proxmox::Compute::Disks [ <Fog::Proxmox::Compute::Disk id="ide2", volid="none", size=nil, storage=nil, cache=nil, replicate=nil, media="cdrom", format=nil, model=nil, shared=nil, snapshot=nil, backup=nil, aio=nil, mp=nil

, <Fog::Proxmox::Compute::Disk id="scsi0", volid=nil, size=34359738368, storage="store1", cache="none", replicate=nil, media=nil, format=nil, model=nil, shared=nil, snapshot=nil, backup=nil, aio=nil, mp=nil

]

2020-02-20T15:39:40 [D|app|80306932] parse_server_vm(): {"vmid"=>"100", "name"=>"ida-radder.vt6.org", "onboot"=>"0", "agent"=>"0", "kvm"=>"1", "keyboard"=>"en-us", "vga"=>"std", "sockets"=>"2", "cores"=>"2", "numa"=>"0", "ostype"=>"l26", "cpu"=>"cputype=kvm64", "memory"=>4096, "balloon"=>0, "ide2"=>"none,media=cdrom", "net0"=>"model=", "scsi0"=>"store1:32,cache=none"} 2020-02-20T15:39:40 [W|app|80306932] failed to create vm: Expected([200]) <=> Actual(400 Bad Request) excon.error.response :body => "{\"errors\":{\"net0\":\"invalid format - missing key in comma-separated list property\n\"},\"data\":null}" :cookies => [ ] :headers => { "Cache-Control" => "max-age=0" "Connection" => "close" "Content-Length" => "97" "Content-Type" => "application/json;charset=UTF-8" "Date" => "Thu, 20 Feb 2020 20:39:40 GMT" "Expires" => "Thu, 20 Feb 2020 20:39:40 GMT" "Pragma" => "no-cache" "Server" => "pve-api-daemon/3.0" } :host => "d720.vt6.org" :local_address => "10.10.202.204" :local_port => 43500 :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"

2020-02-20T15:39:40 [W|app|80306932] Failed to create a compute d720 (Proxmox) instance ida-radder.vt6.org: Expected([200]) <=> Actual(400 Bad Request) excon.error.response :body => "{\"errors\":{\"net0\":\"invalid format - missing key in comma-separated list property\n\"},\"data\":null}" :cookies => [ ] :headers => { "Cache-Control" => "max-age=0" "Connection" => "close" "Content-Length" => "97" "Content-Type" => "application/json;charset=UTF-8" "Date" => "Thu, 20 Feb 2020 20:39:40 GMT" "Expires" => "Thu, 20 Feb 2020 20:39:40 GMT" "Pragma" => "no-cache" "Server" => "pve-api-daemon/3.0" } :host => "d720.vt6.org" :local_address => "10.10.202.204" :local_port => 43500 :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"

2020-02-20T15:39:40 [D|app|80306932] Backtrace for 'Failed to create a compute d720 (Proxmox) instance ida-radder.vt6.org: Expected([200]) <=> Actual(400 Bad Request) excon.error.response :body => "{\"errors\":{\"net0\":\"invalid format - missing key in comma-separated list property\n\"},\"data\":null}" :cookies => [ ] :headers => { "Cache-Control" => "max-age=0" "Connection" => "close" "Content-Length" => "97" "Content-Type" => "application/json;charset=UTF-8" "Date" => "Thu, 20 Feb 2020 20:39:40 GMT" "Expires" => "Thu, 20 Feb 2020 20:39:40 GMT" "Pragma" => "no-cache" "Server" => "pve-api-daemon/3.0" } :host => "d720.vt6.org" :local_address => "10.10.202.204" :local_port => 43500 :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"

Versions: Proxmox 6.1 fog-proxmox 0.10.0 Using foreman_fog_proxmox 0.9.4

Thank you for all you do.

tristanrobert commented 4 years ago

Can you please send a screenshot of your interfaces tab and each interface form?

m-bucher commented 4 years ago

Saw this too with v0.9.4 with fog-proxmox 0.11.1 image

tristanrobert commented 4 years ago

This is fixed since v0.10.0. Upgrade your foreman_fog_proxmox plugin version to 0.10.2.

aurochsen commented 4 years ago

Yes! Tested 0.10.2 and that fixed it. Thank you!