<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 28/07/17 16:14, Juan Hernández
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:298579b2-f30e-23e5-6628-0a342ee5e917@redhat.com">Ah, I
see, in your command you are listing Gluster volumes, not storage
domains. They are different kinds of objects inside oVirt, and
thus they have different identifiers. That is completely normal.
If you want to get the identifiers of the storage domains use
"list storagedomains".
<br>
<br>
</blockquote>
<br>
Oh, got it. Thanks for the tip!<br>
<br>
<blockquote type="cite"
cite="mid:298579b2-f30e-23e5-6628-0a342ee5e917@redhat.com">
<blockquote type="cite" style="color: #000000;">Anyway, I've
replaced the storage domain UUID with the one that works with
the REST API and something improved: now I don't get the 404
from ovirt and the machine is not deleted BUT: I've added 2
disks (20GB and 30GB) plus the base template 8Gb disk, and I get
a VM with four (4) 8GB disks, and the bootable one is a random
disk
<br>
<br>
I've attached the engine.log with the (I hope) relevant messages
<br>
<br>
</blockquote>
<br>
Are you adding those disks and template using the Foreman CLI? Can
you share the commands that you are using?
<br>
<br>
</blockquote>
<br>
Yes, I'm using Hammer CLI<br>
<br>
<tt>hammer host create --architecture-id=1 --domain billy.preprod
--operatingsystem-id=7 --hostgroup-title Billy/Preprod --name
foobar03 --partition-table-id=192 --provision-method image
--root-password billy12345 --compute-resource 'LeaseWeb VMs prod'
--image CentOS_7.3 --compute-attributes
cluster=00000002-0002-0002-0002-000000000345,cores=2,memory=4294967296,start=1
--volume
'"size_gb=20,storage_domain=ba2bd397-9222-424d-aecc-eb652c0169d9,bootable=0"'
--volume
'"size_gb=30,storage_domain=ba2bd397-9222-424d-aecc-eb652c0169d9,bootable=0"'</tt><br>
<br>
<br>
<blockquote type="cite"
cite="mid:298579b2-f30e-23e5-6628-0a342ee5e917@redhat.com">Also,
can you share again the relevant part of the
/var/log/ovirt-engine/ssl_access_log file? There we can see what
requests are actually sent to the oVirt engine.
</blockquote>
<br>
These are the requests arriving from Foreman:<br>
<tt>192.168.10.158 - - [28/Jul/2017:14:19:42 +0000] "GET
/ovirt-engine/api/vms/24831007-97ad-4f6d-9009-e6fb68a585f9
HTTP/1.1" 200 2865</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:19 +0000] "GET
/ovirt-engine/api/datacenters?search= HTTP/1.1" 200 408</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:19 +0000] "GET
/ovirt-engine/api/operatingsystems HTTP/1.1" 200 2943</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:20 +0000] "GET
/ovirt-engine/api/datacenters?search= HTTP/1.1" 200 408</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:20 +0000] "GET
/ovirt-engine/api/operatingsystems HTTP/1.1" 200 2943</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:20 +0000] "GET
/ovirt-engine/api/datacenters?search= HTTP/1.1" 200 408</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:20 +0000] "GET
/ovirt-engine/api/clusters/ HTTP/1.1" 200 1091</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:20 +0000] "POST
/ovirt-engine/api/vms HTTP/1.1" 202 1612</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:22 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7
HTTP/1.1" 200 2256</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:22 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/nics
HTTP/1.1" 200 409</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:22 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7
HTTP/1.1" 200 2256</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:23 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7
HTTP/1.1" 200 2256</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:26 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7
HTTP/1.1" 200 2256</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:30 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7
HTTP/1.1" 200 2252</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:30 +0000] "DELETE
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/nics/bf0dabd2-796b-4b07-bd69-db3915409939
HTTP/1.1" 200 119</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:30 +0000] "POST
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/nics
HTTP/1.1" 201 430</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:31 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/nics
HTTP/1.1" 200 442</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:31 +0000] "GET
/ovirt-engine/api/ HTTP/1.1" 200 873</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:31 +0000] "GET
/ovirt-engine/api/datacenters/00000001-0001-0001-0001-0000000003e3
HTTP/1.1" 200 396</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:31 +0000] "POST
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/disks
HTTP/1.1" 201 674</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:32 +0000] "POST
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/disks
HTTP/1.1" 201 676</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:33 +0000] "POST
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/disks
HTTP/1.1" 201 677</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:33 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/disks
HTTP/1.1" 200 1136</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:34 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7
HTTP/1.1" 200 2668</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:34 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7
HTTP/1.1" 200 2668</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:34 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/disks
HTTP/1.1" 200 1136</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:36 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7
HTTP/1.1" 200 2668</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:36 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/disks
HTTP/1.1" 200 1136</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:38 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7
HTTP/1.1" 200 2669</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:38 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/disks
HTTP/1.1" 200 1138</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:42 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7
HTTP/1.1" 200 2660</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:43 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/disks
HTTP/1.1" 200 1125</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:43 +0000] "POST
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/start
HTTP/1.1" 200 616</tt><tt><br>
</tt><tt>192.168.10.158 - - [28/Jul/2017:14:26:44 +0000] "GET
/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7
HTTP/1.1" 200 2804</tt><br>
<br>
There are 3 POSTs to /disks so it seems that the culprit is indeed
Foreman, but looking at Foreman's production.log I cannot see much
more than this (even with logging level set to debug):<br>
<br>
<tt>2017-07-28 16:26:20 [app] [I] Parameters:
{"host"=>{"name"=>"foobar03", "architecture_id"=>1,
"domain_id"=>9, "operatingsystem_id"=>7,
"ptable_id"=>192, "compute_resource_id"=>5, "hos</tt><tt><br>
</tt><tt>tgroup_id"=>34, "image_id"=>6, "build"=>true,
"enabled"=>true, "provision_method"=>"image",
"managed"=>true,
"compute_attributes"=>{"cluster"=>"00000002-0002-0002-0002-000000000345",
"c</tt><tt><br>
</tt><tt>ores"=>"2", "memory"=>"4294967296", "start"=>"1",
"volumes_attributes"=>{"0"=>{"\"size_gb"=>"20",
"storage_domain"=>"ba2bd397-9222-424d-aecc-eb652c0169d9",
"bootable"=>"0"}, "1"=>{"\"si</tt><tt><br>
</tt><tt>ze_gb"=>"30",
"storage_domain"=>"ba2bd397-9222-424d-aecc-eb652c0169d9",
"bootable"=>"0"}}}, "overwrite"=>true,
"host_parameters_attributes"=>[],
"interfaces_attributes"=>[], "root_pass"</tt><tt><br>
</tt><tt>=>"[FILTERED]"}, "apiv"=>"v2"}</tt><br>
<br>
<br>
More over, looking at <tt>/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/disks
</tt>it throws a 404, the endpoint seems to be <tt>/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/diskattachments
</tt>while <tt>/ovirt-engine/api/vms/47f5035a-696c-4578-ace9-b23d865c6aa7/disks
</tt>seems to work only with API v3. Maybe I should change the base
URL for the ovirt's API in foreman config, shouldn't I?<br>
<br>
</body>
</html>