Managing volumes
Running out of disk space and having to provision new storage is something that cannot be overlooked in infrastructure management. To make this process simpler, volume management was introduced. Although there are a lot of proprietary products out there to do this job, the default Linux volume management tool or LVM, is an excellent choice to get started, and lot of critical production infrastructure relies on this tool. Salt makes configuring LVM much easier with its lvm
module.
How to do it...
We will use the minion backup server from the recipe SSH authentication tasks earlier in this chapter. Make sure that the minion has two new identical disks called /dev/sdb
and /dev/sdc
(these can be different based on host architecture and platform).
Create a new state directory in the staging environment called
lvm
.Create and edit
/opt/salt-cookbook/staging/lvm/init.sls
to have the following entries:/dev/sdb: lvm.pv_present /dev/sdc: lvm.pv_present backup_vg: lvm.vg_present...