<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"=&gt;{"name"=&gt;"foobar03", "architecture_id"=&gt;1,
      "domain_id"=&gt;9, "operatingsystem_id"=&gt;7,
      "ptable_id"=&gt;192, "compute_resource_id"=&gt;5, "hos</tt><tt><br>
    </tt><tt>tgroup_id"=&gt;34, "image_id"=&gt;6, "build"=&gt;true,
      "enabled"=&gt;true, "provision_method"=&gt;"image",
      "managed"=&gt;true,
"compute_attributes"=&gt;{"cluster"=&gt;"00000002-0002-0002-0002-000000000345",
      "c</tt><tt><br>
    </tt><tt>ores"=&gt;"2", "memory"=&gt;"4294967296", "start"=&gt;"1",
      "volumes_attributes"=&gt;{"0"=&gt;{"\"size_gb"=&gt;"20",
      "storage_domain"=&gt;"ba2bd397-9222-424d-aecc-eb652c0169d9",
      "bootable"=&gt;"0"}, "1"=&gt;{"\"si</tt><tt><br>
    </tt><tt>ze_gb"=&gt;"30",
      "storage_domain"=&gt;"ba2bd397-9222-424d-aecc-eb652c0169d9",
      "bootable"=&gt;"0"}}}, "overwrite"=&gt;true,
      "host_parameters_attributes"=&gt;[],
      "interfaces_attributes"=&gt;[], "root_pass"</tt><tt><br>
    </tt><tt>=&gt;"[FILTERED]"}, "apiv"=&gt;"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>