mgrzybek / ansible-ha-storage Goto Github PK
View Code? Open in Web Editor NEWAnsible role to bootstrap LVM and ZFS storage resources and manage them using corosync / pacemaker.
Ansible role to bootstrap LVM and ZFS storage resources and manage them using corosync / pacemaker.
In order to append resources to tho storage group we need to run cluster commands to create them.
It could be easier to let the role create them for us. For example, they could be directly written in the crm script
.
Before:
vars:
ha_storage:
openrc: /etc/openrc.sh
cinder_volumes:
- 55659db9-1bea-46e1-a894-4b257be72bdd
- 548ef897-32b6-4331-99b7-4823ac6680cd
volume_group: db
filesystems:
- lv: data
size: 20G
fstype: xfs
mountpoint: /srv/data
append_resources:
- name: pgsql
After:
vars:
ha_storage:
openrc: /etc/openrc.sh
cinder_volumes:
- 55659db9-1bea-46e1-a894-4b257be72bdd
- 548ef897-32b6-4331-99b7-4823ac6680cd
volume_group: db
filesystems:
- lv: data
size: 20G
fstype: xfs
mountpoint: /srv/data
append_resources:
- name: postgresql-service
type: docker
params:
- allow_pull=true
- image=postgresql:11
- run_opts="-v /srv/data:/data"
When only one device is used to create a volume group / pool, it is possible to deal with exclusiveness using sfex.
In order to use this mechanism, we need to sub-divide the given device:
Moreover, we need some OS-related aspects and configuration:
For instance, you can only deploy one volume group per play. So as to deploy several volume groups, a list of properties should be given, such as:
# Global parameters
ha_storage_global:
use_sfex_ra_github: true
http_proxy: http://proxy.local
# Volume groups
ha_storage_volume_groups:
# First volume group
- volume_group: test
fs: zfs
zpool_mountpoint: /srv
use_clvm: false
use_sfex: true
cluster_attribute_name: role
cluster_attribute_value: cache
luns:
- id: /dev/disk/by-id/ata-VBOX_HARDDISK_VB60e589c7-a5211949
alias: lun-dc-1
filesystems:
- lv: log
size: 2G
fstype: xfs
mountpoint: /srv/log
- lv: cache
size: 2G
fstype: xfs
mountpoint: /srv/squid
# Another volume group
- volume_group: db
fs: zfs
zpool_mountpoint: /srv
cluster_attribute_name: role
cluster_attribute_value: database
luns:
- id: /dev/vdb
alias: lun-dc-1
- id: /dev/vdc
alias: lun-dc-2
filesystems:
- lv: data
size: 20GB
mountpoint: data
- lv: xlog
size: 2GB
mountpoint: xlog
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.