Unable to provision a VM via Xen API

Problem:
I’m trying to provision a VM via the API (using stackstorm, a general purpose automation platform). Compute Resource is a XenServer Pool (more accurate: XCP-ng 7.5).

The host is created in Foreman, but the actual VM is not created on the compute resource.

Creating VMs via the webUI works just fine.

What am I doing wrong?

Expected outcome:
VM is actually created on XenServer.

Foreman and Proxy versions:

foreman                  1.18.0-1 
foreman-cli              1.18.0-1 
foreman-debug            1.18.0-1 
foreman-installer        1.18.0-1 
foreman-postgresql       1.18.0-1 
foreman-proxy            1.18.0-1 

Foreman and Proxy plugin versions:

ruby-foreman-deface             1.2.0-1   
ruby-foreman-dhcp-browser       0.0.8-1   
ruby-foreman-discovery          12.0.2-1  
ruby-foreman-tasks              0.13.2-1  
ruby-foreman-tasks-core         0.2.5-1   
ruby-foreman-templates          6.0.3-1   
ruby-foreman-xen                0.6.1-1   
ruby-hammer-cli-foreman         0.13.0-1  

Other relevant data:
You can see the JSON payload send by stackstorm in the foreman logfile. But I guess what I am missing are the lines with “create_vm()”.

root@foreman-1 [/var/log/foreman]# grep bd724] production.log
2018-11-12T16:21:40 [I|app|bd724] Processing by Api::V2::HostsController#create as JSON
2018-11-12T16:21:40 [I|app|bd724]   Parameters: {"host"=>{"powerup"=>true, "managed"=>true, "provision_method"=>"build", "operatingsystem_name"=>"Debian 9", "domain_id"=>["1"], "ptable_id"=>["111"], "subnet_id"=>["1"], "architecture_name"
=>"x86_64", "domain_name"=>"nbg.example.com", "name"=>"testvm001.nbg.example.com", "architecture_id"=>["1"], "build"=>true, "hostgroup_title"=>"xen-vm/debian9", "subnet_name"=>"NBG LAN", "medium_name"=>"Debian 9 mirror extern", "operating
system_id"=>["2"], "interfaces"=>[{"name"=>"testvm001.nbg.example.com", "ip"=>"10.2.3.141", "fqdn"=>"testvm001.nbg.example.com", "primary"=>true, "mac"=>"02:40:a7:23:01:fa", "type"=>"interface", "mtu"=>"1500", "provision"=>true}], "certname"=>"testvm001.nbg.example.com", "compute_resource_name"=>"Pool NBG TK X10DRI-T Core 9-10", "mac"=>"02:40:a7:23:01:fa", "provision"=>true, "compute_resource_id"=>["10"], "ptable_name"=>"Example Preseed default", "medium_id"=>["14"], "enabled"=>true, "hostgroup_id"=>["9"], "compute_attributes"=>[{"builtin_template_name"=>"Debian Stretch 9.0", "memory_min"=>"2147483648", "VBDs"=>[{"physical_size"=>"25", "sr_uuid"=>"0432b1a8-ea49-494b-e6aa-e129fb1d0542"}], "memory_max"=>"2147483648", "vcpus_max"=>"2"}], "hostgroup_name"=>"xen-vm/debian9", "pxe_loader"=>"PXELinux BIOS", "compute_profile_id"=>["2"]}, "apiv"=>"v2"}
2018-11-12T16:21:40 [I|app|bd724] Current user: foreman_admin (administrator) 
2018-11-12T16:21:40 [I|app|bd724] Authorized user admin(Admin User)
2018-11-12T16:21:40 [I|app|bd724] Current user: admin (administrator)
2018-11-12T16:21:43 [I|app|bd724] Create DHCP reservation testvm001.nbg.example.com for testvm001.nbg.example.com-02:40:a7:23:01:fa/10.2.3.233
2018-11-12T16:21:43 [I|tem|bd724] Rendering template 'Example Preseed default PXELinux'
2018-11-12T16:21:43 [I|blo|bd724] Unattended render of 'Example Preseed default PXELinux' = '704a00693e88ff470015c637b2fdecc1f1bae6db8079b60aa6a87e4ece61e534'
2018-11-12T16:21:43 [I|app|bd724] Deploying TFTP PXELinux configuration for testvm001.nbg.example.com
2018-11-12T16:21:43 [I|app|bd724] Skipping TFTP PXEGrub2 configuration for testvm001.nbg.example.com
2018-11-12T16:21:43 [I|app|bd724] Skipping TFTP PXEGrub configuration for testvm001.nbg.example.com
2018-11-12T16:21:43 [I|app|bd724] Fetching required TFTP boot files for testvm001.nbg.example.com
2018-11-12T16:21:43 [I|app|bd724] Processed 5 tasks from queue 'Host::Managed Main', completed 5/5
2018-11-12T16:21:43 [I|aud|bd724] create event for Nic::Managed with id 90
2018-11-12T16:21:43 [I|aud|bd724] create event for Host::Base with id 78
2018-11-12T16:21:43 [I|app|bd724]   Rendering api/v2/hosts/create.json.rabl
2018-11-12T16:21:43 [I|app|bd724]   Rendered api/v2/hosts/create.json.rabl (65.9ms)
2018-11-12T16:21:43 [I|app|bd724] Completed 201 Created in 3271ms (Views: 60.5ms | ActiveRecord: 74.7ms)
root@foreman-1 [/var/log/foreman]#