Bug 1721599

Summary: Cannot create volume with initial size on preallocated qcow volume
Product: [oVirt] vdsm Reporter: Daniel Erez <derez>
Component: GeneralAssignee: Daniel Erez <derez>
Status: CLOSED CURRENTRELEASE QA Contact: Evelina Shames <eshames>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.40.0CC: bugs, nsoffer, tnisan
Target Milestone: ovirt-4.4.0Flags: sbonazzo: ovirt-4.4?
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: 2020-05-20 20:00:47 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:

Description Daniel Erez 2019-06-18 16:30:10 UTC
Description of problem:
'blockVolume -> calculate_volume_alloc_size' contains a validation to prevent specifying initial_size for preallocated volumes. It should be removed as creating qcow volumes on preallocated is needed for restoring from incremental backup.

Comment 1 Nir Soffer 2019-06-24 23:05:51 UTC
Daniel, can you describe the use case for this?

I think the only use case is restoring the base volume created using
preallocated qcow2 format, when the size of the volume is bigger than
the virtual size (due to qcow2 metadata).

For snapshots we always use sparse format and never pre-allocated, right?

Comment 2 Daniel Erez 2019-07-02 06:52:35 UTC
(In reply to Nir Soffer from comment #1)
> Daniel, can you describe the use case for this?
> 
> I think the only use case is restoring the base volume created using
> preallocated qcow2 format, when the size of the volume is bigger than
> the virtual size (due to qcow2 metadata).
> 
> For snapshots we always use sparse format and never pre-allocated, right?

Right, on snapshot creation, engine always creates a sparse format volume.

Comment 3 Avihai 2019-12-04 14:54:37 UTC
Hi Daniel,

Is there an easy user scenario to verify this bug?

Comment 4 Evelina Shames 2019-12-23 09:50:33 UTC
Hi Daniel,
Please provide a clear scenario for verification, thanks.

Comment 5 Daniel Erez 2020-01-05 16:54:46 UTC
(In reply to Evelina Shames from comment #4)
> Hi Daniel,
> Please provide a clear scenario for verification, thanks.

You can verify by creating a preallocated cow disk on a block domain with a specified initial size (and incremental backup enabled).
E.g.:

POST /ovirt-engine/api/disks
<disk>
    <sparse>false</sparse>
    <format>cow</format>
    <backup>incremental</backup>
    <initial_size>1024</initial_size>
    <provisioned_size>1024</provisioned_size>
    <storage_domains>
      <storage_domain>
      	<name>block</name>
      </storage_domain>
    </storage_domains>
</disk>

Comment 6 Evelina Shames 2020-01-06 08:46:10 UTC
Verified on engine-4.4.0-0.13.master.el7

Comment 7 Sandro Bonazzola 2020-05-20 20:00:47 UTC
This bugzilla is included in oVirt 4.4.0 release, published on May 20th 2020.

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