States for managing zpools
maintainer: | Jorge Schrauwen <sjorge@blackdot.be> |
---|---|
maturity: | new |
depends: | salt.utils.zfs, salt.modules.zpool |
platform: | smartos, illumos, solaris, freebsd, linux |
New in version 2016.3.0.
Changed in version 2018.3.1: Big refactor to remove duplicate code, better type converions and improved consistancy in output.
oldpool: zpool.absent: - export: true newpool: zpool.present: - config: import: false force: true - properties: comment: salty storage pool - layout: - mirror: - /dev/disk0 - /dev/disk1 - mirror: - /dev/disk2 - /dev/disk3 partitionpool: zpool.present: - config: import: false force: true - properties: comment: disk partition salty storage pool ashift: '12' feature@lz4_compress: enabled - filesystem_properties: compression: lz4 atime: on relatime: on - layout: - /dev/disk/by-uuid/3e43ce94-77af-4f52-a91b-6cdbb0b0f41b simplepool: zpool.present: - config: import: false force: true - properties: comment: another salty storage pool - layout: - /dev/disk0 - /dev/disk1
Warning
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, etc. 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.
ensure storage pool is absent on the system
ensure storage pool is present on the system
Note
Note
It is no longer needed to give a unique name to each top-level vdev, the old layout format is still supported but no longer recommended.
- mirror: - /tmp/vdisk3 - /tmp/vdisk2 - mirror: - /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
Warning
The legacy format is also still supported but not recommended, 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
Warning
Pay attention to the order of your dict!
- mirror: - /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! While you probably expect it to be mirror root vdev with 2 devices + a root vdev of 1 device!
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.zpool.html