I hit the wrong button when moderating the post to zfs-auto-snapshot@ mailing list. I'm forwarding the original mail from Brandon below.
Summarising Brandon's questions: * how to best create SMF instances on an existing service * why are there permission errors when running a new instance created via svccfg export * how to get existing snapshots to the receiving pool I usually add SMF instances using 'svccfg -s <service> add myinstance' Looking at the errors, it looks like SMF isn't exporting the values for action_authorization or value_authorization in the SMF manifest it produces, resulting the service not being allowed to set values in svccfg when it runs as 'zfssnap'. Have a look at /var/svc/manifest/system/filesystem/auto-snapshot.xml and read smf_security(5) for more on those properties. Finally, the service will only send/recv snapshots that it has created itself, rather than any existing snapshots - the auto-snapshots will reference all current data, but won't have the history contained in those other snapshots. You could seed the backup pool with existing snapshots using a manual zfs send -R, and then continue with incremental snapshots using zfs-auto-snapshot. cheers, tim -------- Forwarded Message -------- From: Brandon High <bh...@freaks.com> To: ZFS discuss <zfs-discuss@opensolaris.org>, zfs-auto-snapshot <zfs-auto-snaps...@opensolaris.org> Subject: Using zfs-auto-snapshot for automatic backups Date: Mon, 08 Mar 2010 13:16:02 +0000 The recent discussion of backing up ZFS got me thinking about using the auto snapshot service to do backups. My current method of doing backups is to send / recv the data pool to external USB devices, but I haven't been doing backups of the rpool. I think that doing a send to the data pool, which will then get backed up to USB is probably fine. I'm a bit new to smf, so chances are that I did this wrong. I did: # svccfg export zfs/auto-snapshot > snap-manifest.xml I edited the file and added a new instance called rpool-backup with the following save command: <propval name='backup-save-cmd' type='astring' value='/usr/sbin/zfs recv -du -F tank/rpool'/> I imported it via svccfg and verified that it was listed in svcs: # svccfg import -V snap-manifest.xml # svcs auto-snapshot:rpool-backup disabled 4:13:15 svc:/system/filesystem/zfs/auto-snapshot:rpool-backup # zfs create tank/rpool # zfs set compress=on tank/rpool # zfs allow -u zfssnap receive,mount,create tank/rpool # svcadm enable auto-snapshot:rpool-backup I enabled the new instance and checked the log file, which contained: Last snapshot for svc:/system/filesystem/zfs/auto-snapshot:rpool-backup taken on [ no snapshot taken yet ] which was greater than the 1 days schedule. Taking snapshot now. svccfg: Permission denied. svcadm: svc:/system/filesystem/zfs/auto-snapshot:rpool-backup: Permission denied. Previous snap not found of rpool, taking full backup. My questions are: - There must be an easier way to add or modify an instance in smf, right? If so, how? - What is causing the various permission denied errors from svccfg and svcadm? - zfs-auto-snap isn't sending any of the existing snapshots to the target, so it's not really a full backup. Did I miss something when I created the smf instance? -B _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss