From 91910d2a455f66e5f014a04bedf132fe0cab55ea Mon Sep 17 00:00:00 2001
From: Ning Yao <yaoning@unitedstack.com>
Date: Fri, 6 Sep 2019 23:54:06 +0800
Subject: [PATCH] Fix qemu loading of ceph.conf (permission error)

ceph.conf is loaded by qemu, not libvirt.
Since qemu runs as the nova user, ceph.conf owned by root
causes a permission error. The logs in
/var/log/libvirt/qemu/instance-*.log reveal the error.

This change fixes the issue by changing the ownership of ceph.conf
in nova-libvirt to the nova user.

Closes-Bug: #1861513
Change-Id: I1881f51a6c8508f0f186a5623443343dc1df41d4
Signed-off-by: Ning Yao <yaoning@unitedstack.com>
---
 ansible/roles/nova-cell/templates/nova-libvirt.json.j2 | 2 +-
 releasenotes/notes/bug-1861513-8e09a6fb42dfc99c.yaml   | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
 create mode 100644 releasenotes/notes/bug-1861513-8e09a6fb42dfc99c.yaml

diff --git a/ansible/roles/nova-cell/templates/nova-libvirt.json.j2 b/ansible/roles/nova-cell/templates/nova-libvirt.json.j2
index 79a70172b5..18fc69f85d 100644
--- a/ansible/roles/nova-cell/templates/nova-libvirt.json.j2
+++ b/ansible/roles/nova-cell/templates/nova-libvirt.json.j2
@@ -52,7 +52,7 @@
         {
             "source": "{{ container_config_directory }}/ceph.conf",
             "dest": "/etc/ceph/ceph.conf",
-            "owner": "root",
+            "owner": "nova",
             "perm": "0600"
         }{% endif %}
     ]
diff --git a/releasenotes/notes/bug-1861513-8e09a6fb42dfc99c.yaml b/releasenotes/notes/bug-1861513-8e09a6fb42dfc99c.yaml
new file mode 100644
index 0000000000..f46e4eb33a
--- /dev/null
+++ b/releasenotes/notes/bug-1861513-8e09a6fb42dfc99c.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+  - |
+    Fix qemu loading of ceph.conf (permission error).
+    `LP#1861513 <https://launchpad.net/bugs/1861513>`
-- 
GitLab