Bug 1518693 - Quota is needed to copy template disk
Summary: Quota is needed to copy template disk
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: ovirt-4.2.0
: ---
Assignee: Andrej Krejcir
QA Contact: Raz Tamir
URL:
Whiteboard:
Keywords: Automation, Regression
: 1519224 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-29 13:34 UTC by Raz Tamir
Modified: 2017-12-20 11:18 UTC (History)
3 users (show)

(edit)
Cause: 
Null quota on a disk is not allowed.
When a disk is copied or moved using the rest API and no quota parameter is specified, the new disk will have the same quota as the old one.

Consequence: 
If an existing disk has a null quota in the DB, because it was created before the default quota was introduced, it cannot be copied or using without specifying a new quota.

Fix: 
If a disk with null quota is copied without specifying new quota, the default quota is used.

Result: 
Copying and moving disks using rest now works as expected without specifying new quota.
Clone Of:
(edit)
Last Closed: 2017-12-20 11:18:04 UTC
rule-engine: ovirt-4.2+
rule-engine: blocker+


Attachments (Terms of Use)
engine log (10.99 KB, application/x-gzip)
2017-11-29 13:34 UTC, Raz Tamir
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 84899 master MERGED core: Moving or copying disk uses default quota 2017-12-01 12:11 UTC

Description Raz Tamir 2017-11-29 13:34:15 UTC
Created attachment 1360311 [details]
engine log

Description of problem:
In our automation (tier 3) we see that copying a template's disk is now required a quota for the operation to succeed:

POST to /api/disks/14b4fbc2-2610-4420-87b0-72260bada96d/copy
<action>
    <async>false</async>
    <storage_domain href="/ovirt-engine/api/storagedomains/0b7d7943-ec75-4738-b263-ac1ba9ba216e" id="0b7d7943-ec75-4738-b263-ac1ba9ba216e">
        <name>nfs_1</name>
        <storage>
            <address>yellow-vdsb.qa.lab.tlv.redhat.com</address>
            <path>/Storage_NFS/storage_local_ge6_nfs_1</path>
            <type>nfs</type>
        </storage>
        <storage_format>v4</storage_format>
        <type>data</type>
        <data_centers>
            <data_center href="/ovirt-engine/api/datacenters/480d7e0f-4587-41d7-a045-a0fd8a41b6af" id="480d7e0f-4587-41d7-a045-a0fd8a41b6af"/>
        </data_centers>
    </storage_domain>
</action>

Failed with 
Status: 400
Reason: Bad Request
Detail: [Cannot copy Virtual Disk. Quota cannot be null.]

In engine.log:
2017-11-29 15:22:02,255+02 INFO  [org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand] (default task-16) [disks_syncAction_1001ea6d-4d06-4a50] Lock Acquired to object 'EngineLock:{exclusiveLocks='[14b4fbc2-2610-4420-87b0-72260bada96d=DISK]', sharedLocks='[d022534c-ef42-4496-b13f-3838f5ca32d3=TEMPLATE]'}'
2017-11-29 15:22:02,629+02 WARN  [org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand] (default task-16) [disks_syncAction_1001ea6d-4d06-4a50] Validation of action 'MoveOrCopyDisk' failed for user admin@internal-authz. Reasons: VAR__ACTION__COPY,VAR__TYPE__DISK,ACTION_TYPE_FAILED_QUOTA_NULL_NOT_ALLOWED
2017-11-29 15:22:02,630+02 INFO  [org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommand] (default task-16) [disks_syncAction_1001ea6d-4d06-4a50] Lock freed to object 'EngineLock:{exclusiveLocks='[14b4fbc2-2610-4420-87b0-72260bada96d=DISK]', sharedLocks='[d022534c-ef42-4496-b13f-3838f5ca32d3=TEMPLATE]'}'
2017-11-29 15:22:02,694+02 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-16) [] Operation Failed: [Cannot copy Virtual Disk. Quota cannot be null.]



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

How reproducible:
100%

Steps to Reproduce:
1. Copy template disk using the provided POST body
2.
3.

Actual results:


Expected results:
Regression flag - this test is passing in previous builds

Additional info:

Comment 1 Allon Mureinik 2017-11-29 13:39:45 UTC
Quotas are SLA's domain.
I **think** this was done intentionally, but let's leave it up to the appropriate stakeholders to weigh in.

Comment 2 Andrej Krejcir 2017-11-29 14:12:10 UTC
This is partially intentional. The change was done in Bug 1496704.

When a disk is copied using REST and no quota parameter is specified, the current quota of the disk is used for the copy. But if the disk has null quota, it cannot be used for the new disk and the error is shown.

We can change this, so if the original disk has null quota, the default quota will be used for the copy.

As a workaround, the default quota can be used as a parameter in the rest call:

<action>
  <storage_domain id=... />
  <quota id={ID_OF_THE_DEFAULT_QUOTA} />
</action>

The new parameters are described here:
http://ovirt.github.io/ovirt-engine-api-model/master/#services/disk/methods/copy

Comment 3 Raz Tamir 2017-11-30 12:42:13 UTC
*** Bug 1519224 has been marked as a duplicate of this bug. ***

Comment 4 Raz Tamir 2017-12-07 20:18:12 UTC
Not observed in automation run over rhvm-4.2.0-0.6.el7

Verified

Comment 5 Sandro Bonazzola 2017-12-20 11:18:04 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

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


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