Bug 1048122

Summary: [SNAPSHOT] : gluster snapshot delete doesnt provide option to delete all / multiple snaps of a given volume
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Rahul Hinduja <rhinduja>
Component: snapshotAssignee: Nagaprasad Sathyanarayana <nsathyan>
Status: CLOSED ERRATA QA Contact: Rahul Hinduja <rhinduja>
Severity: medium Docs Contact:
Priority: low    
Version: rhgs-3.0CC: asengupt, asrivast, bmohanra, mzywusko, nsathyan, rhs-bugs, rjoseph, sdharane, senaik, smohan, storage-qa-internal, vagarwal
Target Milestone: ---Keywords: FutureFeature
Target Release: RHGS 3.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: SNAPSHOT
Fixed In Version: glusterfs-3.7.0-3.el6rhs Doc Type: Enhancement
Doc Text:
Previously, the snapshot delete command had to be executed multiple times to delete more than one snapshot. Two new commands are now introduced that can be used to delete multiple snapshots. To delete all the snapshots present in a system, execute the following command: # gluster snapshot delete all To delete all the snapshot present in a specified volume, execute the following command: # gluster snapshot delete volume <volname>
Story Points: ---
Clone Of:
: 1112613 (view as bug list) Environment:
Last Closed: 2015-07-29 04:33:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1112613, 1145083, 1202842, 1223636    

Description Rahul Hinduja 2014-01-03 09:04:34 UTC
Description of problem:
=======================

With current implementation of gluster snapshot delete, we do not have a wayout to delete all or multiple snaps of a given volume 

[root@snapshot-09 ~]# gluster snapshot delete 
Usage: snapshot delete (<volname> -s <snapname> | -c <cgname>)
[root@snapshot-09 ~]#

For user feasibility it is must have option to delete multiple snaps in one short or/and delete all snaps in one short.

For example:

1. The below cli should have deleted snap2 and snap3 for a given volume, but it deletes only one snap2. 

[root@snapshot-09 ~]# gluster snapshot delete vol-snap0 -s snap2 snap3
snapshot delete: snap2: snap removed successfully
[root@snapshot-09 ~]# 
 
2. With below set of commands their is no way that all snaps of a given volume be deleted

[root@snapshot-09 ~]# gluster snapshot delete vol-snap0 
Usage: snapshot delete (<volname> -s <snapname> | -c <cgname>)
[root@snapshot-09 ~]# gluster snapshot delete vol-snap0 all
Usage: snapshot delete (<volname> -s <snapname> | -c <cgname>)
[root@snapshot-09 ~]# gluster snapshot delete vol-snap0 -s 
Usage: snapshot delete (<volname> -s <snapname> | -c <cgname>)
[root@snapshot-09 ~]# gluster snapshot delete vol-snap0 -s all
snapshot remove: failed: snap all is not found
Snapshot command failed
[root@snapshot-09 ~]# 


It is debatable how we need to tackle this but it is must have as we have 256 default snapshot for any given volume and deleting them individually is not user friendly


Version-Release number of selected component (if applicable):
=============================================================

glusterfs-3.4.0.snap.dec30.2013git-1.el6.x86_64

Comment 2 Vijaikumar Mallikarjuna 2014-01-09 09:13:07 UTC
Patch posted: http://review.gluster.org/#/c/6673/

Comment 4 rjoseph 2014-03-25 09:02:51 UTC
With the new cli support for deleting multiple snaps in multiple volumes are not provided.
We will consider this bug in the next release

Comment 5 Nagaprasad Sathyanarayana 2014-04-21 06:18:14 UTC
Marking snapshot BZs to RHS 3.0.

Comment 6 Nagaprasad Sathyanarayana 2014-05-19 10:56:18 UTC
Setting flags required to add BZs to RHS 3.0 Errata

Comment 8 Vijaikumar Mallikarjuna 2014-05-30 08:14:04 UTC
See comment #4.

Comment 10 Sachin Pandit 2014-07-28 04:04:08 UTC
http://review.gluster.org/#/c/8162/ is merged upstream. However as this
bug doesn't contain any blocker flags, I will not send the relevant patch
downstream until the Denail release.

Comment 12 senaik 2015-06-11 10:09:11 UTC
Version :glusterfs 3.7.1 built on Jun  9 2015
======== 

Deleting all snapshots part of a volume:
========================================
gluster snapshot delete volume vol0
Volume (vol0) contains 2 snapshot(s).
Do you still want to continue and delete them?  (y/n) y
snapshot delete: S1_GMT-2015.06.11-09.16.17: snap removed successfully
snapshot delete: S2_GMT-2015.06.11-09.17.23: snap removed successfully

Deleting all snapshots present in the system :
=============================================
[root@inception ~]# gluster snapshot delete all 
System contains 80 snapshot(s).
Do you still want to continue and delete them?  (y/n) y
snapshot delete: Scheduled-Job1-vol0_GMT-2015.06.10-13.30.01: snap removed successfully
snapshot delete: Scheduled-Job2-vol1_GMT-2015.06.10-13.30.01: snap removed successfully
snapshot delete: Scheduled-Job2-vol1_GMT-2015.06.10-14.00.01: snap removed successfully

Marking the bug as 'Verified'

Comment 13 Bhavana 2015-07-15 05:47:54 UTC
Hi Sachin,

The doc text is updated. Please review the same and share your technical review comments. If it looks ok, then sign-off on the same.

Regards,
Bhavana

Comment 14 Sachin Pandit 2015-07-15 06:00:15 UTC
Hi Bhavana,

The coc text looks good to me.

Thanks,
Sachin.

Comment 15 Sachin Pandit 2015-07-15 06:01:14 UTC
Sorry for the typo.

====================
Hi Bhavana,

The doc text looks good to me.

Thanks,
Sachin.

Comment 18 errata-xmlrpc 2015-07-29 04:33:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-1495.html