From 2739f348f326e7240192b9e07fa231bd358b62aa Mon Sep 17 00:00:00 2001 From: Stephen Mulcahy Date: Tue, 29 Jul 2014 17:26:00 +0100 Subject: [PATCH] Add new multipath element Provide an element that provides multipath support allowing a user to configure multiple I/O paths to storage devices. Typically used with SAN storage arrays. Change-Id: I2f970399109b1396c25cb6e2ef2906310d04c5f8 --- elements/multipath/README.md | 11 +++++++++++ elements/multipath/files/multipath.conf | 3 +++ elements/multipath/install.d/90-multipath | 23 +++++++++++++++++++++++ elements/multipath/pkg-map | 10 ++++++++++ 4 files changed, 47 insertions(+) create mode 100644 elements/multipath/README.md create mode 100644 elements/multipath/files/multipath.conf create mode 100755 elements/multipath/install.d/90-multipath create mode 100644 elements/multipath/pkg-map diff --git a/elements/multipath/README.md b/elements/multipath/README.md new file mode 100644 index 000000000..0dce2fdb9 --- /dev/null +++ b/elements/multipath/README.md @@ -0,0 +1,11 @@ +Add multipath-tools to built images +=================================== + +This element adds multipath-tools to the image. These tools manage the kernel +device mapper based multipath support. + +See [multipath-tools](http://christophe.varoqui.free.fr/) for more information. + +This element installs multipath with a default configuration that disables +multipath for all block devices. The user can then customise the config to suit +their environment. diff --git a/elements/multipath/files/multipath.conf b/elements/multipath/files/multipath.conf new file mode 100644 index 000000000..a1b481bef --- /dev/null +++ b/elements/multipath/files/multipath.conf @@ -0,0 +1,3 @@ +blacklist { + devnode "*" +} diff --git a/elements/multipath/install.d/90-multipath b/elements/multipath/install.d/90-multipath new file mode 100755 index 000000000..3468ad114 --- /dev/null +++ b/elements/multipath/install.d/90-multipath @@ -0,0 +1,23 @@ +#!/bin/bash +# Copyright 2014 Hewlett-Packard Development Company, L.P. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +set -eux + +install-packages -m multipath multipath_tools_package + +# default to blacklisting all devices to avoid the installation of multipath +# changing the default behaviour of the system. +install -m 0644 -o root -g root $(dirname $0)/../files/multipath.conf /etc/multipath.conf + diff --git a/elements/multipath/pkg-map b/elements/multipath/pkg-map new file mode 100644 index 000000000..e64d01056 --- /dev/null +++ b/elements/multipath/pkg-map @@ -0,0 +1,10 @@ +{ + "family": { + "redhat": { + "multipath_tools_package": "device-mapper-multipath" + } + }, + "default": { + "multipath_tools_package": "multipath-tools" + } +}