Bug 1304405

Summary: Copying a disk converts the volume type to SHARED
Product: [oVirt] ovirt-engine Reporter: Raz Tamir <ratamir>
Component: BLL.StorageAssignee: Tal Nisan <tnisan>
Status: CLOSED CURRENTRELEASE QA Contact: Elad <ebenahar>
Severity: urgent Docs Contact:
Priority: high    
Version: 3.6.2.6CC: amureini, bugs, gklein, sbonazzo, ylavi
Target Milestone: ovirt-3.6.3Keywords: Automation
Target Release: 3.6.3.1Flags: rule-engine: ovirt-3.6.z+
rule-engine: exception+
ylavi: planning_ack+
amureini: devel_ack+
acanan: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-10 12:49:23 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 Raz Tamir 2016-02-03 14:15:59 UTC
Created attachment 1120792 [details]
engine and vdsm logs

Description of problem:
* This bug scenario was raised by a customer

After copying a disk, the image type of the new image is shared.
After creating a snapshot with this new image it is impossible to perform live snapshot deletion.

From engine.log (the copy):

2016-02-03 14:24:51,292 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.CopyImageVDSCommand] (org.ovirt.thread.pool-7-thread-35) [3bbc6663] START, CopyImageVDSCommand( CopyImageVDSCommandParameters:{runAsync='true
', storagePoolId='6b6602e0-bc14-41b8-8e4b-a1ef53f83750', ignoreFailoverLimit='false', storageDomainId='f165957f-0a0c-4bb6-90c8-bbf5fcfeb4dc', imageGroupId='6708758f-1644-4044-9512-6eb2928b7b1b', imageId='b07b76bc-9
b30-4e5f-8249-1dd22f8807d3', dstImageGroupId='18dc6f7c-cf15-441f-b0cd-a13a9a8b443f', vmId='00000000-0000-0000-0000-000000000000', dstImageId='58e8e1a7-0f15-40c1-a231-54dcb4e8aab8', imageDescription='', dstStorageDo
mainId='f165957f-0a0c-4bb6-90c8-bbf5fcfeb4dc', copyVolumeType='SharedVol', volumeFormat='COW', preallocate='Sparse', postZero='false', force='false'})

From engine.log (live merge):

2016-02-02 18:40:46,371 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.MergeVDSCommand] (pool-6-thread-3) [195f830e] START, MergeVDSCommand(HostName = host_mixed_2, MergeVDSCommandParameters:{runAsync='true', hostId='e1903445-198c-4c69-aae3-7aba812145ac', vmId='8f26ad7e-6243-40a2-bd6e-e5438bbcae84', storagePoolId='6b6602e0-bc14-41b8-8e4b-a1ef53f83750', storageDomainId='7b00a096-46ae-4241-956d-9a8461f0227a', imageGroupId='5521c659-0a1e-4880-ac46-a9ff0c756b6d', imageId='8f136f80-4008-469a-8d0b-cd0e830c1920', baseImageId='76aebca7-0067-470b-b101-5f24fa2bfa4d', topImageId='8f136f80-4008-469a-8d0b-cd0e830c1920', bandwidth='0'}), log id: 20f2a1d1
2016-02-02 18:40:47,490 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.MergeVDSCommand] (pool-6-thread-3) [195f830e] Failed in 'MergeVDS' method
2016-02-02 18:40:47,495 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (pool-6-thread-3) [195f830e] Correlation ID: null, Call Stack: null, Custom Event ID: -1, Message: VDSM host_mixed_2 command failed: Merge failed
2016-02-02 18:40:47,495 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.MergeVDSCommand] (pool-6-thread-3) [195f830e] Command 'org.ovirt.engine.core.vdsbroker.vdsbroker.MergeVDSCommand' return value 'StatusOnlyReturnForXmlRpc [status=StatusForXmlRpc [code=52, message=Merge failed]]'
2016-02-02 18:40:47,495 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.MergeVDSCommand] (pool-6-thread-3) [195f830e] HostName = host_mixed_2
2016-02-02 18:40:47,495 ERROR [org.ovirt.engine.core.vdsbroker.vdsbroker.MergeVDSCommand] (pool-6-thread-3) [195f830e] Command 'MergeVDSCommand(HostName = host_mixed_2, MergeVDSCommandParameters:{runAsync='true', hostId='e1903445-198c-4c69-aae3-7aba812145ac', vmId='8f26ad7e-6243-40a2-bd6e-e5438bbcae84', storagePoolId='6b6602e0-bc14-41b8-8e4b-a1ef53f83750', storageDomainId='7b00a096-46ae-4241-956d-9a8461f0227a', imageGroupId='5521c659-0a1e-4880-ac46-a9ff0c756b6d', imageId='8f136f80-4008-469a-8d0b-cd0e830c1920', baseImageId='76aebca7-0067-470b-b101-5f24fa2bfa4d', topImageId='8f136f80-4008-469a-8d0b-cd0e830c1920', bandwidth='0'})' execution failed: VDSGenericException: VDSErrorException: Failed to MergeVDS, error = Merge failed, code = 52
2016-02-02 18:40:47,495 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.MergeVDSCommand] (pool-6-thread-3) [195f830e] FINISH, MergeVDSCommand, log id: 20f2a1d1
2016-02-02 18:40:47,496 ERROR [org.ovirt.engine.core.bll.MergeCommand] (pool-6-thread-3) [195f830e] Command 'org.ovirt.engine.core.bll.MergeCommand' failed: EngineException: org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException: VDSGenericException: VDSErrorException: Failed to MergeVDS, error = Merge failed, code = 52 (Failed with error mergeErr and code 52)
2016-02-02 18:40:47,547 ERROR [org.ovirt.engine.core.bll.MergeCommand] (pool-6-thread-3) [195f830e] Transaction rolled-back for command 'org.ovirt.engine.core.bll.MergeCommand'.
2016-02-02 18:40:48,326 ERROR [org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand] (DefaultQuartzScheduler_Worker-39) [7342129b] Failed child command status for step 'MERGE'
2016-02-02 18:40:49,389 ERROR [org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand] (DefaultQuartzScheduler_Worker-64) [7342129b] Merging of snapshot '133c508d-b4f7-48cd-9184-ae2cbd48e631' images '76aebca7-0067-470b-b101-5f24fa2bfa4d'..'8f136f80-4008-469a-8d0b-cd0e830c1920' failed. Images have been marked illegal and can no longer be previewed or reverted to. Please retry Live Merge on the snapshot to complete the operation.
2016-02-02 18:40:49,456 INFO  [org.ovirt.engine.core.bll.RemoveSnapshotCommandCallback] (DefaultQuartzScheduler_Worker-64) [719d4e9] All Live Merge child commands have completed, status 'FAILED'
2016-02-02 18:40:50,497 ERROR [org.ovirt.engine.core.bll.RemoveSnapshotCommand] (DefaultQuartzScheduler_Worker-2) [719d4e9] Ending command 'org.ovirt.engine.core.bll.RemoveSnapshotCommand' with failure.
2016-02-02 18:40:50,572 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (DefaultQuartzScheduler_Worker-2) [719d4e9] Correlation ID: 719d4e9, Job ID: 10a1a12d-c74a-49ee-987f-f3750529b4e5, Call Stack: null, Custom Event ID: -1, Message: Failed to delete snapshot 's1' for VM 'cloned'.


From vdsm.log:

jsonrpc.Executor/3::ERROR::2016-02-03 15:53:59,831::vm::4845::virt.vm::(merge) vmId=`a115617b-9295-4429-ad1a-1a03219e46e9`



Version-Release number of selected component (if applicable):
vdsm-4.17.19-0.el7ev.noarch
rhevm-3.6.2.6-0.1.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create vm + 1 disk
2. Copy the disk
3. Remove the original disk
4. Attache the copy disk to the vm
5. Create snapshot
6. Start the vm and live delete the snapshot

Actual results:
Explained above

Expected results:


Additional info:
engine and vdsm logs are attached
** ignore failures related to 'Storage domain does not exist'

Comment 1 Allon Mureinik 2016-02-03 16:34:36 UTC
(In reply to ratamir from comment #0)
> Description of problem:
> * This bug scenario was raised by a customer
Can you include attach the ticket's link for future reference please?

> 
> After copying a disk, the image type of the new image is shared.
> After creating a snapshot with this new image it is impossible to perform
> live snapshot deletion.
A SHARED volume means a template. So a live merge should indeed refuse to merge to a SHARED volume. The bug here, if so, is that copying a disk converts it to SHARED.

Tentatively targeting to 3.6.5
If the above analysis is correct, we should strive to push it in to 3.6.3 too.

Comment 2 Aharon Canan 2016-02-04 08:58:20 UTC
(In reply to Allon Mureinik from comment #1)
> (In reply to ratamir from comment #0)
> > Description of problem:
> > * This bug scenario was raised by a customer
> Can you include attach the ticket's link for future reference please?
> 

Came from ovirt.org, not from customer (GSS) so no ticket here.

> > 
> > After copying a disk, the image type of the new image is shared.
> > After creating a snapshot with this new image it is impossible to perform
> > live snapshot deletion.
> A SHARED volume means a template. So a live merge should indeed refuse to
> merge to a SHARED volume. The bug here, if so, is that copying a disk
> converts it to SHARED.
> 
> Tentatively targeting to 3.6.5
> If the above analysis is correct, we should strive to push it in to 3.6.3
> too.

Comment 3 Raz Tamir 2016-02-04 09:01:41 UTC
Hi Allon,
If "live merge should indeed refuse to merge to a SHARED volume" so the bug should be the copying a disk converts the image volume to shared, because from the copy command, copyVolumeType='SharedVol'

Comment 4 Allon Mureinik 2016-02-04 09:04:00 UTC
(In reply to ratamir from comment #3)
> Hi Allon,
> If "live merge should indeed refuse to merge to a SHARED volume" so the bug
> should be the copying a disk converts the image volume to shared, because
> from the copy command, copyVolumeType='SharedVol'

Yup, agreed. As I stated in comment 1 - "The bug here, if so, is that copying a disk converts it to SHARED."

Comment 5 Gil Klein 2016-02-04 09:19:09 UTC
(In reply to Aharon Canan from comment #2)
> (In reply to Allon Mureinik from comment #1)
> > (In reply to ratamir from comment #0)
> > > Description of problem:
> > > * This bug scenario was raised by a customer
> > Can you include attach the ticket's link for future reference please?
> > 
> 
> Came from ovirt.org, not from customer (GSS) so no ticket here.
>
Link to the email thread is here [1]

[1] http://lists.ovirt.org/pipermail/users/2016-January/thread.html#37577

Comment 6 Elad 2016-02-22 13:11:56 UTC
After disk copy, replaced the attached disk to the copied one, created a snapshot and live merged it. merge succeeded.

2016-02-22 12:37:30,520 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.CopyImageVDSCommand] (org.ovirt.thread.pool-6-thread-24) [2a94a962] START, CopyImageVDSCommand
....
copyVolumeType='LeafVol'


Verified using:
rhevm-3.6.3.2-0.1.el6.noarch
vdsm-4.17.21-0.el7ev.noarch