Bug 1665134 - "undefined method `storagedomains'" with Hammer, --volume and APIv4
Summary: "undefined method `storagedomains'" with Hammer, --volume and APIv4
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Compute Resources - RHEV
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.7.0
Assignee: orabin
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks: 1336437
TreeView+ depends on / blocked
 
Reported: 2019-01-10 14:28 UTC by Lukáš Hellebrandt
Modified: 2020-04-14 13:24 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 13:23:48 UTC
Target Upstream Version:


Attachments (Terms of Use)
production.log (28.65 KB, text/plain)
2019-01-10 14:28 UTC, Lukáš Hellebrandt
no flags Details
engine.log (7.38 KB, text/plain)
2019-01-10 14:28 UTC, Lukáš Hellebrandt
no flags Details


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 26218 Normal Resolved Creating a host on ovirt v4 without a storage domain returns undefined method `storagedomains' 2020-02-05 23:55:31 UTC
Red Hat Product Errata RHSA-2020:1454 None None None 2020-04-14 13:23:59 UTC

Description Lukáš Hellebrandt 2019-01-10 14:28:35 UTC
Created attachment 1519827 [details]
production.log

Description of problem:
When using Hammer to create (and possibly do some other operations, too) a new host on a RHEV compute resource that is set to use API v4, and when using --volume argument, the operation fails with the following error message:

"""
Could not create the host:
  Failed to create a compute rhev5 (RHV) instance lhellebr-diskif-4.testdom: undefined method `storagedomains' for #<Fog::Compute::Ovirt::V4::Real:0x00007fd139adb1e8>
  Did you mean?  storage_domains
"""

Also attaching production.log and RHEV's engine.log.

Version-Release number of selected component (if applicable):
Tested on Sat 6.5 snap 10 AND on Sat 6.4.1.

How reproducible:
Deterministic

Steps to Reproduce:
Run "hammer host create" with --volume and some RHEV with APIv4 specified. I ran:
# hammer host create --location-id 2 --organization-id 1 --name lhellebr-diskif-4 --compute-resource rhev5 --mac 00:1a:4a:16:01:6e --domain testdom --operatingsystem-id 2 --architecture x86_64 --root-password password --kickstart-repository-id 1 --partition-table 'Kickstart default' --lifecycle-environment Library --content-view 'Default Organization View' --content-source '<FQDN>' --interface mac=00:1a:4a:16:01:6e,ip=192.168.1.191,type=interface,name=eth0,subnet_id=1,domain_id=2,compute_network=03e8b4e6-7764-468d-8ff3-98bb6da1e84b --volume name=lhellebr-virtio-scsi-bug,storage_pod=VMS,size_gb=10,interface=virtio_scsi

Actual results:
"undefined method `storagedomains'", traceback in production.log, host not created

Expected results:
Host created successfully with the specified volume

Comment 3 Lukáš Hellebrandt 2019-01-10 14:28:59 UTC
Created attachment 1519836 [details]
engine.log

Comment 4 Shira Maximov 2019-01-13 08:10:03 UTC
Lukas, 
please notice that under the section volume, you have storage_pod argument which is not part of the available arguments in ovirt:

    --volume:
      size_gb             Volume size in GB, integer value
      storage_domain      Select one of available storage domains
      bootable            Boolean, only one volume can be bootable

please try to replace the storage_pod with storage_domain, and the value should be the storage domain id.

Comment 5 Lukáš Hellebrandt 2019-01-14 13:54:08 UTC
That's true, I used the VMWare argument by mistake. However, "undefined method" error is definitely a bug - albeit with lower severity.

# ... --volume name=lhellebr-virtio-scsi-bug2,storage_domain=c4fc24ba-651a-4db6-a137-c5ad8a4a921f,size_gb=10,interface=virtio_scsi
Host created.

The new reproducer is the same as in OP, but with added "and without storage_domain defined in --volume".

Comment 6 Bryan Kearney 2019-09-12 12:06:54 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/26218 has been resolved.

Comment 7 Lukáš Hellebrandt 2019-12-13 13:17:40 UTC
Verified with Sat 6.7 snap 4.

Used reproducer from OP, just changed storage_pod=name to storage_domain=id. No error message, host and VM got created.

Used reproducer from OP as updated by comment 5. Got (correct) error message:
"""
Could not create the host:
  Failed to create a compute testrhev4 (RHV) instance lhellebr-undef-storagedomains-3.vms.sat.rdu2.redhat.com: Fault reason is "Operation Failed". Fault detail is "[Cannot add Virtual Disk. Storage Domain hasn't been specified.]". HTTP response code is 400.
"""

Comment 10 errata-xmlrpc 2020-04-14 13:23:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1454


Note You need to log in before you can comment on or make changes to this bug.