Management zpool
maintainer: | Jorge Schrauwen <sjorge@blackdot.be> |
---|---|
maturity: | new |
depends: | zpool |
platform: | smartos, illumos, solaris, freebsd, linux |
2016.3.0 新版功能.
oldpool:
zpool.absent:
- export: true
newpool:
zpool.present:
- config:
import: false
force: true
- properties:
comment: salty storage pool
- layout:
mirror-0:
/dev/disk0
/dev/disk1
mirror-1:
/dev/disk2
/dev/disk3
警告
The layout will never be updated, it will only be used at time of creation. It's a whole lot of work to figure out if a devices needs to be detached, removed, ... this is best done by the sysadmin on a case per case basis.
Filesystem properties are also not updated, this should be managed by the zfs state module.
salt.states.zpool.
absent
(name, export=False, force=False)¶ensure storage pool is absent on the system
salt.states.zpool.
present
(name, properties=None, filesystem_properties=None, layout=None, config=None)¶ensure storage pool is present on the system
注解
注解
Because ID's inside the layout dict must be unique they need to have a suffix.
mirror-0:
/tmp/vdisk3
/tmp/vdisk2
mirror-1:
/tmp/vdisk0
/tmp/vdisk1
The above yaml will always result in the following zpool create:
zpool create mypool mirror /tmp/vdisk3 /tmp/vdisk2 mirror /tmp/vdisk0 /tmp/vdisk1
警告
Pay attention to the order of your dict!
mirror-0:
/tmp/vdisk0
/tmp/vdisk1
/tmp/vdisk2:
The above will result in the following zpool create:
zpool create mypool mirror /tmp/vdisk0 /tmp/vdisk1 /tmp/vdisk2
Creating a 3-way mirror! Why you probably expect it to be mirror root vdev with 2 devices + a root vdev of 1 device!