Bug 1662670

Summary: REST: Disk creation on a block-based domain, with provisioned size 0 is initiated and fails on vdsm
Product: [oVirt] ovirt-engine Reporter: Elad <ebenahar>
Component: BLL.StorageAssignee: Fedor Gavrilov <fgavrilo>
Status: CLOSED CURRENTRELEASE QA Contact: Evelina Shames <eshames>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.3.0CC: aefrat, bugs, tnisan
Target Milestone: ovirt-4.3.1Keywords: Automation
Target Release: ---Flags: rule-engine: ovirt-4.3+
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.3.1.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-13 16:39:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
logs none

Description Elad 2018-12-31 12:30:10 UTC
Created attachment 1517651 [details]
logs

Description of problem:
An attempt to create a disk on a block-based domain, with provisioned size as 0 passes validation and fails on vdsm.


Version-Release number of selected component (if applicable):
vdsm-4.30.4-1.el7ev.x86_64
ovirt-engine-4.3.0-0.6.alpha2.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1. Via REST: Create a disk on a block-based domain with provisioned_size 0

 /ovirt-engine/api/disks/73bec1e8-aaaf-42c1-8437-d7eb278307c3

2018-12-31 14:18:28,243 - MainThread - disks - DEBUG - Response body for CREATE request is: 
<disk href="/ovirt-engine/api/disks/73bec1e8-aaaf-42c1-8437-d7eb278307c3" id="73bec1e8-aaaf-42c1-8437-d7eb278307c3">
    <actions>
        <link href="/ovirt-engine/api/disks/73bec1e8-aaaf-42c1-8437-d7eb278307c3/reduce" rel="reduce"/>
        <link href="/ovirt-engine/api/disks/73bec1e8-aaaf-42c1-8437-d7eb278307c3/copy" rel="copy"/>
        <link href="/ovirt-engine/api/disks/73bec1e8-aaaf-42c1-8437-d7eb278307c3/export" rel="export"/>
        <link href="/ovirt-engine/api/disks/73bec1e8-aaaf-42c1-8437-d7eb278307c3/move" rel="move"/>
        <link href="/ovirt-engine/api/disks/73bec1e8-aaaf-42c1-8437-d7eb278307c3/sparsify" rel="sparsify"/>
        <link href="/ovirt-engine/api/disks/73bec1e8-aaaf-42c1-8437-d7eb278307c3/refreshlun" rel="refreshlun"/>
    </actions>
    <name>disk_random_test_3114173252</name>
    <description></description>
    <link href="/ovirt-engine/api/disks/73bec1e8-aaaf-42c1-8437-d7eb278307c3/permissions" rel="permissions"/>
    <link href="/ovirt-engine/api/disks/73bec1e8-aaaf-42c1-8437-d7eb278307c3/statistics" rel="statistics"/>
    <actual_size>0</actual_size>
    <alias>disk_random_test_3114173252</alias>
    <content_type>data</content_type>
    <format>raw</format>
    <image_id>f97833d1-0459-4385-95bd-b6050e43f084</image_id>
    <propagate_errors>false</propagate_errors>
    <provisioned_size>0</provisioned_size>
    <shareable>false</shareable>
    <sparse>false</sparse>
    <status>locked</status>
    <storage_type>image</storage_type>
    <total_size>0</total_size>
    <wipe_after_delete>false</wipe_after_delete>
    <disk_profile href="/ovirt-engine/api/diskprofiles/47c41493-812d-4b35-85f9-fe2adb96b864" id="47c41493-812d-4b35-85f9-fe2adb96b864"/>
    <quota href="/ovirt-engine/api/datacenters/2288b8b4-06e6-44cc-8294-3f6ceec565f5/quotas/1de3f80a-e779-44c3-b88a-a32f382a8506" id="1de3f80a-e779-44c3-b88a-a32f382a8506"/>
    <storage_domains>
        <storage_domain href="/ovirt-engine/api/storagedomains/4ce63bb8-71fb-4936-aff1-905c5e131f95" id="4ce63bb8-71fb-4936-aff1-905c5e131f95"/>
    </storage_domains>
</disk>

Actual results:


Disk creation is initiated:


2018-12-31 14:18:27,614+02 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.CreateImageVDSCommand] (default task-9) [disks_create_68231710-b0b6-4502] START, CreateImageVDSCommand( CreateImageVDSCommandParameters:{storagePoolId='2288b8b4-06e6-44cc-8294-3f6ceec565f5', ignoreFailoverLimit='false', storageDomainId='4ce63bb8-71fb-4936-aff1-905c5e131f95', imageGroupId='73bec1e8-aaaf-42c1-8437-d7eb278307c3', imageSizeInBytes='0', volumeFormat='RAW', newImageId='f97833d1-0459-4385-95bd-b6050e43f084', imageType='Preallocated', newImageDescription='{"DiskAlias":"disk_random_test_3114173252","DiskDescription":""}', imageInitialSizeInBytes='0'}), log id: 7c0ef372



And fails on vdsm:

2018-12-31 14:18:28,340+0200 INFO  (tasks/1) [storage.LVM] Creating LV (vg=4ce63bb8-71fb-4936-aff1-905c5e131f95, lv=f97833d1-0459-4385-95bd-b6050e43f084, size=0m, activate=True, contiguous=False, initialTags=('O
VIRT_VOL_INITIALIZING',)) (lvm:1147)
2018-12-31 14:18:28,933+0200 ERROR (tasks/1) [storage.Volume] Failed to create volume /rhev/data-center/mnt/blockSD/4ce63bb8-71fb-4936-aff1-905c5e131f95/images/73bec1e8-aaaf-42c1-8437-d7eb278307c3/f97833d1-0459-
4385-95bd-b6050e43f084: Cannot create Logical Volume: u'vgname=4ce63bb8-71fb-4936-aff1-905c5e131f95 lvname=f97833d1-0459-4385-95bd-b6050e43f084 err=[\'  --size may not be zero.\', "  Run `lvcreate --help\' for m
ore information."]' (volume:1207)
2018-12-31 14:18:28,933+0200 ERROR (tasks/1) [storage.Volume] Unexpected error (volume:1244)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/storage/volume.py", line 1204, in create
    initialSize=initialSize)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/blockVolume.py", line 511, in _create
    initialTags=(sc.TAG_VOL_UNINIT,))
  File "/usr/lib/python2.7/site-packages/vdsm/storage/lvm.py", line 1161, in createLV
    raise se.CannotCreateLogicalVolume(vgName, lvName, err)
CannotCreateLogicalVolume: Cannot create Logical Volume: u'vgname=4ce63bb8-71fb-4936-aff1-905c5e131f95 lvname=f97833d1-0459-4385-95bd-b6050e43f084 err=[\'  --size may not be zero.\', "  Run `lvcreate --help\' fo
r more information."]'
2018-12-31 14:18:28,935+0200 ERROR (tasks/1) [storage.TaskManager.Task] (Task='e4476732-2916-4d40-9a42-899066e4deea') Unexpected error (task:875)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 882, in _run
    return fn(*args, **kargs)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/task.py", line 336, in run
    return self.cmd(*self.argslist, **self.argsdict)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/securable.py", line 79, in wrapper
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/sp.py", line 1940, in createVolume
    initialSize=initialSize)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/sd.py", line 817, in createVolume
    initialSize=initialSize)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/volume.py", line 1204, in create
    initialSize=initialSize)
  File "/usr/lib/python2.7/site-packages/vdsm/storage/blockVolume.py", line 511, in _create
    initialTags=(sc.TAG_VOL_UNINIT,))
  File "/usr/lib/python2.7/site-packages/vdsm/storage/lvm.py", line 1161, in createLV
    raise se.CannotCreateLogicalVolume(vgName, lvName, err)
CannotCreateLogicalVolume: Cannot create Logical Volume: u'vgname=4ce63bb8-71fb-4936-aff1-905c5e131f95 lvname=f97833d1-0459-4385-95bd-b6050e43f084 err=[\'  --size may not be zero.\', "  Run `lvcreate --help\' for more information."]'



Expected results:
Disk creation with size 0 should not pass validation


Additional info:
logs

Comment 1 Sandro Bonazzola 2019-01-28 09:34:22 UTC
This bug has not been marked as blocker for oVirt 4.3.0.
Since we are releasing it tomorrow, January 29th, this bug has been re-targeted to 4.3.1.

Comment 2 Evelina Shames 2019-03-07 13:28:03 UTC
Verified on engine 4.3.1.1-0.1.el7.

Comment 3 Sandro Bonazzola 2019-03-13 16:39:29 UTC
This bugzilla is included in oVirt 4.3.1 release, published on February 28th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.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.