forked from saltstack-formulas/lvm-formula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pillar.example
402 lines (374 loc) · 8.21 KB
/
pillar.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# vim: sts=2 ts=2 sw= et ai
#
# for legacy pillar support (backward compatibility) see bottom of file
lvm:
pkg: lvm2
group: root
config:
dir:
profiles: /etc/lvm/profile
backups: /etc/lvm/backup
profiles:
remove:
- sillyprofile
create:
thin-generic-autoextend:
activation:
thin_pool_autoextend_threshold: 70
thin_pool_autoextend_percent: 20
files:
#loopbackdir: /tmp/loopdevs #Where to create backing files?
remove:
- /tmp/loopdevs/testfile1.img
- /tmp/loopdevs/testfile2.img
create:
truncate: #Shrink or extend the size of each FILE to the specified size
testfile1.img:
options:
size: 100M
dd: #copy a file, converting and formatting according to the operands
testfile2.img:
options:
if: /dev/urandom
bs: 1024
count: 204800
losetup: #setup loop devices. todo: could be 'list' instead.
testfile1.img:
options:
show: True #This is default anyway
find: True #This is default anyway
testfile2.img: #So specifying options is unnecessary if you prefer.
pv:
create:
/dev/loop0: #hopefully /tmp/loopdevs/testfile1.img
/dev/loop1: #hopefully /tmp/loopdevs/testfile2.img
pv:
remove:
/tmp/loopdevs/loopback1
options:
verbose: True
loopback:
size: 10G
encryption: none
/dev/sdb:
options:
verbose: True
/dev/sdc:
options:
debug: True
/dev/sdd:
/dev/sde:
/dev/sdf:
change:
##Named PV must belong to VG; i.e. PV must be allocatable
/dev/sdd:
options:
addtag: 'goodpvs'
deltag: 'badpvs'
debug: 1
resize:
/dev/sdd:
options:
setphysicalvolumesize: 1G
move:
##(Named LV and) old PV must be in same VG; i.e. PVs must be allocatable
/dev/sdd:
dest: /dev/sde
options:
#name: vg00/lv1
noudevsync: True
create:
/dev/sdb:
/dev/sdc:
options:
verbose: True
/dev/sdd:
/dev/sde:
options:
override: True
dataalignmentoffset: 7s
metadatacopies: 1
metadatasize: 40MiB
/dev/sdf:
vg:
cfgbackup:
vg00:
file: vg00_backup_today
options:
quiet: True
import:
i_do_not_exist:
options:
verbose: True
remove:
vg00:
options:
noudevsync: True
vg_large:
options:
noudevsync: True
change:
vg00:
options:
available: True
syncronize: False
addtag: 'goodvgs'
deltag: 'badvgs'
reduce:
vg00:
devices:
- /dev/sdb
options:
removemissing: True
extend:
vg00:
devices:
- /dev/sdd
options:
restoremissing: True
split:
vg00:
newvg: smallvg
devices:
- /dev/sdf
options:
clustered: n
maxphysicalvolumes: 0
maxlogicalvolumes: 0
merge:
vg00:
withvg: vg001
options:
debug: True
rename:
vg002:
newname: vg2
options:
debug: True
create:
vg00:
devices:
- /dev/sdb
- /dev/sdc
options:
clustered: n
maxlogicalvolumes: 0
maxphysicalvolumes: 0
physicalextentsize: 1024
vg_large:
devices:
- /dev/sdd
- /dev/sde
- /dev/sdf
export:
vg_tmp:
options:
verbose: True
commandprofile: command_profile_template
cfgrestore:
vg00:
file: vg00_backup_today
lv:
remove:
lv_pool1:
vgname: vg_large
lv_pool1_meta:
vgname: vg_large
lvol0:
vgname: vg_large
lvol1:
vgname: vg_large
lvol2:
vgname: vg_large
lvol3:
vgname: vg_large
lvol4:
vgname: vg_large
lvol5:
vgname: vg_large
lvol6:
vgname: vg_large
my_raid1:
vgname: vg_large
options:
force: True
change:
vg00/lv1:
options:
permission: r
activate: n
addtag: 'goodlvs'
deltag: 'badlvs'
reduce:
vg00/lv1:
options:
extents: -2
vg00/lv2:
options:
size: -20MiB
extend:
vg00/lv1:
options:
#extents: +100%PVS
extents: 2
devices:
- /dev/sdf
rename:
vg00/lv11:
vgname: vg00
newname: lvolvo
create:
lv1:
vgname: vg00
size: 200MiB
options:
addtag: 'Coolvolume'
contiguous: y
monitor: y
lv_stripe1:
vgname: vg00
options:
extents: 1
stripes: 2
stripesize: 4096
#following pillars support snapshots: see https://github.com/saltstack/salt/issues/48808
sparse:
vgname: vg00
snapshot: True
sourcelv: lv1
options:
size: 200MiB
lv2_snap:
vgname: vg00
snapshot: True
sourcelv: lv2
options:
size: '+10%ORIGIN'
devices:
- /dev/sdc:0-7
- /dev/sdd:0-7
# untested ...
lv_raid5:
vgname: vg00
size: 5MiB
options:
type: raid5
stripes: 3
stripesize: 64
#lv_raid10_a:
# vgname: vg00
# options:
# type: raid10
# size: 5MiB
# stripes: 2
# mirrors: 1
# data logical volume for thinLV
lv_pool1:
vgname: vg_large
size: 1G
devices:
- /dev/sdd:0-7
# thin metadata logical volume for thinLV
lv_pool1_meta:
vgname: vg_large
size: 50MiB
devices:
- /dev/sdd:0-7
# thin LV
lv_thin1:
vgname: lv_thinpool1
thinvolume: True
size: 50M
options:
virtualsize: 1G
lv_raid10_b:
vgname: vg_large
size: 100MiB
options:
stripes: 2
stripesize: 64
chunksize: 256
thin: True #thinlogicalvolume
thinpool: lv_pool1
virtualsize: 1G
background: True
convert:
##thin pool logical volume
vg_large/lv_thinpool1:
options:
type: thin-pool
##data and metadata LVs in a thin pool are best created on separate physical devices
poolmetadata:
- lv_pool1_meta
- lv_pool1
vg_large/lv_pool1:
options:
type: thin-pool
vg_large/lv_1:
options:
mirrors: 1
mirrorlog: core
devices:
- /dev/sdd:0-15
- /dev/sdd:0-15
vg_large/lv_mirror1:
options:
splitmirrors: 1
name: lv_split
regionsize: 512KB
background: False
interval: 10
noudevsync: False
devices:
- /dev/sde
- /dev/sdf
filesystems:
create:
/dev/vg00/lv1:
options:
type: gfs
options: '-plock_nolock -j 1'
mount: True
onboot: True
onboot_opts:
### LEGACY PILLAR SUPPORT ###
lvm:
lv:
lv1:
name: lv_data1
vgname: vg_data
options:
size: 1g
stripes: 5
stripesize: 8K
thinpool: True
thinvolume: True
lv_data2:
enabled: False # this lv will be removed
vgname: vg_data2
options:
size: 1g
vg:
vg1:
name: vg_data
enabled: True # default True
devices:
- /dev/sdb
- /dev/sdc
options:
physicalextentsize: 1g
vg_data2:
devices:
- /dev/sdd
pv:
pv1:
enabled: True # False to remove it
device: /dev/sdb
options:
setphysicalvolumesize: 2g
/dev/sdc:
enabled: True
options:
whatever_pvcreate_option: value
/dev/sdd:
enabled: True