From 243cb34615a1482ba676ad91afa10b3c76d800d6 Mon Sep 17 00:00:00 2001 From: Alan Bishop <abishop@redhat.com> Date: Thu, 3 Jan 2019 16:29:21 +0000 Subject: [PATCH] Bind mount /var/lib/iscsi in containers using iSCSI Services that create iSCSI connections need to share the connection info that gets created in /var/lib/iscsi. It's especially important that the host has knowledge of *all* connections so that it can disconnect them whenever the host shuts down or reboots. Closes-Bug: #1810338 Change-Id: I803ed2ba9ff52f9a02c550a28d21cc9102568c8e --- deployment/glance/glance-api-container-puppet.yaml | 1 + docker/services/cinder-common.yaml | 6 ++++-- docker/services/iscsid.yaml | 1 + docker/services/multipathd.yaml | 3 ++- docker/services/nova-compute.yaml | 1 + docker/services/nova-ironic.yaml | 1 + 6 files changed, 10 insertions(+), 3 deletions(-) diff --git a/deployment/glance/glance-api-container-puppet.yaml b/deployment/glance/glance-api-container-puppet.yaml index fb20b6cc38..9cbf708a13 100644 --- a/deployment/glance/glance-api-container-puppet.yaml +++ b/deployment/glance/glance-api-container-puppet.yaml @@ -468,6 +468,7 @@ outputs: - cinder_backend_enabled - - /dev:/dev - /etc/iscsi:/etc/iscsi + - /var/lib/iscsi:/var/lib/iscsi:z - [] environment: - KOLLA_BOOTSTRAP=True diff --git a/docker/services/cinder-common.yaml b/docker/services/cinder-common.yaml index 4618b59a85..b49d6950e1 100644 --- a/docker/services/cinder-common.yaml +++ b/docker/services/cinder-common.yaml @@ -145,8 +145,9 @@ outputs: - /dev/:/dev/ - /run/:/run/ - /sys:/sys - - /var/lib/cinder:/var/lib/cinder - - /var/log/containers/cinder:/var/log/cinder + - /var/lib/cinder:/var/lib/cinder:z + - /var/lib/iscsi:/var/lib/iscsi:z + - /var/log/containers/cinder:/var/log/cinder:z cinder_volume_environment: description: Docker environment for the cinder-volume container (HA or non-HA) @@ -171,6 +172,7 @@ outputs: - /sys:/sys - /lib/modules:/lib/modules:ro - /var/lib/cinder:/var/lib/cinder:z + - /var/lib/iscsi:/var/lib/iscsi:z - /var/log/containers/cinder:/var/log/cinder:z cinder_backup_environment: diff --git a/docker/services/iscsid.yaml b/docker/services/iscsid.yaml index 2920b147b4..b0810120e5 100644 --- a/docker/services/iscsid.yaml +++ b/docker/services/iscsid.yaml @@ -100,6 +100,7 @@ outputs: - /sys:/sys - /lib/modules:/lib/modules:ro - /etc/iscsi:/var/lib/kolla/config_files/src-iscsid:ro + - /var/lib/iscsi:/var/lib/iscsi:z environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS host_prep_tasks: diff --git a/docker/services/multipathd.yaml b/docker/services/multipathd.yaml index 18210b45a5..711bdb0ee9 100644 --- a/docker/services/multipathd.yaml +++ b/docker/services/multipathd.yaml @@ -83,7 +83,8 @@ outputs: - /run/:/run/ - /sys:/sys - /lib/modules:/lib/modules:ro - - /var/lib/cinder:/var/lib/cinder + - /var/lib/cinder:/var/lib/cinder:z + - /var/lib/iscsi:/var/lib/iscsi:z environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS host_prep_tasks: diff --git a/docker/services/nova-compute.yaml b/docker/services/nova-compute.yaml index 7bdcb6bafa..c172479b16 100644 --- a/docker/services/nova-compute.yaml +++ b/docker/services/nova-compute.yaml @@ -238,6 +238,7 @@ outputs: - /dev:/dev - /lib/modules:/lib/modules:ro - /run:/run + - /var/lib/iscsi:/var/lib/iscsi:z - /var/lib/nova:/var/lib/nova:shared,z - /var/lib/libvirt:/var/lib/libvirt:shared,z - /sys/class/net:/sys/class/net diff --git a/docker/services/nova-ironic.yaml b/docker/services/nova-ironic.yaml index 4df744d912..98ac1ad6db 100644 --- a/docker/services/nova-ironic.yaml +++ b/docker/services/nova-ironic.yaml @@ -141,6 +141,7 @@ outputs: - /etc/iscsi:/var/lib/kolla/config_files/src-iscsid:ro - /run:/run - /dev:/dev + - /var/lib/iscsi:/var/lib/iscsi:z - /var/lib/nova/:/var/lib/nova:shared,z - /var/log/containers/nova:/var/log/nova:z environment: