Bug 1465786

Summary: [REST-API] Creating disk using REST-API "ignore" the 'provisioned_size' field
Product: [oVirt] ovirt-engine Reporter: Eyal Shenitzky <eshenitz>
Component: BLL.StorageAssignee: Allon Mureinik <amureini>
Status: CLOSED NOTABUG QA Contact: Raz Tamir <ratamir>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2.0CC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-28 08:37:01 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:
Embargoed:
Attachments:
Description Flags
engine and vdsm logs none

Description Eyal Shenitzky 2017-06-28 08:04:30 UTC
Created attachment 1292579 [details]
engine and vdsm logs

Description of problem:

When trying to create a disk using REST-API with provisional_size > 1 GB (10 GB for example),
The disk added successfully but in the GUI it shows the virtual size as less than 1 GB, while on REST the disk provisional_size shown as 10 GB.

REST-API command:
../ovirt-engine/api/disks:

<disk>	
    <description>rest_disk</description>
    <alias>rest_disk</alias>
    <bootable>false</bootable>
    <format>raw</format>
    <interface>virtio_scsi</interface>
    <provisioned_size>10</provisioned_size>
    <sparse>false</sparse>
    <storage_domains>
    	<storage_domain>
    		<name>iscsi_1</name>
    	</storage_domain>
    </storage_domains>
</disk>

Version-Release number of selected component (if applicable):
Engine - 4.2.0-0.0.master.20170624071949.gitff9611b.el7.centos
VDSM - 4.20.1-66.git228c7be.el7.centos.x86_64

Also, occurs on:
Engine - 4.1.3.5-0.1.el7
VDSM - 4.19.20-1.el7ev.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create disk using REST-API with the following command

../ovirt-engine/api/disks:

<disk>	
    <description>rest_disk</description>
    <alias>rest_disk</alias>
    <bootable>false</bootable>
    <format>raw</format>
    <interface>virtio_scsi</interface>
    <provisioned_size>10</provisioned_size>
    <sparse>false</sparse>
    <storage_domains>
    	<storage_domain>
    		<name>iscsi_1</name>
    	</storage_domain>
    </storage_domains>
</disk>

Actual results:
Disk created successfully with virtual size < 1 GB

Expected results:
Disk should create successfully with virtual size < 10 GB


Additional info:
Engine and VDSM logs attached

Comment 1 Allon Mureinik 2017-06-28 08:37:01 UTC
All the sizes are in bytes, as stated in the documentation:

    /**
     * The virtual size of the disk, in bytes.
     *
     * This attribute is mandatory when creating a new disk.
     *
     * @author Juan Hernandez <juan.hernandez>
     * @author Megan Lewis <melewis>
     * @date 26 Apr 2017
     * @status updated_by_docs
     */
    Integer provisionedSize();

10 bytes is indeed <1GB.
Closing.