Parcourir la source

Refactored multipath support

tags/2016.12
Ales Komarek il y a 8 ans
Parent
révision
a634f4ba38
9 fichiers modifiés avec 142 ajouts et 149 suppressions
  1. +76
    -0
      README.rst
  2. +10
    -86
      linux/files/multipath.conf
  3. +0
    -24
      linux/files/multipath.conf.hds
  4. +13
    -0
      linux/files/multipath/_fujitsu_eternus_dxl.conf
  5. +2
    -0
      linux/files/multipath/_hitachi_vsp1000.conf
  6. +15
    -0
      linux/files/multipath/_ibm_storwize.conf
  7. +15
    -4
      linux/map.jinja
  8. +1
    -1
      linux/storage/init.sls
  9. +10
    -34
      linux/storage/multipath.sls

+ 76
- 0
README.rst Voir le fichier

@@ -612,6 +612,82 @@ LVM group `vg1` with one device and `data` volume mounted into `/mnt/data`
size: 40G
mount: ${linux:storage:mount:data}


Multipath with Fujitsu Eternus DXL

.. code-block:: yaml

parameters:
linux:
storage:
multipath:
enabled: true
blacklist_devices:
- /dev/sda
- /dev/sdb
backends:
- fujitsu_eternus_dxl

Multipath with Hitachi VSP 1000

.. code-block:: yaml

parameters:
linux:
storage:
multipath:
enabled: true
blacklist_devices:
- /dev/sda
- /dev/sdb
backends:
- hitachi_vsp1000

Multipath with IBM Storwize

.. code-block:: yaml

parameters:
linux:
storage:
multipath:
enabled: true
blacklist_devices:
- /dev/sda
- /dev/sdb
backends:
- ibm_storwize

Multipath with multiple backends

.. code-block:: yaml

parameters:
linux:
storage:
multipath:
enabled: true
blacklist_devices:
- /dev/sda
- /dev/sdb
- /dev/sdc
- /dev/sdd
backends:
- ibm_storwize
- fujitsu_eternus_dxl
- hitachi_vsp1000

Disabled multipath (the default setup)

.. code-block:: yaml

parameters:
linux:
storage:
multipath:
enabled: false


Usage
=====


+ 10
- 86
linux/files/multipath.conf Voir le fichier

@@ -1,98 +1,22 @@
{%- from "linux/map.jinja" import storage with context %}
##
## This is a template multipath-tools configuration file
## Uncomment the lines relevent to your environment
## This is multipath-tools configuration file managed by Salt
##
{% set backend = storage.get('backend', 'default') %}

{%- if backend in ['hitachi', 'hds', 'HDS'] %}

defaults {
# udev_dir /dev
# polling_interval 10
# selector "round-robin 0"
# path_grouping_policy multibus
# getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
# prio const
# path_checker directio
# rr_min_io 100
# flush_on_last_del no
# max_fds 8192
# rr_weight priorities
# failback immediate
# no_path_retry fail
# queue_without_daemon no
user_friendly_names no
# mode 644
# uid 0
# gid disk
# getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
user_friendly_names no
}

{%- elif backend in ['fujitsu'] %}
defaults {
user_friendly_names no
}
blacklist {
wwid "355cd2e404b76b*"
}
devices {
device {
vendor "FUJITSU"
product "ETERNUS_DXL"
prio alua
path_grouping_policy group_by_prio
path_selector "round-robin 0"
failback immediate
no_path_retry 0
path_checker tur
dev_loss_tmo 2097151
fast_io_fail_tmo 1
}
}

{%- else %}

defaults {
getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
user_friendly_names no
{%- for device in storage.multipath.get('blacklist_devices', []) %}
wwid {{ salt['cmd.run']('/lib/udev/scsi_id -g -u '+device) }}
{%- endfor %}
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st|nbd)[0-9]*"
}

blacklist {
# wwid 26353900f02796769
# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
# devnode "^hd[a-z][[0-9]*]"
# device {
# vendor DEC.*
# product MSA[15]00
# }
#
# POZOR - filtrace vseho krome blacklistovanych veci
#
# wwid "*"
}
blacklist_exceptions {
# devnode "^dasd[c-d]+[0-9]*"
# wwid "IBM.75000000092461.4d00.34"
# wwid 3600507680280050cd000000000000035
# wwid 3600507680280050cd000000000000030
# wwid 3600507680280050cd0000000000000ac
# wwid 3600507680280050cd0000000000003df
wwid "*"
}
devices {
device {
vendor "IBM"
product "2145"
path_grouping_policy group_by_prio
getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
features "1 queue_if_no_path"
prio alua
path_checker tur
failback immediate
no_path_retry "5"
rr_min_io 1
polling_interval 30
dev_loss_tmo 120
}
{%- for backend in storage.multipath.get('backends', []) %}
{%- include "linux/files/multipath/_" + backend + ".conf" %}
{%- endfor %}
}
{%- endif %}

+ 0
- 24
linux/files/multipath.conf.hds Voir le fichier

@@ -1,24 +0,0 @@
##
## This is a template multipath-tools configuration file
## Uncomment the lines relevent to your environment
##
defaults {
# udev_dir /dev
# polling_interval 10
# selector "round-robin 0"
# path_grouping_policy multibus
# getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
# prio const
# path_checker directio
# rr_min_io 100
# flush_on_last_del no
# max_fds 8192
# rr_weight priorities
# failback immediate
# no_path_retry fail
# queue_without_daemon no
user_friendly_names no
# mode 644
# uid 0
# gid disk
}

+ 13
- 0
linux/files/multipath/_fujitsu_eternus_dxl.conf Voir le fichier

@@ -0,0 +1,13 @@

device {
vendor "FUJITSU"
product "ETERNUS_DXL"
prio alua
path_grouping_policy group_by_prio
path_selector "round-robin 0"
failback immediate
no_path_retry 0 (*1)
path_checker tur
dev_loss_tmo 2097151 (*2)
fast_io_fail_tmo 1
}

+ 2
- 0
linux/files/multipath/_hitachi_vsp1000.conf Voir le fichier

@@ -0,0 +1,2 @@

# vsp1000 does not have special device config

+ 15
- 0
linux/files/multipath/_ibm_storwize.conf Voir le fichier

@@ -0,0 +1,15 @@

device {
vendor "IBM"
product "2145"
path_grouping_policy group_by_prio
getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
features "1 queue_if_no_path"
prio alua
path_checker tur
failback immediate
no_path_retry "5"
rr_min_io 1
polling_interval 30
dev_loss_tmo 120
}

+ 15
- 4
linux/map.jinja Voir le fichier

@@ -117,20 +117,31 @@
'mount': {},
'swap': {},
'lvm': {},
'multipath': False,
'multipath': {
'enabled': False,
'pkgs': ['multipath-tools', 'multipath-tools-boot'],
'service': ''
},
},
'Debian': {
'mount': {},
'swap': {},
'lvm': {},
'multipath': False,
'multipath_pkgs': ['multipath-tools'],
'multipath': {
'enabled': False,
'pkgs': ['multipath-tools', 'multipath-tools-boot'],
'service': 'multipath-tools'
},
'lvm_pkgs': ['lvm2'],
},
'RedHat': {
'mount': {},
'swap': {},
'lvm': {},
'multipath': False,
'multipath': {
'enabled': False,
'pkgs': [],
'service': 'multipath'
},
},
}, grain='os_family', merge=salt['pillar.get']('linux:storage')) %}

+ 1
- 1
linux/storage/init.sls Voir le fichier

@@ -10,7 +10,7 @@ include:
{%- if storage.lvm|length > 0 %}
- linux.storage.lvm
{%- endif %}
{%- if storage.multipath %}
{%- if storage.multipath.enabled %}
- linux.storage.multipath
{%- endif %}
{%- endif %}

+ 10
- 34
linux/storage/multipath.sls Voir le fichier

@@ -1,48 +1,24 @@
{%- from "linux/map.jinja" import storage with context %}
{%- if storage.enabled %}
{%- if storage.enabled and storage.multipath.enabled %}

{%- if grains.os_family == 'Debian' %}

linux_multipath_pkgs:
pkg.installed:
- names: {{ storage.multipath_pkgs }}

{%- if storage.multipath.backend not in ['fujitsu'] %}

linux_multipath_boot_pkg:
linux_storage_multipath_packages:
pkg.installed:
- name: multipath-tools-boot

{%- endif %}

{%- if storage.multipath.backend == 'HDS' %}

/etc/multipath.conf:
file.managed:
- source: salt://linux/files/multipath.conf.hds
- template: jinja
- require:
- pkg: linux_multipath_pkgs

{%- else %}
- names: {{ storage.multipath.pkgs }}

/etc/multipath.conf:
linux_storage_multipath_config:
file.managed:
- name: /etc/multipath.conf
- source: salt://linux/files/multipath.conf
- template: jinja
- require:
- pkg: linux_multipath_pkgs
- pkg: linux_storage_multipath_packages

{%- endif %}

multipath_service:
linux_storage_multipath_service:
service.running:
- enable: True
- name: multipath-tools
- enable: true
- name: {{ storage.multipath.service }}
- watch:
- file: /etc/multipath.conf
- file: linux_storage_multipath_config
- sig: multipathd

{%- endif %}

{%- endif %}

Chargement…
Annuler
Enregistrer