Bug 1517492

Summary: Create VM with new created quota fails.
Product: [oVirt] ovirt-engine Reporter: Polina <pagranat>
Component: Backend.CoreAssignee: Andrej Krejcir <akrejcir>
Status: CLOSED CURRENTRELEASE QA Contact: Polina <pagranat>
Severity: medium Docs Contact:
Priority: high    
Version: 4.2.0CC: akrejcir, bugs, michal.skrivanek, pagranat
Target Milestone: ovirt-4.2.1Keywords: Regression
Target Release: ---Flags: rule-engine: ovirt-4.2+
rule-engine: blocker+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Using the REST API it was possible to create an empty quota with no storage or cluster limits. Consequence: This quota could not be assigned to a VM and was not visible form the UI. Fix: When a new quota is created using the API, the storage and cluster limit objects are also created and set to unlimited. Result: The newly created quota can be used and is visible in the UI.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-12 11:56:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
engine.log attached none

Description Polina 2017-11-26 07:16:11 UTC
Description of problem: 
Create new quota with name , get 201. then try to create VM with this quota - bad request 400. it is regression from 4.1.

Version-Release number of selected component (if applicable):
rhvm-4.2.0-0.5.master.el7.noarch

How reproducible:100%

Steps to Reproduce:
1. Create minimal quota, like 
 Content-Type: application/xml

 POST https://compute-ge-3.scl.lab.tlv.redhat.com/ovirt-
 engine/api/datacenters/bb4bff86-9243-4fc2-b57e-fdc29a93b176/quotas

 <quota>
   <name>q1</name>
 </quota>

2. Create new vm with this quota 
   
Actual results: in webUI the quota even not in the quota list (Edit VM/Genera/quota).
Trying to send by Rest API returns error 400

<fault>
    <detail>[Cannot add VM. Quota is not valid.]</detail>
    <reason>Operation Failed</reason>
</fault>


Expected results: it is regression from 4.1


Additional info:

Comment 1 Polina 2017-11-26 07:18:18 UTC
Expected results: it is regression from 4.1. So, expected - the VM is created successfully.

Comment 2 Yaniv Kaul 2017-11-26 10:30:52 UTC
1. Please rephrase the title.
2. Please provide all relevant logs.
3. As the error says - please check the quota is valid.

Comment 3 Polina 2017-11-26 12:29:37 UTC
1.

Comment 4 Polina 2017-11-26 12:51:52 UTC
Created attachment 1359148 [details]
engine.log attached

Comment 5 Polina 2017-11-26 12:56:50 UTC
1. The title is rephrased.
2. engine.log added
3. quota is valid. Created with status 201. and I also checked that the same quota is created in 4.1.

Comment 6 Yaniv Kaul 2017-11-26 13:57:53 UTC
At least according to engine.log, the name of the quota is 'quota_1' and not 'q1':

2017-11-26 14:44:09,168+02 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-27) [d676b66d-33de-41d0-a4bc-a0b88de77277] EVENT_ID: USER_ADD_QUOTA(3,000), Quota quota_1 has been added by admin@internal-authz.

Comment 7 Polina 2017-11-27 07:24:14 UTC
yes, you are right. to attach the logs I reproduced the scenario anew and put the 
new quota name = 'quota_1'. So, In POST request the same name must be used accordingly :
POST https://compute-ge-3.scl.lab.tlv.redhat.com/ovirt-
 engine/api/datacenters/bb4bff86-9243-4fc2-b57e-fdc29a93b176/quotas

 <quota>
   <name>quota_1</name>
 </quota>

Comment 8 Michal Skrivanek 2017-11-27 09:18:40 UTC
nothing obvious in the logs, just returning ACTION_TYPE_FAILED_QUOTA_NOT_EXIST.
moving to SLA area

Comment 9 Red Hat Bugzilla Rules Engine 2017-12-06 11:36:45 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 10 Polina 2018-01-08 10:04:30 UTC
verified by running regression test rhevmtests/compute/sla/quota/quota_test.py
for rhv-release-4.2.1-1-001.noarch

Comment 11 Sandro Bonazzola 2018-02-12 11:56:07 UTC
This bugzilla is included in oVirt 4.2.1 release, published on Feb 12th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.1 release, it has been closed with a resolution of CURRENT RELEASE.

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