Checkin of 0.2.98 upstream source
[time-slider.git] / var / svc / manifest / system / filesystem / auto-snapshot.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
3 <!--
4
5  CDDL HEADER START
6
7  The contents of this file are subject to the terms of the
8  Common Development and Distribution License, Version 1.0 only
9  (the "License").  You may not use this file except in compliance
10  with the License.
11
12  You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
13  or http://www.opensolaris.org/os/licensing.
14  See the License for the specific language governing permissions
15  and limitations under the License.
16
17  When distributing Covered Code, include this CDDL HEADER in each
18  file and include the License file at usr/src/OPENSOLARIS.LICENSE.
19  If applicable, add the following below this CDDL HEADER, with the
20  fields enclosed by brackets "[]" replaced with your own identifying
21  information: Portions Copyright [yyyy] [name of copyright owner]
22
23  CDDL HEADER END
24
25  Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
26  Use is subject to license terms.
27
28 -->
29
30 <service_bundle type='manifest' name='SUNWtime-slider'>
31
32 <service
33         name='system/filesystem/zfs/auto-snapshot'
34         type='service'
35         version='0.2.96'>
36
37         <!-- we need time-slider  -->
38         <dependency
39                 name='time-slider'
40                 grouping='require_all'
41                 restart_on='refresh'
42                 type='service'>
43                 <service_fmri value='svc:/application/time-slider' />
44         </dependency>
45
46         <exec_method
47                 type='method'
48                 name='start'
49                 exec=':true'
50                 timeout_seconds='10'>
51         </exec_method>
52
53         <exec_method
54                 type='method'
55                 name='stop'
56                 exec=':true'
57                 timeout_seconds='10'>
58         </exec_method>
59
60         <exec_method
61                 type='method'
62                 name='refresh'
63                 exec=':true'
64                 timeout_seconds='10'>
65         </exec_method>
66
67         <property_group name='startd' type='framework'>
68                 <propval name='duration' type='astring' value='transient' />
69         </property_group>
70
71         <property_group name='general' type='framework'>
72             <propval name='action_authorization' type='astring'
73                 value='solaris.smf.manage.zfs-auto-snapshot' />
74             <propval name='value_authorization' type='astring'
75                 value='solaris.smf.manage.zfs-auto-snapshot' />
76         </property_group>
77
78
79     <!-- The properties we expect that any instance will define:
80
81         interval : minutes | hours | days | months
82
83         period : How many (m,h,d,m) to wait between snapshots
84
85         keep : How many snapshots we should keep, otherwise, we
86                 delete the oldest when we hit this threshold
87          -->
88
89         <property_group name="zfs" type="application">
90           <propval name="interval" type="astring" value="Not set" override="true"/>
91           <propval name="keep" type="astring" value="all" override="true"/>
92         </property_group>
93
94
95         <!-- We now define a set of default instances to take frequent,
96              hourly, daily, weekly and monthly snapshots --> 
97
98
99         <!-- This instance recursively snapshots all
100              filesystems marked with the ZFS User Property 
101              com.sun:auto-snapshot:frequent=true every
102              15 minutes, and keeps 3 of these snapshots into the past.
103         -->
104
105         <instance name='frequent' enabled='false' >
106
107         <property_group name='general' type='framework'>
108                 <propval name='action_authorization' type='astring'
109                 value='solaris.smf.manage.zfs-auto-snapshot' />
110                 <propval name='value_authorization' type='astring'
111                 value='solaris.smf.manage.zfs-auto-snapshot' />
112         </property_group>
113
114         <property_group name="zfs" type="application">
115
116           <propval name="interval" type="astring" value="minutes"
117                    override="true"/>
118           <propval name="period" type="astring" value="15"
119                    override="true"/>
120           <propval name="keep" type="astring" value="3"
121                    override="true"/>
122
123         </property_group>
124
125         </instance>
126
127         <!-- This instance recursively snapshots all
128              filesystems marked with the ZFS User Property 
129              com.sun:auto-snapshot:hourly=true every
130              hour, and keeps 23 of these snapshots into the past.
131         -->
132
133         <instance name='hourly' enabled='false' >
134
135         <property_group name='general' type='framework'>
136                 <propval name='action_authorization' type='astring'
137                 value='solaris.smf.manage.zfs-auto-snapshot' />
138                 <propval name='value_authorization' type='astring'
139                 value='solaris.smf.manage.zfs-auto-snapshot' />
140         </property_group>
141
142         <property_group name="zfs" type="application">
143
144           <propval name="interval" type="astring" value="hours"
145                    override="true"/>
146           <propval name="period" type="astring" value="1"
147                    override="true"/>
148           <propval name="keep" type="astring" value="23"
149                    override="true"/>
150
151         </property_group>
152
153         </instance>
154
155
156         <!-- This instance recursively snapshots all
157              filesystems marked with the ZFS User Property 
158              com.sun:auto-snapshot:daily=true every
159              day, and keeps 6 of these snapshots into the past.
160         -->
161
162         <instance name='daily' enabled='false' >
163
164         <property_group name='general' type='framework'>
165                 <propval name='action_authorization' type='astring'
166                 value='solaris.smf.manage.zfs-auto-snapshot' />
167                 <propval name='value_authorization' type='astring'
168                 value='solaris.smf.manage.zfs-auto-snapshot' />
169         </property_group>
170
171         <property_group name="zfs" type="application">
172
173           <propval name="interval" type="astring" value="days"
174                    override="true"/>
175           <propval name="period" type="astring" value="1"
176                    override="true"/>
177           <propval name="keep" type="astring" value="6"
178                    override="true"/>
179
180         </property_group>
181
182         </instance>
183
184         <!-- This instance recursively snapshots all
185              filesystems marked with the ZFS User Property 
186              com.sun:auto-snapshot:weekly=true every
187              7 days, and keeps 4 of these snapshots into the past.
188         -->
189
190         <instance name='weekly' enabled='false' >
191
192         <property_group name='general' type='framework'>
193                 <propval name='action_authorization' type='astring'
194                 value='solaris.smf.manage.zfs-auto-snapshot' />
195                 <propval name='value_authorization' type='astring'
196                 value='solaris.smf.manage.zfs-auto-snapshot' />
197         </property_group>
198
199         <property_group name="zfs" type="application">
200
201           <propval name="interval" type="astring" value="days"
202                    override="true"/>
203           <propval name="period" type="astring" value="7"
204                    override="true"/>
205           <propval name="keep" type="astring" value="4"
206                    override="true"/>
207
208         </property_group>
209
210         </instance>
211
212
213         <!-- This instance recursively snapshots all
214              filesystems marked with the ZFS User Property 
215              com.sun:auto-snapshot:monthly=true every
216              month, and keeps 12 of these snapshots into the past.
217         -->
218
219         <instance name='monthly' enabled='false' >
220
221         <property_group name='general' type='framework'>
222                 <propval name='action_authorization' type='astring'
223                 value='solaris.smf.manage.zfs-auto-snapshot' />
224                 <propval name='value_authorization' type='astring'
225                 value='solaris.smf.manage.zfs-auto-snapshot' />
226         </property_group>
227
228         <property_group name="zfs" type="application">
229
230           <propval name="interval" type="astring" value="months"
231                    override="true"/>
232           <propval name="period" type="astring" value="1"
233                    override="true"/>
234           <propval name="keep" type="astring" value="12"
235                    override="true"/>
236
237         </property_group>
238
239         </instance>
240
241         <stability value='Unstable' />
242
243         <template>
244                 <common_name>
245                         <loctext xml:lang='C'>ZFS automatic snapshots</loctext>
246                 </common_name>
247                 <description>
248                         <loctext xml:lang='C'>
249 This service provides system configuration for taking automatic snapshots of ZFS
250 filesystems.
251
252 In order to use this service, you must enable the time-slider service plus at least one auto-snapshot
253 instance per set of automatic snapshots you want to take.
254 The time-slider service will manage the creation and destruction of snapshots according to the definitions
255 of each auto-snapshot service instance.
256
257 On stopping the service, time-slider will cease to take snapshots for the specific instance.
258                         </loctext>
259                 </description>
260         </template>
261 </service>
262 </service_bundle>