From 56710de59d50402c7e84365116b7f16f8a12e388 Mon Sep 17 00:00:00 2001
From: Florian LEDUC <florian.leduc@socgen.com>
Date: Thu, 2 Jan 2020 17:11:32 +0100
Subject: [PATCH] Use iSCSI multipath for libvirt

* Multipath daemon allows to reach block devices
via multiple paths for better resiliency and performance.
Multipathd periodically checks the failed iscsi paths
and maintains a list of valid paths. Libvirt can use more
than one iSCSI path when option volume_use_multipath is set
and when multipathd enabled.

Change-Id: I54629656803c4989f7673e8c69d2a820609b5960
Implements: blueprint nova-libvirt-multipath-iscsi
---
 ansible/roles/nova-cell/templates/nova.conf.d/libvirt.conf.j2 | 3 +++
 .../notes/nova-libvirt-multipath-iscsi-eb961e44e6fec9ff.yaml  | 4 ++++
 2 files changed, 7 insertions(+)
 create mode 100644 releasenotes/notes/nova-libvirt-multipath-iscsi-eb961e44e6fec9ff.yaml

diff --git a/ansible/roles/nova-cell/templates/nova.conf.d/libvirt.conf.j2 b/ansible/roles/nova-cell/templates/nova.conf.d/libvirt.conf.j2
index 10dda3fa4e..69d8f9363b 100644
--- a/ansible/roles/nova-cell/templates/nova.conf.d/libvirt.conf.j2
+++ b/ansible/roles/nova-cell/templates/nova.conf.d/libvirt.conf.j2
@@ -24,3 +24,6 @@ virt_type = {{ nova_compute_virt_type }}
 {% if nova_libvirt_cpu_mode %}
 cpu_mode = {{ nova_libvirt_cpu_mode }}
 {% endif %}
+{% if enable_multipathd | bool %}
+volume_use_multipath = True
+{% endif %}
diff --git a/releasenotes/notes/nova-libvirt-multipath-iscsi-eb961e44e6fec9ff.yaml b/releasenotes/notes/nova-libvirt-multipath-iscsi-eb961e44e6fec9ff.yaml
new file mode 100644
index 0000000000..bf28a2d1f2
--- /dev/null
+++ b/releasenotes/notes/nova-libvirt-multipath-iscsi-eb961e44e6fec9ff.yaml
@@ -0,0 +1,4 @@
+---
+upgrade:
+  - |
+    Enabling multipathd will now configure Nova to use it.