Bug 1622989

Summary: APIv4 provisioning through Hammer: "Cannot add VM. Quota is not valid."
Product: Red Hat Satellite Reporter: Lukáš Hellebrandt <lhellebr>
Component: Compute Resources - RHEVAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: egolov, inecas, lhellebr, mshira, orabin
Target Milestone: 6.4.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-fog-ovirt-1.1.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:02:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1613740    
Bug Blocks:    

Description Lukáš Hellebrandt 2018-08-28 10:39:28 UTC
Description of problem:
When creating a new VM on RHEV through Hammer using CR with APIv4=true, the following error occurs:

Could not create the host:
  Failed to create a compute rhev-4 (RHV) instance lh-host-hammer-image-based-apiv3-8.example.com: Fault reason is "Operation Failed". Fault detail is "[Cannot add VM. Quota is not valid.]". HTTP response code is 400.

This happens with both image based and network based provisioning.

Version-Release number of selected component (if applicable):
Tested on Sat 6.4 snap 18.

How reproducible:
Deterministic

Steps to Reproduce:
# hammer host create --architecture ... --compute-prile-id ... --compute-resource-id ... --content-source-id ... --content-view-id ... --domain-id ... --environment-id ... --interface compute_network=<rhev_network_uuid>,ip=...,managed=true,primary=true,provision=true --ip ... --lifecycle-environment-id ... --location-id ... --name ... --operatingsystem-id ... --organization-id ... --partition-table-id ... --product-id ... --provision-method image --root-password ... --subnet-id ... --image-id ... --compute-attributes start=1


Actual results:
Could not create the host:
  Failed to create a compute rhev-4 (RHV) instance lh-host-hammer-image-based-apiv3-8.example.com: Fault reason is "Operation Failed". Fault detail is "[Cannot add VM. Quota is not valid.]". HTTP response code is 400.

Expected results:
No error, VM successfully created and provisioned

Additional info:
There are also other open BZs related to Quotas in Hammer.

Comment 2 orabin 2018-08-28 18:01:48 UTC
Was the CR created from hammer?

If so it's because of: https://bugzilla.redhat.com/show_bug.cgi?id=1583242.
If that's the case the CR needs to be edited from the UI, click "Test Connection" and save. After that please try to create the host again.

Comment 3 Lukáš Hellebrandt 2018-08-29 07:49:06 UTC
The CR has NOT been created through Hammer. Also, when I just switch it to v3 and change nothing else, it works. When I switch it back to v4, it does not again.

Comment 4 orabin 2018-08-29 21:39:11 UTC
I was able to reproduce and what I saw is that the cluster selected was in a different datacenter then the quota.
The error is because of the mismatch between the quota and the cluster's datacenter.

This is caused by: https://bugzilla.redhat.com/show_bug.cgi?id=1613740 which has a suggested fix open and under review.

I'm adding that bug to the "depends on" field and this can be moved to on_qa once the other bug is solved.

Comment 5 Ivan Necas 2018-09-04 10:49:01 UTC
Based on https://bugzilla.redhat.com/show_bug.cgi?id=1620094, I'm moving this to Modified, as https://bugzilla.redhat.com/show_bug.cgi?id=1613740 is getting modified as well

Comment 6 Lukáš Hellebrandt 2018-09-13 10:03:09 UTC
Verified with Sat 6.4 snap 21 with both image based and network based provisioning. The VMs got created successfully.

Comment 7 Bryan Kearney 2018-10-16 19:02:30 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-2018:2927