Bug 1321018 - The snapshot disk links are not removed after deleted.
Summary: The snapshot disk links are not removed after deleted.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: vdsm
Classification: oVirt
Component: Core
Version: 4.17.23
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ovirt-4.0.6
: 4.18.16
Assignee: Ala Hino
QA Contact: Kevin Alon Goldblatt
URL:
Whiteboard:
Depends On: 1399688
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-24 13:53 UTC by Marcelo Leandro
Modified: 2017-01-18 07:24 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-18 07:24:39 UTC
oVirt Team: Storage
Embargoed:
ykaul: ovirt-4.0.z?
rule-engine: planning_ack?
tnisan: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)
Ovirt.log and vdsm.log (123.46 KB, application/x-xz)
2016-03-24 13:53 UTC, Marcelo Leandro
no flags Details
server, vdsm, engine.log (1.36 MB, application/x-gzip)
2016-11-24 16:21 UTC, Kevin Alon Goldblatt
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 59725 0 master MERGED Live Merge: Remove volume run link after live merge 2016-09-29 21:30:33 UTC
oVirt gerrit 64986 0 ovirt-4.0 MERGED Live Merge: Remove volume run link after live merge 2016-10-10 13:42:23 UTC

Description Marcelo Leandro 2016-03-24 13:53:34 UTC
Created attachment 1139977 [details]
Ovirt.log and vdsm.log

Description of problem:
The snapshot disk is not removed after completion of the merge.

Steps to Reproduce:
1.Create snapshot
2.Delete snapshot

Actual results:
The disk continues to exist after the merge, being deleted after the host reboot and not removing links.

Expected results:
The disk must be removed after the merge snapshot

Additional info:

"According to the log attached (vdsm.log.5):
The lv not deactivate after the merge
Therefore the link /dev/vgname/lvname is not deleted
The link at /rhve/datacenter/ no deleted
The link at /run/vdsm/storage no deleted

The links under /run/vdsm/storage and /rhev/data-center should will
be deleted when hotunpluging this disk, or when stopping the vm. "

Comment 1 Ala Hino 2016-04-03 10:58:31 UTC
Hi Marcelo,

I am not sure I understand the issue you encounter.

Basically, when removing a snapshot the disk is not removed. 
Speaking of links, when creating a new snapshot, and new dir <image_guid> is created under:
/rhev/datasenter/<storage_pool_id>/<storage_domain_id>/images/<image_group_id>
And when deleting the snapshot, the dir is removed.

I am not sure I can see the link between deleting a snapshot and hotunpluging a disk.

Please elaborate.

Comment 2 Marcelo Leandro 2016-04-05 14:55:41 UTC
Hello,
Please check the link:
https://www.mail-archive.com/users@ovirt.org/msg31588.html
The observation was cited by Nir Soffer(In reply to Ala Hino from comment #1)

> Hi Marcelo,
> 
> I am not sure I understand the issue you encounter.
> 
> Basically, when removing a snapshot the disk is not removed. 
> Speaking of links, when creating a new snapshot, and new dir <image_guid> is
> created under:
> /rhev/datasenter/<storage_pool_id>/<storage_domain_id>/images/
> <image_group_id>
> And when deleting the snapshot, the dir is removed.
> 
> I am not sure I can see the link between deleting a snapshot and
> hotunpluging a disk.
> 
> Please elaborate.

Comment 3 Allon Mureinik 2016-04-14 08:59:53 UTC
The relevant part of the email:

===
According to the log you attached (vdsm.log.5):
- we do not deactivate the lv after the merge
- therefore the link /dev/vgname/lvname is not deleted
- we don't delete the link at /rhev/data-center
- we don't delete the links at /run/vdsm/storage

The links under /run/vdsm/storage and /rhev/data-center should will
be deleted when hotunpluging this disk, or when stopping the vm.

Please file a ovirt/vdsm bug for this and include the information
from this thread.
===

Nothing urgent here, pushing out of the z-stream.

Comment 4 Sandro Bonazzola 2016-05-02 10:00:04 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 5 Ala Hino 2016-05-04 08:10:38 UTC
All info related to this BZ was provide. No immediate action item

Comment 6 Yaniv Lavi 2016-05-23 13:16:27 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 7 Yaniv Lavi 2016-05-23 13:20:16 UTC
oVirt 4.0 beta has been released, moving to RC milestone.

Comment 10 Kevin Alon Goldblatt 2016-11-20 17:10:10 UTC
Verified with the following code:
----------------------------------------------
vdsm-4.18.999-759.git435a852.el7.centos.x86_64
rhevm-4.0.6-0.1.el7ev.noarch


Verifided with the following scenario:
----------------------------------------------
Steps to Reproduce:
1.Create snapshot
2.Delete snapshot

The snapshot link in /rhev/data-center is STILL NOT REMOVED 
The lv IS NOW deactivate after the merge

Expected results: 
The link must be removed after the merge snapshot

Comment 11 Red Hat Bugzilla Rules Engine 2016-11-20 17:10:16 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 12 Ala Hino 2016-11-21 20:31:44 UTC
Kevin,

How many hosts do you have at your setup?
Where does the VM run - SPM or 'normal' host?
If there are two or more hosts, could you please verify behavior on SPM and 'normal' host?

Can you please show the links before and after the merge?

Comment 13 Kevin Alon Goldblatt 2016-11-24 16:19:30 UTC
(In reply to Ala Hino from comment #12)
> Kevin,
> 
> How many hosts do you have at your setup?
3 hosts 

> Where does the VM run - SPM or 'normal' host?
Fist SPM and all works fine, then on HSM and delete HANGS

> If there are two or more hosts, could you please verify behavior on SPM and
> 'normal' host?
> 
> Can you please show the links before and after the merge?

Scenario:
---------------
Create vm with disk on SPM and run
Create snapshot
Delete snapshot - snapshot link is deleted in /rhev/data-center
Stop vm
Start the vm on HSM
Create a new snapshot
Delete the snapshot - snapshot remains LOCKED and snapshot link is NOT deleted in /rhev/data-center





SPM
Before
├── 2df48dca-c4d1-431d-81e6-08676f7a469f
    │   │       │   └── a0a14c70-2b3b-453d-a94d-9da790b7f036 -> /dev/38b9ece5-6e9b-47c8-8f4c-3edc3e20d72e/a0a14c70-2b3b-453d-a94d-9da790b7f036


With snapshots
├── 2df48dca-c4d1-431d-81e6-08676f7a469f
    │   │       │   ├── 79463314-d607-4f93-82e9-372c84697c1f -> /dev/38b9ece5-6e9b-47c8-8f4c-3edc3e20d72e/79463314-d607-4f93-82e9-372c84697c1f
    │   │       │   └── a0a14c70-2b3b-453d-a94d-9da790b7f036 -> /dev/38b9ece5-6e9b-47c8-8f4c-3edc3e20d72e/a0a14c70-2b3b-453d-a94d-9da790b7f036



After deleting snapshot
├── 2df48dca-c4d1-431d-81e6-08676f7a469f
    │   │       │   └── a0a14c70-2b3b-453d-a94d-9da790b7f036 -> /dev/38b9ece5-6e9b-47c8-8f4c-3edc3e20d72e/a0a14c70-2b3b-453d-a94d-9da790b7f036



HSM
Before
├── 2df48dca-c4d1-431d-81e6-08676f7a469f
    │   │       │   ├── 1ac5ad49-3e63-454a-954b-6f074acd4ed6 -> /dev/38b9ece5-6e9b-47c8-8f4c-3edc3e20d72e/1ac5ad49-3e63-454a-954b-6f074acd4ed6


With snapshots
├── 2df48dca-c4d1-431d-81e6-08676f7a469f
    │   │       │   ├── 1ac5ad49-3e63-454a-954b-6f074acd4ed6 -> /dev/38b9ece5-6e9b-47c8-8f4c-3edc3e20d72e/1ac5ad49-3e63-454a-954b-6f074acd4ed6
    │   │       │   └── a0a14c70-2b3b-453d-a94d-9da790b7f036 -> /dev/38b9ece5-6e9b-47c8-8f4c-3edc3e20d72e/a0a14c70-2b3b-453d-a94d-9da790b7f036


After deleting snapshots
 ├── 2df48dca-c4d1-431d-81e6-08676f7a469f
    │   │       │   ├── 1ac5ad49-3e63-454a-954b-6f074acd4ed6 -> /dev/38b9ece5-6e9b-47c8-8f4c-3edc3e20d72e/1ac5ad49-3e63-454a-954b-6f074acd4ed6
    │   │       │   └── a0a14c70-2b3b-453d-a94d-9da790b7f036 -> /dev/38b9ece5-6e9b-47c8-8f4c-3edc3e20d72e/a0a14c70-2b3b-453d-a94d-9da790b7f036  SHOULD HAVE BEEN DELETED



From engine.log
-----------------------------------------------------------------
2016-11-24 16:42:40,181 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-12) [] Correlation ID: 5e2a8d2d, Job ID: f03fe7bf-9e3a-433b-8356-8c11d6bd9
cb1, Call Stack: null, Custom Event ID: -1, Message: Snapshot 'snapper1' deletion for VM 'bbbb' was initiated by admin@internal-authz.
2016-11-24 16:42:40,184 INFO  [org.ovirt.engine.core.bll.storage.disk.RemoveDiskCommand] (pool-5-thread-3) [21f25490] Running command: RemoveDiskCommand internal: true. Entities affected : 
 ID: aab7e02f-229f-4bf3-8942-634858e873f5 Type: DiskAction group DELETE_DISK with role type USER
2016-11-24 16:42:40,191 INFO  [org.ovirt.engine.core.bll.storage.disk.image.RemoveImageCommand] (pool-5-thread-3) [7ea6c4ea] Running command: RemoveImageCommand internal: true. Entities aff
ected :  ID: 38b9ece5-6e9b-47c8-8f4c-3edc3e20d72e Type: Storage
2016-11-24 16:42:40,228 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DeleteImageGroupVDSCommand] (pool-5-thread-3) [7ea6c4ea] START, DeleteImageGroupVDSCommand( DeleteImageGroupVDSComma
ndParameters:{runAsync='true', storagePoolId='f30058ff-5799-45b2-a272-22b2d198aa16', ignoreFailoverLimit='false', storageDomainId='38b9ece5-6e9b-47c8-8f4c-3edc3e20d72e', imageGroupId='aab7e
02f-229f-4bf3-8942-634858e873f5', postZeros='false', forceDelete='false'}), log id: 223961f5


From vdsm.log on HSM

Comment 14 Kevin Alon Goldblatt 2016-11-24 16:21:48 UTC
Created attachment 1223930 [details]
server, vdsm, engine.log

Adding logs

Comment 15 Ala Hino 2016-11-28 14:31:16 UTC
Kevin,

If the delete hangs, the snapshot will not be deleted and the links, for sure, will not be deleted. The fact that the deletion hangs might be a different issue. The original issue is about a deletion that *succeeded* and after it completed, the links weren't removed.

Let's please try to reproduce the same issue.
I'd suggest that you create two VMs, force one to run on SPM and the other to run on "HSM". Then, create a snapshot and delete it.

To verify this issue, deletion of the snapshot *must* be succeeded; otherwise, this won't be a valid verification for this issue.

Comment 16 Kevin Alon Goldblatt 2016-11-29 14:47:00 UTC
(In reply to Ala Hino from comment #15)
> Kevin,
> 
> If the delete hangs, the snapshot will not be deleted and the links, for
> sure, will not be deleted. The fact that the deletion hangs might be a
> different issue. The original issue is about a deletion that *succeeded* and
> after it completed, the links weren't removed.
> 
> Let's please try to reproduce the same issue.
> I'd suggest that you create two VMs, force one to run on SPM and the other
> to run on "HSM". Then, create a snapshot and delete it.
> 
> To verify this issue, deletion of the snapshot *must* be succeeded;
> otherwise, this won't be a valid verification for this issue.

The delete snapshot succeeds when running the vm on the SPM
The delete snapshot hangs every time when running the vm on the HSM
Submitting new defect and moving this to ON_QA and depends_on

Comment 17 Kevin Alon Goldblatt 2016-11-30 14:12:33 UTC
When deleting the snapshot from the VM running on the SPM the links are removed

Submitting a new defect for deleting the snapshots when running the VM on the HSM 


Moving to VERIFIED!


Note You need to log in before you can comment on or make changes to this bug.