Project

General

Profile

Bug #2005

time-slider zfs-send plugin no working

Added by Johan Postema about 8 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Category:
-
Target version:
-
Start date:
2012-01-20
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

The time-slider zfs-send plugin is not working on oi151a.

(PS: when using time-slider on oi15a you might also be intereseted in: http://illumos.org/issues/1013

I managed to get time-slider/plugin:zfs-send working by digging through the code and solve the issues:

zfssend.py:

- zfssend.py imports time_slider.util, time_slider.smf and time_slider.zfs but the code is actually referring to util.*, smf.* and zfs.* instead of time_slider.util.*, time_slider.smf.*, etc. So either the search path and import should be changed, or "time_slider." should be added before {util,smf,zfs}.*.

- The code will check for a previous snapshot in order to send an incremental stream. The name of the previous send snapshot is stored as a zfs user property, and retrieved with get_user_property(propname). The problem is that this will read a inherited property instead of a local property. So it will either read "-" or a wrong label. It should use get_user_property(propname, True) to get the local instead of the inherited property.

I don't know if there is a place where I can upload or commit te changes I made, but here's a diff:

/usr/share/time-slider/lib/plugin/zfssend/zfssend.py

60,61c60,61
<     cmd = [smf.SVCPROPCMD, "-p", verboseprop, pluginfmri]
<     outdata,errdata = util.run_command(cmd)
---
>     cmd = [time_slider.smf.SVCPROPCMD, "-p", verboseprop, pluginfmri]
>     outdata,errdata = time_slider.util.run_command(cmd)
98c98
<     datasets = zfs.Datasets()
---
>     datasets = time_slider.zfs.Datasets()
110c110
<         snapshot = zfs.Snapshot(snap)
---
>         snapshot = time_slider.zfs.Snapshot(snap)
115c115
<             util.debug("Placing hold on %s" % (snap), verbose)
---
>             time_slider.util.debug("Placing hold on %s" % (snap), verbose)
124,125c124,125
<     cmd = [smf.SVCPROPCMD, "-c", "-p", "receive/command", pluginfmri]
<     outdata,errdata = util.run_command(cmd)
---
>     cmd = [time_slider.smf.SVCPROPCMD, "-c", "-p", "receive/command", pluginfmri]
>     outdata,errdata = time_slider.util.run_command(cmd)
151,152c151,152
<         ds = zfs.ReadableDataset(dataset)
<         prevlabel = ds.get_user_property(propname)
---
>         ds = time_slider.zfs.ReadableDataset(dataset)
>         prevlabel = ds.get_user_property(propname, True)
157,158c157,158
<             sendcmd = [zfs.ZFSCMD, "send", snapname]
<             util.debug("No previous backup registered for %s" % ds.name, verbose)
---
>             sendcmd = [time_slider.zfs.ZFSCMD, "send", snapname]
>             time_slider.util.debug("No previous backup registered for %s" % ds.name, verbose)
163,164c163,164
<             util.debug("Previously sent snapshot: %s" % prevsnapname, verbose)
<             prevsnap = zfs.Snapshot(prevsnapname)
---
>             time_slider.util.debug("Previously sent snapshot: %s" % prevsnapname, verbose)
>             prevsnap = time_slider.zfs.Snapshot(prevsnapname)
166c166
<                 sendcmd = [zfs.ZFSCMD, "send", "-i", prevsnapname, snapname]
---
>                 sendcmd = [time_slider.zfs.ZFSCMD, "send", "-i", prevsnapname, snapname]
183,184c183,184
<         sendcmd.insert(0, smf.PFCMD)
<         recvcmd.insert(0, smf.PFCMD)
---
>         sendcmd.insert(0, time_slider.smf.PFCMD)
>         recvcmd.insert(0, time_slider.smf.PFCMD)
211,213c211,213
<                 util.debug("Releasing hold on %s" % (prevsnapname), verbose)
<                 snapshot = zfs.Snapshot(prevsnapname)
<                 util.debug("Releasing hold on previous snapshot: %s" \
---
>                 time_slider.util.debug("Releasing hold on %s" % (prevsnapname), verbose)
>                 snapshot = time_slider.zfs.Snapshot(prevsnapname)
>                 time_slider.util.debug("Releasing hold on previous snapshot: %s" \
228c228
<         util.debug("Sending of \"%s\"snapshot streams completed" \
---
>         time_slider.util.debug("Sending of \"%s\"snapshot streams completed" \
235c235
<     cmd = [smf.SVCADMCMD, "mark", "maintenance", svcfmri]
---
>     cmd = [time_slider.smf.SVCADMCMD, "mark", "maintenance", svcfmri]

Running OpenIndiana 151a with time-slider;

pkg:,5.11-0.151.1:20110912T022507Z

History

#1

Updated by Johan Postema about 8 years ago

Issue:
zfs-send fails and reports:

Error during snapshot send/receive operation: Receive command ['/usr/bin/pfexec', '/usr/bin/pfexec', '/usr/bin/pfexec', '/usr/bin/pfexec', '/usr/bin/pfexec', '/usr/bin/pfexec', '/usr/bin/pfexec', '/usr/bin/pfexec', '/usr/bin/pfexec', .......

Cause:
zfssend.py everytime inserts "/usr/bin/pfexec" to the sendcmd and recvcmd while this should be done only once.

Fix:
A little bit ugly perhaps, but a quick fix is just to verify whether the PFCMD isn't already inserted.

/usr/share/time-slider/lib/plugin/zfssend/zfssend.py

183,184c183,187
<         sendcmd.insert(0, time_slider.smf.PFCMD)
<         recvcmd.insert(0, time_slider.smf.PFCMD)
---
>       if sendcmd[0] != time_slider.smf.PFCMD: 
>             sendcmd.insert(0, time_slider.smf.PFCMD)
> 
>       if recvcmd[0] != time_slider.smf.PFCMD: 
>             recvcmd.insert(0, time_slider.smf.PFCMD)
#2

Updated by Rich Lowe over 7 years ago

  • Project changed from site to OpenIndiana Distribution
#3

Updated by Ken Mays about 7 years ago

  • Assignee set to OI JDS
#4

Updated by Ken Mays about 7 years ago

  • Status changed from New to Closed
  • Assignee changed from OI JDS to Ken Mays
  • % Done changed from 0 to 100

- pfexec pkg uninstall time-slider 0.2.97
- pfexec pkg install time-slider
0.2.101 (avail upstream)
- restart manifest-import service
- enable time-slider service
- enable snapshot services
- reboot (just to make sure things are working)

#5

Updated by Alexander Pyhalov over 2 years ago

  • Status changed from Closed to In Progress
  • Assignee changed from Ken Mays to Alexander Pyhalov
  • % Done changed from 100 to 90
#6

Updated by Alexander Pyhalov over 2 years ago

  • Status changed from In Progress to Resolved

Also available in: Atom PDF