aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Cesario <carloscesario@gmail.com>2016-07-08 13:34:04 -0300
committerCarlos Cesario <carloscesario@gmail.com>2016-07-11 09:07:21 -0300
commit115c55e1fe55598704ddab8e3ce251d1f7d78ffc (patch)
tree81d96f4f6a4f4a1a3ea6db33fccda864010e8d37
parent0f9534bc2339b20544abff33da87ec809e66e1a1 (diff)
downloadkolla-115c55e1fe55598704ddab8e3ce251d1f7d78ffc.tar.gz
kolla-115c55e1fe55598704ddab8e3ce251d1f7d78ffc.zip
Add multipathing support to docker container
Due some cinder drivers need multipathing support like this one http://docs.openstack.org/mitaka/config-reference/block-storage/drivers/ibm-storwize-svc-driver.html This PS will allow to run these additional drivers when using Kolla. Implements: blueprint multipath-support Change-Id: Id6cf29f984c92773bbfc2f95daea573a74701648
-rw-r--r--ansible/group_vars/all.yml1
-rw-r--r--ansible/inventory/all-in-one4
-rw-r--r--ansible/inventory/multinode4
-rw-r--r--ansible/roles/multipathd/defaults/main.yml9
-rw-r--r--ansible/roles/multipathd/tasks/config.yml24
-rw-r--r--ansible/roles/multipathd/tasks/deploy.yml4
-rw-r--r--ansible/roles/multipathd/tasks/main.yml2
-rw-r--r--ansible/roles/multipathd/tasks/pull.yml7
-rw-r--r--ansible/roles/multipathd/tasks/reconfigure.yml1
-rw-r--r--ansible/roles/multipathd/tasks/start.yml21
-rw-r--r--ansible/roles/multipathd/tasks/upgrade.yml5
-rw-r--r--ansible/roles/multipathd/templates/multipath.conf.j211
-rw-r--r--ansible/roles/multipathd/templates/multipathd.json.j211
-rw-r--r--ansible/site.yml8
-rw-r--r--docker/multipathd/Dockerfile.j218
-rw-r--r--etc/kolla/globals.yml1
-rw-r--r--releasenotes/notes/add-multipath-9ee29be1fcea6d94.yaml3
17 files changed, 134 insertions, 0 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index 157b4299c..aed7db986 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -205,6 +205,7 @@ enable_magnum: "no"
enable_manila: "no"
enable_mistral: "no"
enable_mongodb: "no"
+enable_multipathd: "no"
enable_murano: "no"
enable_neutron_lbaas: "no"
enable_neutron_qos: "no"
diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one
index d8a4232cf..53a8940af 100644
--- a/ansible/inventory/all-in-one
+++ b/ansible/inventory/all-in-one
@@ -244,3 +244,7 @@ ceilometer
[ceilometer-compute:children]
compute
+
+# Multipathd
+[multipathd:children]
+compute
diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode
index 5edfbd2c0..6b98a2dd2 100644
--- a/ansible/inventory/multinode
+++ b/ansible/inventory/multinode
@@ -256,3 +256,7 @@ ceilometer
[ceilometer-compute:children]
compute
+
+# Multipathd
+[multipathd:children]
+compute
diff --git a/ansible/roles/multipathd/defaults/main.yml b/ansible/roles/multipathd/defaults/main.yml
new file mode 100644
index 000000000..0a2a56dff
--- /dev/null
+++ b/ansible/roles/multipathd/defaults/main.yml
@@ -0,0 +1,9 @@
+---
+project_name: "multipathd"
+
+####################
+# Docker
+####################
+multipathd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-multipathd"
+multipathd_tag: "{{ openstack_release }}"
+multipathd_image_full: "{{ multipathd_image }}:{{ multipathd_tag }}"
diff --git a/ansible/roles/multipathd/tasks/config.yml b/ansible/roles/multipathd/tasks/config.yml
new file mode 100644
index 000000000..a831b32a6
--- /dev/null
+++ b/ansible/roles/multipathd/tasks/config.yml
@@ -0,0 +1,24 @@
+---
+- name: Ensuring config directories exist
+ file:
+ path: "{{ node_config_directory }}/{{ item }}"
+ state: "directory"
+ recurse: yes
+ when: inventory_hostname in groups['compute']
+ with_items:
+ - "multipathd"
+
+- name: Copying over config.json files for services
+ template:
+ src: "{{ item }}.json.j2"
+ dest: "{{ node_config_directory }}/{{ item }}/config.json"
+ when: inventory_hostname in groups['compute']
+ with_items:
+ - "multipathd"
+
+- name: Copying over multipath.conf
+ template:
+ src: "{{ role_path }}/templates/multipath.conf.j2"
+ dest: "{{ node_config_directory }}/{{ item }}/multipath.conf"
+ with_items:
+ - "multipathd"
diff --git a/ansible/roles/multipathd/tasks/deploy.yml b/ansible/roles/multipathd/tasks/deploy.yml
new file mode 100644
index 000000000..1f16915ad
--- /dev/null
+++ b/ansible/roles/multipathd/tasks/deploy.yml
@@ -0,0 +1,4 @@
+---
+- include: config.yml
+
+- include: start.yml
diff --git a/ansible/roles/multipathd/tasks/main.yml b/ansible/roles/multipathd/tasks/main.yml
new file mode 100644
index 000000000..b017e8b4a
--- /dev/null
+++ b/ansible/roles/multipathd/tasks/main.yml
@@ -0,0 +1,2 @@
+---
+- include: "{{ action }}.yml"
diff --git a/ansible/roles/multipathd/tasks/pull.yml b/ansible/roles/multipathd/tasks/pull.yml
new file mode 100644
index 000000000..41d70f65e
--- /dev/null
+++ b/ansible/roles/multipathd/tasks/pull.yml
@@ -0,0 +1,7 @@
+---
+- name: Pulling multipathd image
+ kolla_docker:
+ action: "pull_image"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ multipathd_image_full }}"
+ when: inventory_hostname in groups['multipathd']
diff --git a/ansible/roles/multipathd/tasks/reconfigure.yml b/ansible/roles/multipathd/tasks/reconfigure.yml
new file mode 100644
index 000000000..ed97d539c
--- /dev/null
+++ b/ansible/roles/multipathd/tasks/reconfigure.yml
@@ -0,0 +1 @@
+---
diff --git a/ansible/roles/multipathd/tasks/start.yml b/ansible/roles/multipathd/tasks/start.yml
new file mode 100644
index 000000000..0bd7012f3
--- /dev/null
+++ b/ansible/roles/multipathd/tasks/start.yml
@@ -0,0 +1,21 @@
+---
+- name: Starting multipathd container
+ kolla_docker:
+ action: "start_container"
+ common_options: "{{ docker_common_options }}"
+ image: "{{ multipathd_image_full }}"
+ name: "multipathd"
+ ipc_mode: "host"
+ privileged: True
+ volumes:
+ - "{{ node_config_directory }}/multipathd/:{{ container_config_directory }}/:ro"
+ - "kolla_logs:/var/log/kolla/"
+ - "/etc/localtime:/etc/localtime:ro"
+ - "/dev/:/dev/"
+ - "/run/:/run/"
+ - "/sys/fs/cgroup:/sys/fs/cgroup:ro"
+ - "/lib/modules:/lib/modules:ro"
+ - "/sys/kernel/config:/configfs"
+ - "cinder:/var/lib/cinder"
+ - "iscsi_info:/etc/iscsi"
+ when: inventory_hostname in groups['compute']
diff --git a/ansible/roles/multipathd/tasks/upgrade.yml b/ansible/roles/multipathd/tasks/upgrade.yml
new file mode 100644
index 000000000..4586b4fab
--- /dev/null
+++ b/ansible/roles/multipathd/tasks/upgrade.yml
@@ -0,0 +1,5 @@
+---
+- include: config.yml
+
+- include: start.yml
+ serial: "30%"
diff --git a/ansible/roles/multipathd/templates/multipath.conf.j2 b/ansible/roles/multipathd/templates/multipath.conf.j2
new file mode 100644
index 000000000..d063f31a8
--- /dev/null
+++ b/ansible/roles/multipathd/templates/multipath.conf.j2
@@ -0,0 +1,11 @@
+defaults {
+ user_friendly_names no
+ polling_interval 30
+}
+
+blacklist {
+ devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
+ devnode "^sd[a]"
+ devnode "^hd[a-z]"
+ devnode "^cciss!c[0-9]d[0-9]*"
+}
diff --git a/ansible/roles/multipathd/templates/multipathd.json.j2 b/ansible/roles/multipathd/templates/multipathd.json.j2
new file mode 100644
index 000000000..2570a607e
--- /dev/null
+++ b/ansible/roles/multipathd/templates/multipathd.json.j2
@@ -0,0 +1,11 @@
+{
+ "command": "/sbin/multipathd -d",
+ "config_files": [
+ {
+ "source": "{{ container_config_directory }}/multipath.conf",
+ "dest": "/etc/multipath.conf",
+ "owner": "root",
+ "perm": "0600"
+ }
+ ]
+}
diff --git a/ansible/site.yml b/ansible/site.yml
index dbf3861ce..98305cfdc 100644
--- a/ansible/site.yml
+++ b/ansible/site.yml
@@ -22,6 +22,7 @@
- mariadb
- iscsid
- tgtd
+ - multipathd
- murano-api
- neutron-server
- nova-api
@@ -60,6 +61,13 @@
tags: iscsi,
when: enable_iscsi | bool }
+- hosts:
+ - multipathd
+ roles:
+ - { role: multipathd,
+ tags: multipathd,
+ when: enable_multipathd | bool }
+
- hosts: rabbitmq
roles:
- { role: rabbitmq,
diff --git a/docker/multipathd/Dockerfile.j2 b/docker/multipathd/Dockerfile.j2
new file mode 100644
index 000000000..9c91f91f3
--- /dev/null
+++ b/docker/multipathd/Dockerfile.j2
@@ -0,0 +1,18 @@
+FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
+MAINTAINER {{ maintainer }}
+
+{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
+
+RUN yum -y install \
+ device-mapper-multipath \
+ && yum clean all
+
+{% elif base_distro in ['ubuntu', 'debian'] %}
+
+RUN apt-get -y install --no-install-recommends \
+ multipath-tools \
+ && apt-get clean
+
+{% endif %}
+
+{{ include_footer }}
diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml
index 47b450cdf..acee82702 100644
--- a/etc/kolla/globals.yml
+++ b/etc/kolla/globals.yml
@@ -120,6 +120,7 @@ neutron_external_interface: "eth1"
#enable_mistral: "no"
#enable_mongodb: "no"
#enable_murano: "no"
+#enable_multipathd: "no"
#enable_neutron_lbaas: "no"
#enable_neutron_qos: "no"
#enable_swift: "no"
diff --git a/releasenotes/notes/add-multipath-9ee29be1fcea6d94.yaml b/releasenotes/notes/add-multipath-9ee29be1fcea6d94.yaml
new file mode 100644
index 000000000..82377e729
--- /dev/null
+++ b/releasenotes/notes/add-multipath-9ee29be1fcea6d94.yaml
@@ -0,0 +1,3 @@
+---
+features:
+ - Add multipathing support to docker container.