Created attachment 1519827 [details]
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.
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
"undefined method `storagedomains'", traceback in production.log, host not created
Host created successfully with the specified volume
Created attachment 1519836 [details]
please notice that under the section volume, you have storage_pod argument which is not part of the available arguments in ovirt:
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.
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
The new reproducer is the same as in OP, but with added "and without storage_domain defined in --volume".
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/26218 has been resolved.
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.
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.