Opened 8 months ago

Closed 5 months ago

#1062 closed Feature Request (fixed)

Add comment or snapshot description field to warden zfsmksnap function

Reported by: srf21c Owned by: kris
Priority: minor Milestone:
Component: PBI System Version: 10.1-RELEASE
Keywords: warden, snapshot Cc: trac-bugs@…

Description

This feature request is inspired by similar functionality in the btrfs snapper utility. http://snapper.io/

If you run the command "snapper list" on a btrfs enabled linux system, you'll get a table like the one below includes a description field towards the right.

# snapper list

Type | # | Pre # | Date | User | Cleanup | Description | Userdata
single | 0 | | | root | | current |
single | 1 | | Sat Feb 15 11:01:07 2014 | root | timeline | timeline |
single | 184 | | Sun Mar 2 18:01:02 2014 | root | timeline | timeline |
single | 185 | | Sun Mar 2 19:01:01 2014 | root | timeline | timeline |
single | 186 | | Sun Mar 2 19:19:33 2014 | root | | added new website |
single | 187 | | Sun Mar 2 20:01:03 2014 | root | timeline | timeline |
single | 188 | | Sun Mar 2 21:01:02 2014 | root | timeline | timeline |

Note snapshot number 186 with the "added new website" comment. This is a snapshot that was created as a one-off and tagged with a custom description. All the other snapshots were automatically created by snapper's timeline feature.

The ability to tag a snapshot with a comment is very useful for associating certain snapshots with certain changes made to the system.

Currently the "warden zfslistsnap myjail" command lists only the snapshot date and time. This makes it more cumbersome than the snapper utility to associate specific snapshots with specific system changes.

I might look at the time and date of a warden zfs jail snapshot and be hard pressed to remember if that was before or having making a certain system change. If I have the ability to explicitly note "this snapshot made before updating apache" then I know exactly which snapshot to rollback to in order to undo the apache upgrade.

The snapper syntax to add a description to a snapshot is "snapper create -d "pre-test-repo".

Something similar could be extended to the warden syntax like;

warden zfsmksnap myjail -d "snapshot description comment here"

Then when the "warden zfslistsnap myjail" command is issues, the output could look something like

2014-02-27-01-03-59 upgraded mysql
2014-03-04-15-01-28 added user bob
2014-03-04-15-26-35 deleted temporary files from web subdir

Change History (3)

comment:1 Changed 8 months ago by srf21c

Can an admin please change the category of this ticket from a system defect to a feature request? I accidentally missed that setting when submitting the ticket, thanks.

comment:2 Changed 7 months ago by joshms

  • Owner set to kris
  • Type changed from System Defect to Feature Request

comment:3 Changed 5 months ago by kris

  • Resolution set to fixed
  • Status changed from new to closed

That's a really cool idea, I've added it to both Warden and Life-Preserver now. (The backends anyway, still gotta add it to GUI)

https://github.com/pcbsd/pcbsd/commit/cca8f57b2fecf4c80db306b7917211874b35820d

Note: See TracTickets for help on using tickets.