Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2081554

Summary: [backend] Unable to clone vm from snapshot if VM has preallocated COW disk (incremental)
Product: Red Hat Enterprise Virtualization Manager Reporter: Germano Veit Michel <gveitmic>
Component: ovirt-engineAssignee: Nobody <nobody>
Status: CLOSED DUPLICATE QA Contact: meital avital <mavital>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.4.10CC: ahadas, bzlotnik, nsoffer
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-09 07:21:32 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:
Bug Depends On:    
Bug Blocks: 2081556    

Description Germano Veit Michel 2022-05-03 23:58:57 UTC
Description of problem:

It is not possible to clone a VM from snapshot if the VM has preallocated COW disks (for incremental backup)

Version-Release number of selected component (if applicable):
rhvm-4.4.10.7-0.4.el8ev.noarch
vdsm-4.40.100.2-1.el8ev.x86_64

How reproducible:
100%

Steps to Reproduce:

1. Create a VM, with no disks

2. Virtual Machines -> VM -> Disks -> New
   Set the disk to preallocated and enable incremental:
     Allocation Policy: PREALLOCATED
     [x] Enable Incremental Backup
     Size: 100G

3. Click OK

5. Now we create a snapshot of the VM, our base image is prealloc and the new one is thin, as expected

  653f262a-ad0c-401d-b91e-d1885a7d4eaa 39f872a5-5983-45c3-ad2b-15a7fcc25b3f -wi-------   1.00g IU_63ecd0c0-612c-4d5e-ba68-63bd38d84b11,MD_21,PU_9d4a796c-d624-47f0-a362-4c3a8d63387f
  9d4a796c-d624-47f0-a362-4c3a8d63387f 39f872a5-5983-45c3-ad2b-15a7fcc25b3f -wi------- 100.00g IU_63ecd0c0-612c-4d5e-ba68-63bd38d84b11,MD_20,PU_00000000-0000-0000-0000-000000000000

                image_guid              |     size     | volume_type | volume_format 
  --------------------------------------+--------------+-------------+---------------
   9d4a796c-d624-47f0-a362-4c3a8d63387f | 107374182400 |           1 |             4
   653f262a-ad0c-401d-b91e-d1885a7d4eaa | 107374182400 |           2 |             4

6. Now try to clone the VM from that snapshot:

The backend seems to ignore <backup>incremental</backup>, and then deny a COW+Preallocated disk (which is enabled by incremental)

DEBUG:root:< POST /ovirt-engine/api/vms HTTP/1.1
...
DEBUG:root:< <vm>
DEBUG:root:<   <name>myclonedvm</name>
DEBUG:root:<   <cluster>
DEBUG:root:<     <name>Default</name>
DEBUG:root:<   </cluster>
DEBUG:root:<   <disk_attachments>
DEBUG:root:<     <disk_attachment>
DEBUG:root:<       <disk id="63ecd0c0-612c-4d5e-ba68-63bd38d84b11">
DEBUG:root:<         <backup>incremental</backup>
DEBUG:root:<         <format>cow</format>
DEBUG:root:<         <sparse>false</sparse>
DEBUG:root:<         <storage_domains>
DEBUG:root:<           <storage_domain id="39f872a5-5983-45c3-ad2b-15a7fcc25b3f"/>
DEBUG:root:<         </storage_domains>
DEBUG:root:<       </disk>
DEBUG:root:<     </disk_attachment>
DEBUG:root:<   </disk_attachments>
DEBUG:root:<   <snapshots>
DEBUG:root:<     <snapshot id="35708851-8729-4521-84b7-173684ea36f0"/>
DEBUG:root:<   </snapshots>
DEBUG:root:< </vm>
...
DEBUG:root:> <fault>
DEBUG:root:>     <detail>[Cannot add VM. Disk configuration (COW Preallocated backup-None) is incompatible with the storage domain type.]</detail>
DEBUG:root:>     <reason>Operation Failed</reason>
DEBUG:root:> </fault>

Comment 2 Arik 2022-05-09 06:59:42 UTC
Seems related to bz 2046689