theforeman / foreman_fog_proxmox

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

Invalid vmid error on create new vm #83

Closed xjparkerx closed 4 years ago

xjparkerx commented 5 years ago

Describe the bug I am getting invalid vmid when I try to create a new vm using the foreman api.

To Reproduce Steps to reproduce the behavior: Post a vm config to the foreman api using a rest client.

Expected behavior A new vm should be created

Desktop (please complete the following information):

Foreman and plugin versions foreman = 1.20.3 proxmox = 5.3-12 foreman_proxmox_plugin = 0.5.5-1

Additional context

from foreman production.log 2019-05-13T09:32:17 [D|app|e48dd] new_server_vm() vm.config= <Fog::Compute::Proxmox::ServerConfig vmid=104, digest=nil, description=nil, ostype="l26", smbios1=nil, numa="1", kvm="1", vcpus=nil, cores="4", bootdisk=nil, onboot="0", boot=nil, agent="0", scsihw="virtio-scsi-pci", sockets="2", memory=17179869184, min_memory=nil, shares=nil, balloon=0, name="foreman_1557754337", cpu="cputype=kvm64", cpulimit=nil, cpuunits=nil, keyboard="en-us", vga="std", interfaces= <Fog::Compute::Proxmox::Interfaces [ <Fog::Compute::Proxmox::Interface id="net0", mac=nil, model="virtio", name=nil, ip=nil, ip6=nil, bridge="vmbr0", firewall=nil, link_down=nil, rate=nil, queues=nil, tag=nil

] , disks= <Fog::Compute::Proxmox::Disks [ <Fog::Compute::Proxmox::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::Compute::Proxmox::Disk id="scsi0", volid=nil, size=85899345920, storage="VMS", cache="writeback", replicate=nil, media=nil, format=nil, model=nil, shared=nil, snapshot=nil, backup=nil, aio=nil, mp=nil , <Fog::Compute::Proxmox::Disk id="rootfs", volid=nil, size=8589934592, storage="VM", cache=nil, replicate=nil, media=nil, format=nil, model=nil, shared=nil, snapshot=nil, backup=nil, aio=nil, mp=nil

]

2019-05-13T09:32:17 [D|app|e48dd] new_vm() vm.config= <Fog::Compute::Proxmox::ServerConfig vmid=104, digest=nil, description=nil, ostype="l26", smbios1=nil, numa="1", kvm="1", vcpus=nil, cores="4", bootdisk=nil, onboot="0", boot=nil, agent="0", scsihw="virtio-scsi-pci", sockets="2", memory=17179869184, min_memory=nil, shares=nil, balloon=0, name="foreman_1557754337", cpu="cputype=kvm64", cpulimit=nil, cpuunits=nil, keyboard="en-us", vga="std", interfaces= <Fog::Compute::Proxmox::Interfaces [ <Fog::Compute::Proxmox::Interface id="net0", mac=nil, model="virtio", name=nil, ip=nil, ip6=nil, bridge="vmbr0", firewall=nil, link_down=nil, rate=nil, queues=nil, tag=nil

] , disks= <Fog::Compute::Proxmox::Disks [ <Fog::Compute::Proxmox::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::Compute::Proxmox::Disk id="scsi0", volid=nil, size=85899345920, storage="VMS", cache="writeback", replicate=nil, media=nil, format=nil, model=nil, shared=nil, snapshot=nil, backup=nil, aio=nil, mp=nil , <Fog::Compute::Proxmox::Disk id="rootfs", volid=nil, size=8589934592, storage="VM", cache=nil, replicate=nil, media=nil, format=nil, model=nil, shared=nil, snapshot=nil, backup=nil, aio=nil, mp=nil

]

2019-05-13T09:32:17 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:17 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:18 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:18 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:18 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:18 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:18 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:18 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:18 [D|app|e48dd] parse_server_volume(): add disk={:id=>"scsi0", :storage=>"VMS", :size=>85899345920, :options=>{"cache"=>"writeback"}} 2019-05-13T09:32:18 [D|app|e48dd] parse_server_volumes(): volumes=[{:scsi0=>"VMS:85899345920,cache=writeback"}] 2019-05-13T09:32:18 [D|app|e48dd] parse_server_cpu(): {:cpu=>"cputype=kvm64"} 2019-05-13T09:32:18 [D|app|e48dd] parse_server_memory(): {:memory=>17179869184, :balloon=>0} 2019-05-13T09:32:18 [D|app|e48dd] parse_server_interfaces(): nics=[] 2019-05-13T09:32:18 [D|app|e48dd] general_a: ["node", "type", "config_attributes", "volumes_attributes", "interfaces_attributes", "firmware_type", "provision_method", "container_volumes", "server_volumes"] 2019-05-13T09:32:18 [D|app|e48dd] parse_server_config(): {"onboot"=>"0", "agent"=>"0", "kvm"=>"1", "keyboard"=>"en-us", "vga"=>"std", "sockets"=>"2", "cores"=>"4", "numa"=>"1", "ostype"=>"l26"} 2019-05-13T09:32:18 [D|app|e48dd] parse_server_vm(): {"onboot"=>"0", "agent"=>"0", "kvm"=>"1", "keyboard"=>"en-us", "vga"=>"std", "sockets"=>"2", "cores"=>"4", "numa"=>"1", "ostype"=>"l26", "cpu"=>"cputype=kvm64", "memory"=>17179869184, "balloon"=>0, "ide2"=>"none,media=cdrom", "scsi0"=>"VMS:85899345920,cache=writeback"} 2019-05-13T09:32:18 [D|app|e48dd] new_server_vm() vm.config= <Fog::Compute::Proxmox::ServerConfig vmid=104, digest=nil, description=nil, ostype="l26", smbios1=nil, numa="1", kvm="1", vcpus=nil, cores="4", bootdisk=nil, onboot="0", boot=nil, agent="0", scsihw="virtio-scsi-pci", sockets="2", memory=17179869184, min_memory=nil, shares=nil, balloon=0, name="foreman_1557754337", cpu="cputype=kvm64", cpulimit=nil, cpuunits=nil, keyboard="en-us", vga="std", interfaces= <Fog::Compute::Proxmox::Interfaces [ <Fog::Compute::Proxmox::Interface id="net0", mac=nil, model="virtio", name=nil, ip=nil, ip6=nil, bridge="vmbr0", firewall=nil, link_down=nil, rate=nil, queues=nil, tag=nil

] , disks= <Fog::Compute::Proxmox::Disks [ <Fog::Compute::Proxmox::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::Compute::Proxmox::Disk id="scsi0", volid=nil, size=85899345920, storage="VMS", cache="writeback", replicate=nil, media=nil, format=nil, model=nil, shared=nil, snapshot=nil, backup=nil, aio=nil, mp=nil , <Fog::Compute::Proxmox::Disk id="rootfs", volid=nil, size=8589934592, storage="VM", cache=nil, replicate=nil, media=nil, format=nil, model=nil, shared=nil, snapshot=nil, backup=nil, aio=nil, mp=nil

]

2019-05-13T09:32:18 [D|app|e48dd] new_vm() vm.config= <Fog::Compute::Proxmox::ServerConfig vmid=104, digest=nil, description=nil, ostype="l26", smbios1=nil, numa="1", kvm="1", vcpus=nil, cores="4", bootdisk=nil, onboot="0", boot=nil, agent="0", scsihw="virtio-scsi-pci", sockets="2", memory=17179869184, min_memory=nil, shares=nil, balloon=0, name="foreman_1557754337", cpu="cputype=kvm64", cpulimit=nil, cpuunits=nil, keyboard="en-us", vga="std", interfaces= <Fog::Compute::Proxmox::Interfaces [ <Fog::Compute::Proxmox::Interface id="net0", mac=nil, model="virtio", name=nil, ip=nil, ip6=nil, bridge="vmbr0", firewall=nil, link_down=nil, rate=nil, queues=nil, tag=nil

] , disks= <Fog::Compute::Proxmox::Disks [ <Fog::Compute::Proxmox::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::Compute::Proxmox::Disk id="scsi0", volid=nil, size=85899345920, storage="VMS", cache="writeback", replicate=nil, media=nil, format=nil, model=nil, shared=nil, snapshot=nil, backup=nil, aio=nil, mp=nil , <Fog::Compute::Proxmox::Disk id="rootfs", volid=nil, size=8589934592, storage="VM", cache=nil, replicate=nil, media=nil, format=nil, model=nil, shared=nil, snapshot=nil, backup=nil, aio=nil, mp=nil

]

2019-05-13T09:32:18 [D|app|e48dd] Enqueued task 'Set up compute instance api-test.eng.fireeye.com' to 'Host::Managed Main' queue 2019-05-13T09:32:18 [D|app|e48dd] Enqueued task 'Query instance details for api-test.eng.fireeye.com' to 'Host::Managed Main' queue 2019-05-13T09:32:18 [D|app|e48dd] Cache read: discovery_reboot 2019-05-13T09:32:18 [D|app|e48dd] Cache write: 2d5d465d-3b26-4b28-9959-da6d15e52c2f ({:expires_in=>5 minutes}) 2019-05-13T09:32:18 [D|app|e48dd] Processing task 'Set up compute instance api-test.eng.fireeye.com' from 'Host::Managed Main' 2019-05-13T09:32:18 [I|app|e48dd] Adding Compute instance for api-test.eng.fireeye.com 2019-05-13T09:32:18 [D|app|e48dd] Cache read: use_shortname_for_vms 2019-05-13T09:32:18 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:18 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:18 [D|app|e48dd] Cache read: http_proxy 2019-05-13T09:32:18 [D|app|e48dd] Cache write: http_proxy 2019-05-13T09:32:18 [W|app|e48dd] failed to create vm: ERF42-8295 [Foreman::Exception]: invalid vmid=0 2019-05-13T09:32:18 [W|app|e48dd] Failed to create a compute elrond (Proxmox) instance api-test.eng.fireeye.com: ERF42-8295 [Foreman::Exception]: invalid vmid=0

Foreman::Exception: ERF42-8295 [Foreman::Exception]: invalid vmid=0 /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_fog_proxmox-0.5.5/app/models/foreman_fog_proxmox/proxmox.rb:229:in create_vm' /usr/share/foreman/app/models/concerns/orchestration/compute.rb:86:insetCompute' /usr/share/foreman/app/models/concerns/orchestration.rb:222:in execute' /usr/share/foreman/app/models/concerns/orchestration.rb:145:inblock in process' /usr/share/foreman/app/models/concerns/orchestration.rb:137:in each' /usr/share/foreman/app/models/concerns/orchestration.rb:137:inprocess' /usr/share/foreman/app/models/concerns/orchestration.rb:44:in around_save_orchestration' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:inblock in run_callbacks' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:136:in run_callbacks' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:816:in_run_save_callbacks' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/callbacks.rb:342:in create_or_update' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/persistence.rb:275:insave' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/validations.rb:46:in save' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:310:inblock (2 levels) in save' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:387:in block in with_transaction_returning_status' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:254:inblock in transaction' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:239:in block in within_new_transaction' /opt/rh/rh-ruby25/root/usr/share/ruby/monitor.rb:226:inmon_synchronize' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:236:in within_new_transaction' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:254:intransaction' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:212:in transaction' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:385:inwith_transaction_returning_status' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:310:in block in save' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:325:inrollback_active_record_state!' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:309:in save' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/suppressor.rb:44:insave' /usr/share/foreman/app/models/concerns/foreman/sti.rb:26:in save' /usr/share/foreman/app/controllers/api/v2/hosts_controller.rb:145:increate' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/basic_implicit_render.rb:6:in send_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/abstract_controller/base.rb:194:inprocess_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/rendering.rb:30:in process_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/abstract_controller/callbacks.rb:42:inblock in process_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:109:in block in run_callbacks' /usr/share/foreman/app/controllers/api/v2/base_controller.rb:163:indisable_json_root' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in block in run_callbacks' /usr/share/foreman/app/controllers/concerns/application_shared.rb:15:inset_timezone' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in block in run_callbacks' /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:inclear_thread' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in block in run_callbacks' /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:inset_topbar_sweeper_controller' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in block in run_callbacks' /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.1/lib/audited/sweeper.rb:14:inaround' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in block in run_callbacks' /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.1/lib/audited/sweeper.rb:14:inaround' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:118:in block in run_callbacks' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:136:inrun_callbacks' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/abstract_controller/callbacks.rb:41:in process_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/rescue.rb:22:inprocess_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/instrumentation.rb:34:in block in process_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:inblock in instrument' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/notifications/instrumenter.rb:23:in instrument' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168:ininstrument' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/instrumentation.rb:32:in process_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal/params_wrapper.rb:256:inprocess_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/railties/controller_runtime.rb:24:in process_action' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/abstract_controller/base.rb:134:inprocess' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionview-5.2.1/lib/action_view/rendering.rb:32:in process' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal.rb:191:indispatch' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_controller/metal.rb:252:in dispatch' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:52:indispatch' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:34:in serve' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/mapper.rb:18:inblock in ' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/mapper.rb:48:in serve' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:52:inblock in serve' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:35:in each' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:35:inserve' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:840:in call' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.14/lib/apipie/static_dispatcher.rb:65:incall' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.14/lib/apipie/extractor/recorder.rb:137:in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:in call' /usr/share/foreman/lib/middleware/telemetry.rb:9:incall' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.14/lib/apipie/middleware/checksum_in_headers.rb:27:in call' /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:8:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/tempfile_reaper.rb:15:in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/etag.rb:25:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/conditional_get.rb:38:in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/head.rb:12:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/http/content_security_policy.rb:18:in call' /usr/share/foreman/lib/middleware/logging_context.rb:23:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:232:in context' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:226:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/cookies.rb:670:in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/callbacks.rb:28:inblock in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:98:in run_callbacks' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/callbacks.rb:26:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/debug_exceptions.rb:61:in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/show_exceptions.rb:33:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/railties-5.2.1/lib/rails/rack/logger.rb:38:in call_app' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/railties-5.2.1/lib/rails/rack/logger.rb:28:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/remote_ip.rb:81:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/request_id.rb:27:in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/method_override.rb:22:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/runtime.rb:22:in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/cache/strategy/local_cache_middleware.rb:29:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/executor.rb:14:in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/actionpack-5.2.1/lib/action_dispatch/middleware/static.rb:127:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in call' /opt/theforeman/tfm/root/usr/share/gems/gems/secure_headers-6.0.0/lib/secure_headers/middleware.rb:13:incall' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/railties-5.2.1/lib/rails/engine.rb:524:in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/railties-5.2.1/lib/rails/railtie.rb:190:inpublic_send' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/railties-5.2.1/lib/rails/railtie.rb:190:in method_missing' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/urlmap.rb:68:inblock in call' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in each' /opt/theforeman/tfm-ror52/root/usr/share/gems/gems/rack-2.0.5/lib/rack/urlmap.rb:53:incall' /usr/share/passenger/phusion_passenger/rack/thread_handler_extension.rb:74:in process_request' /usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:141:inaccept_and_process_next_request' /usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:109:in main_loop' /usr/share/passenger/phusion_passenger/request_handler.rb:455:inblock (3 levels) in start_threads' /opt/theforeman/tfm/root/usr/share/gems/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context' 2019-05-13T09:32:18 [D|app|e48dd] Cache write: 2d5d465d-3b26-4b28-9959-da6d15e52c2f ({:expires_in=>5 minutes}) 2019-05-13T09:32:18 [W|app|e48dd] Rolling back due to a problem: [#<Orchestration::Task:0x00007f945f565180 @name="Set up compute instance api-test.eng.fireeye.com", @id="Set up compute instance api-test.eng.fireeye.com", @status="failed", @priority=2, @action=[#<Host::Managed id: nil, name: "api-test.eng.fireeye.com", last_compile: nil, last_report: nil, updated_at: nil, created_at: nil, root_pass: "$5$kBpvFps2D4ORwBGR$ABdQoGXKHjv/zkYjUnp5oqwnBjl5dc...", architecture_id: 1, operatingsystem_id: 18, environment_id: nil, ptable_id: 118, medium_id: 9, build: false, comment: nil, disk: nil, installed_at: nil, model_id: nil, hostgroup_id: 19, owner_id: 4, owner_type: "User", enabled: true, puppet_ca_proxy_id: nil, managed: true, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: 4, puppet_proxy_id: nil, certname: nil, image_id: nil, organization_id: nil, location_id: nil, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: 6, provision_method: nil, grub_pass: "$5$kBpvFps2D4ORwBGR$ABdQoGXKHjv/zkYjUnp5oqwnBjl5dc...", global_status: 0, lookup_value_matcher: "fqdn=api-test.eng.fireeye.com", pxe_loader: nil, discovery_rule_id: nil, initiated_at: nil, build_errors: nil>, :setCompute], @created=1557754338.1082678, @timestamp=2019-05-13 13:32:18 UTC>] 2019-05-13T09:32:18 [I|app|e48dd] Processed 1 tasks from queue 'Host::Managed Main', completed 0/8 2019-05-13T09:32:18 [E|app|e48dd] Task 'Set up compute instance api-test.eng.fireeye.com' failed 2019-05-13T09:32:18 [E|app|e48dd] Task 'Query instance details for api-test.eng.fireeye.com' canceled 2019-05-13T09:32:18 [E|app|e48dd] Task 'Create DHCP Settings for api-test.eng.fireeye.com' canceled 2019-05-13T09:32:18 [E|app|e48dd] Task 'Create IPv4 DNS record for api-test.eng.fireeye.com' canceled 2019-05-13T09:32:18 [E|app|e48dd] Task 'Deploy TFTP PXELinux config for api-test.eng.fireeye.com' canceled 2019-05-13T09:32:18 [E|app|e48dd] Task 'Deploy TFTP PXEGrub2 config for api-test.eng.fireeye.com' canceled 2019-05-13T09:32:18 [E|app|e48dd] Task 'Deploy TFTP PXEGrub config for api-test.eng.fireeye.com' canceled 2019-05-13T09:32:18 [E|app|e48dd] Task 'Deploy TFTP iPXE config for api-test.eng.fireeye.com' canceled 2019-05-13T09:32:18 [E|app|e48dd] Unprocessable entity Host::Managed (id: new): Failed to create a compute elrond (Proxmox) instance api-test.eng.fireeye.com: ERF42-8295 [Foreman::Exception]: invalid vmid=0

2019-05-13T09:32:18 [I|app|e48dd] Rendering api/v2/errors/unprocessable_entity.json.rabl within api/v2/layouts/error_layout 2019-05-13T09:32:18 [I|app|e48dd] Rendered api/v2/errors/unprocessable_entity.json.rabl within api/v2/layouts/error_layout (1.8ms) 2019-05-13T09:32:18 [D|app|e48dd] Body: { "error": {"id":null,"errors":{"base":["Failed to create a compute elrond (Proxmox) instance api-test.eng.fireeye.com: ERF42-8295 [Foreman::Exception]: invalid vmid=0\n "]},"full_messages":["Failed to create a compute elrond (Proxmox) instance api-test.eng.fireeye.com: ERF42-8295 [Foreman::Exception]: invalid vmid=0\n "]} }

2019-05-13T09:32:18 [I|app|e48dd] Completed 422 Unprocessable Entity in 4414ms (Views: 3.8ms | ActiveRecord: 89.7ms) 2019-05-13T09:32:22 [I|app|] Started GET "/" for 10.35.133.57 at 2019-05-13 09:32:22 -0400

tristanrobert commented 4 years ago

You should try to upgrade your plugin: 0.5.5 is old now. Vmid generation has been already fixed in newer versions.

tristanrobert commented 4 years ago

The plugin suggest next vmid but you can specify which one you want. Upgrade to 0.8.3+ and test again. If you have still a bug you could post it in issues.