From 7643761601a89823efee9bbbd92f2d05106fc129 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Mon, 11 Mar 2019 20:14:09 +0100 Subject: [PATCH] Fix kolla permissions errors inside nova_virtlogd [stack@win1 ~]$ sudo podman logs nova_virtlogd +sudo -E kolla_set_configs OSError: [Errno 30] Read-only file system The reason is the following nova_virtlogd bind mount: ... - /etc/libvirt/qemu:/etc/libvirt/qemu:ro Seems kolla config has a some empty folders that are then copied to a :ro fs and we fail: ()[root@win1 /]$ find var/lib/kolla/config_files/src/ var/lib/kolla/config_files/src/ var/lib/kolla/config_files/src/etc var/lib/kolla/config_files/src/etc/libvirt var/lib/kolla/config_files/src/etc/libvirt/qemu var/lib/kolla/config_files/src/etc/libvirt/qemu/networks var/lib/kolla/config_files/src/etc/libvirt/qemu/networks/autostart Since the above empty folders are due to the timestamp change caused by the default.xml file removal, let's do those on BM only. Hopefully compute folks can propose a more definitive fix that takes that default.xml removal logic into host-prep-task (if it is still needed) Tested on a RHEL8 OS/Containers combo and the error is gone: [root@overcloud-novacompute-0 ~]# podman logs nova_virtlogd 2>&1| tail -n5 ++ chmod 755 /var/log/kolla/libvirt ++ chmod 644 /var/log/kolla/libvirt/libvirtd.log Running command: '/usr/sbin/virtlogd --config /etc/libvirt/virtlogd.conf' + echo 'Running command: '\''/usr/sbin/virtlogd --config /etc/libvirt/virtlogd.conf'\''' + exec /usr/sbin/virtlogd --config /etc/libvirt/virtlogd.conf Change-Id: I629e9e37aff9a1610df874b46c7a5b1eedd3e374 Closes-Bug: #1819482 --- manifests/profile/base/nova/libvirt.pp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/manifests/profile/base/nova/libvirt.pp b/manifests/profile/base/nova/libvirt.pp index 44cbc360c..f58d08d5c 100644 --- a/manifests/profile/base/nova/libvirt.pp +++ b/manifests/profile/base/nova/libvirt.pp @@ -55,11 +55,15 @@ class tripleo::profile::base::nova::libvirt ( libvirtd_config => merge($libvirtd_config_default, $libvirtd_config) } - file { ['/etc/libvirt/qemu/networks/autostart/default.xml', - '/etc/libvirt/qemu/networks/default.xml']: - ensure => absent, - require => Package['libvirt'], - before => Service['libvirt'], + # This removal of files in /etc/libvirt/qemu should not happen inside containers + # Avoids LP#1819482 + if ! ($::uuid == 'docker' or $::deployment_type == 'containers') { + file { ['/etc/libvirt/qemu/networks/autostart/default.xml', + '/etc/libvirt/qemu/networks/default.xml']: + ensure => absent, + require => Package['libvirt'], + before => Service['libvirt'], + } } # in case libvirt has been already running before the Puppet run, make