Allow overriding RBD disk cache modes

Keep the default network=writeback setting, but allow it
to come from hiera overrides as well.

Conflicts:
manifests/profile/base/nova/compute_libvirt_shared.pp

Change-Id: I47aaf4be463684f5b67820b8ebb5db44ba960b44
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
(cherry picked from commit f12a143f52)
This commit is contained in:
Bogdan Dobrelya 2021-05-20 10:08:31 +02:00 committed by Martin Schuppert
parent 8f3a88ba27
commit cd9e0594a8
2 changed files with 9 additions and 3 deletions

View File

@ -38,8 +38,9 @@ class tripleo::profile::base::nova::compute_libvirt_shared (
) { ) {
if $step >= 4 { if $step >= 4 {
# Ceph + Libvirt # Ceph + Libvirt
$rbd_ephemeral_storage = hiera('nova::compute::rbd::ephemeral_storage', false) $rbd_ephemeral_storage = hiera('nova::compute::rbd::ephemeral_storage', false)
$rbd_persistent_storage = hiera('rbd_persistent_storage', false) $rbd_persistent_storage = hiera('rbd_persistent_storage', false)
$rbd_disk_cachemodes = hiera('rbd_disk_cachemodes', ['network=writeback'])
if $rbd_ephemeral_storage or $rbd_persistent_storage { if $rbd_ephemeral_storage or $rbd_persistent_storage {
include nova::compute::rbd include nova::compute::rbd
exec{ "exec-setfacl-${nova_rbd_client_name}-nova": exec{ "exec-setfacl-${nova_rbd_client_name}-nova":
@ -56,8 +57,8 @@ class tripleo::profile::base::nova::compute_libvirt_shared (
if $rbd_ephemeral_storage { if $rbd_ephemeral_storage {
class { 'nova::compute::libvirt': class { 'nova::compute::libvirt':
libvirt_disk_cachemodes => ['network=writeback'], disk_cachemodes => $rbd_disk_cachemodes,
libvirt_hw_disk_discard => 'unmap', hw_disk_discard => 'unmap',
} }
} else { } else {
include nova::compute::libvirt include nova::compute::libvirt

View File

@ -0,0 +1,5 @@
---
features:
- |
New hiera setting `rbd_disk_cachemodes` allows to override
the disk cache modes for RBD. Defaults to ['network=writeback'].