follow-up: Enable support for Libvirt modular daemons

This change is follow-up patch to refactor the modular-libvirt changes
to  address suggestions mentioned on the change [1].

[1] Ic0a13ab453ae8d3c1882b3719df295a2b0b510c5

Change-Id: I988fac14da2eecba625ea35f193fb9b32a4a8d42
This commit is contained in:
Rajesh Tailor 2021-10-11 11:35:03 +05:30
parent ea34234ff3
commit 40d5282eb7
5 changed files with 172 additions and 33 deletions

View File

@ -413,7 +413,9 @@ outputs:
rbd_persistent_storage: {get_param: CinderEnableRbdBackend} rbd_persistent_storage: {get_param: CinderEnableRbdBackend}
rbd_disk_cachemodes: {get_param: RbdDiskCachemodes} rbd_disk_cachemodes: {get_param: RbdDiskCachemodes}
tripleo::profile::base::nova::libvirt::modular_libvirt: false tripleo::profile::base::nova::libvirt::modular_libvirt: false
nova::params::modular_libvirt: false nova::compute::libvirt::services::modular_libvirt: false
nova::compute::libvirt::modular_libvirt: false
nova::migration::libvirt::modular_libvirt: false
- if: - if:
- use_tls_for_live_migration - use_tls_for_live_migration
- tripleo::profile::base::nova::migration::client::libvirt_tls: true - tripleo::profile::base::nova::migration::client::libvirt_tls: true

View File

@ -95,31 +95,61 @@ outputs:
template: template:
'LEVEL:file:/var/log/libvirt/virtsecretd.log' 'LEVEL:file:/var/log/libvirt/virtsecretd.log'
params: params:
LEVEL: {get_param: LibvirtVirtsecretdLogLevel} LEVEL:
if:
- or:
- {get_param: Debug }
- {get_param: LibvirtDebug }
- 1
- {get_param: LibvirtVirtsecretdLogLevel}
nova::compute::libvirt::virtnodedevd::log_outputs: nova::compute::libvirt::virtnodedevd::log_outputs:
str_replace: str_replace:
template: template:
'LEVEL:file:/var/log/libvirt/virtnodedevd.log' 'LEVEL:file:/var/log/libvirt/virtnodedevd.log'
params: params:
LEVEL: {get_param: LibvirtVirtnodedevdLogLevel} LEVEL:
if:
- or:
- {get_param: Debug }
- {get_param: LibvirtDebug }
- 1
- {get_param: LibvirtVirtnodedevdLogLevel}
nova::compute::libvirt::virtqemud::log_outputs: nova::compute::libvirt::virtqemud::log_outputs:
str_replace: str_replace:
template: template:
'LEVEL:file:/var/log/libvirt/virtqemud.log' 'LEVEL:file:/var/log/libvirt/virtqemud.log'
params: params:
LEVEL: {get_param: LibvirtVirtqemudLogLevel} LEVEL:
if:
- or:
- {get_param: Debug }
- {get_param: LibvirtDebug }
- 1
- {get_param: LibvirtVirtqemudLogLevel}
nova::compute::libvirt::virtproxyd::log_outputs: nova::compute::libvirt::virtproxyd::log_outputs:
str_replace: str_replace:
template: template:
'LEVEL:file:/var/log/libvirt/virtproxyd.log' 'LEVEL:file:/var/log/libvirt/virtproxyd.log'
params: params:
LEVEL: {get_param: LibvirtVirtproxydLogLevel} LEVEL:
if:
- or:
- {get_param: Debug }
- {get_param: LibvirtDebug }
- 1
- {get_param: LibvirtVirtproxydLogLevel}
nova::compute::libvirt::virtstoraged::log_outputs: nova::compute::libvirt::virtstoraged::log_outputs:
str_replace: str_replace:
template: template:
'LEVEL:file:/var/log/libvirt/virtstoraged.log' 'LEVEL:file:/var/log/libvirt/virtstoraged.log'
params: params:
LEVEL: {get_param: LibvirtVirtstoragedLogLevel} LEVEL:
if:
- or:
- {get_param: Debug }
- {get_param: LibvirtDebug }
- 1
- {get_param: LibvirtVirtstoragedLogLevel}
volumes: volumes:
description: The volumes needed to log to files in the host. description: The volumes needed to log to files in the host.
value: value:

View File

@ -26,6 +26,41 @@ parameters:
type: number type: number
constraints: constraints:
- range: { min: 1, max: 4 } - range: { min: 1, max: 4 }
LibvirtVirtsecretdLogLevel:
default: 3
description: Defines log level in virtsecretd to filter log output.
See https://libvirt.org/logging.html to find its detail.
type: number
constraints:
- range: { min: 1, max: 4 }
LibvirtVirtnodedevdLogLevel:
default: 3
description: Defines log level in virtnodedevd to filter log output.
See https://libvirt.org/logging.html to find its detail.
type: number
constraints:
- range: { min: 1, max: 4 }
LibvirtVirtqemudLogLevel:
default: 3
description: Defines log level in virtqemud to filter log output.
See https://libvirt.org/logging.html to find its detail.
type: number
constraints:
- range: { min: 1, max: 4 }
LibvirtVirtproxydLogLevel:
default: 3
description: Defines log level in virtproxyd to filter log output.
See https://libvirt.org/logging.html to find its detail.
type: number
constraints:
- range: { min: 1, max: 4 }
LibvirtVirtstoragedLogLevel:
default: 3
description: Defines log level in virtstoraged to filter log output.
See https://libvirt.org/logging.html to find its detail.
type: number
constraints:
- range: { min: 1, max: 4 }
outputs: outputs:
config_settings: config_settings:
@ -55,6 +90,66 @@ outputs:
- {get_param: LibvirtDebug } - {get_param: LibvirtDebug }
- 1 - 1
- {get_param: LibvirtVirtlogdLogLevel} - {get_param: LibvirtVirtlogdLogLevel}
nova::compute::libvirt::virtsecretd::log_outputs:
str_replace:
template:
'LEVEL:stderr'
params:
LEVEL:
if:
- or:
- {get_param: Debug }
- {get_param: LibvirtDebug }
- 1
- {get_param: LibvirtVirtsecretdLogLevel}
nova::compute::libvirt::virtnodedevd::log_outputs:
str_replace:
template:
'LEVEL:stderr'
params:
LEVEL:
if:
- or:
- {get_param: Debug }
- {get_param: LibvirtDebug }
- 1
- {get_param: LibvirtVirtnodedevdLogLevel}
nova::compute::libvirt::virtqemud::log_outputs:
str_replace:
template:
'LEVEL:stderr'
params:
LEVEL:
if:
- or:
- {get_param: Debug }
- {get_param: LibvirtDebug }
- 1
- {get_param: LibvirtVirtqemudLogLevel}
nova::compute::libvirt::virtproxyd::log_outputs:
str_replace:
template:
'LEVEL:stderr'
params:
LEVEL:
if:
- or:
- {get_param: Debug }
- {get_param: LibvirtDebug }
- 1
- {get_param: LibvirtVirtproxydLogLevel}
nova::compute::libvirt::virtstoraged::log_outputs:
str_replace:
template:
'LEVEL:stderr'
params:
LEVEL:
if:
- or:
- {get_param: Debug }
- {get_param: LibvirtDebug }
- 1
- {get_param: LibvirtVirtstoragedLogLevel}
docker_config: docker_config:
description: Extra containers needed for logging to stdout or a sidecar container. description: Extra containers needed for logging to stdout or a sidecar container.
value: null value: null

View File

@ -81,6 +81,19 @@ conditions:
- {equals: [{get_param: QemuMemoryBackingDir}, '']} - {equals: [{get_param: QemuMemoryBackingDir}, '']}
- {equals: [{get_param: [RoleParameters, QemuMemoryBackingDir]}, '']} - {equals: [{get_param: [RoleParameters, QemuMemoryBackingDir]}, '']}
resources:
RoleParametersValue:
type: OS::Heat::Value
properties:
type: json
value:
map_replace:
- map_replace:
- nova::compute::libvirt::qemu::memory_backing_dir: QemuMemoryBackingDir
- values: {get_param: [RoleParameters]}
- values:
QemuMemoryBackingDir: {get_param: QemuMemoryBackingDir}
outputs: outputs:
kolla_config_files: kolla_config_files:
description: Common kolla config_files. description: Common kolla config_files.
@ -154,5 +167,5 @@ outputs:
- - str_replace: - - str_replace:
template: "MEMORY_BACKING_DIR:MEMORY_BACKING_DIR" template: "MEMORY_BACKING_DIR:MEMORY_BACKING_DIR"
params: params:
MEMORY_BACKING_DIR: {get_attr: [RoleParametersValue, value, memory_backing_dir]} MEMORY_BACKING_DIR: {get_attr: [RoleParametersValue, value, 'nova::compute::libvirt::qemu::memory_backing_dir']}

View File

@ -237,31 +237,31 @@ parameters:
logging level for a given category log outputs, as specified logging level for a given category log outputs, as specified
in https://libvirt.org/logging.html . in https://libvirt.org/logging.html .
type: string type: string
default: '1:logging 4:object 4:json 4:event 1:util' default: '1:qemu 1:libvirt 4:object 4:json 4:event 1:util'
LibvirtVirtnodedevdLogFilters: LibvirtVirtnodedevdLogFilters:
description: Defines a filter in virtnodedevd to select a different description: Defines a filter in virtnodedevd to select a different
logging level for a given category log outputs, as specified logging level for a given category log outputs, as specified
in https://libvirt.org/logging.html . in https://libvirt.org/logging.html .
type: string type: string
default: '1:logging 4:object 4:json 4:event 1:util' default: '1:qemu 1:libvirt 4:object 4:json 4:event 1:util'
LibvirtVirtstoragedLogFilters: LibvirtVirtstoragedLogFilters:
description: Defines a filter in virtstoraged to select a different description: Defines a filter in virtstoraged to select a different
logging level for a given category log outputs, as specified logging level for a given category log outputs, as specified
in https://libvirt.org/logging.html . in https://libvirt.org/logging.html .
type: string type: string
default: '1:logging 4:object 4:json 4:event 1:util' default: '1:qemu 1:libvirt 4:object 4:json 4:event 1:util'
LibvirtVirtqemudLogFilters: LibvirtVirtqemudLogFilters:
description: Defines a filter in virtqemud to select a different description: Defines a filter in virtqemud to select a different
logging level for a given category log outputs, as specified logging level for a given category log outputs, as specified
in https://libvirt.org/logging.html . in https://libvirt.org/logging.html .
type: string type: string
default: '1:logging 4:object 4:json 4:event 1:util' default: '1:qemu 1:libvirt 4:object 4:json 4:event 1:util'
LibvirtVirtproxydLogFilters: LibvirtVirtproxydLogFilters:
description: Defines a filter in virtproxyd to select a different description: Defines a filter in virtproxyd to select a different
logging level for a given category log outputs, as specified logging level for a given category log outputs, as specified
in https://libvirt.org/logging.html . in https://libvirt.org/logging.html .
type: string type: string
default: '1:logging 4:object 4:json 4:event 1:util' default: '1:qemu 1:libvirt 4:object 4:json 4:event 1:util'
LibvirtTLSPriority: LibvirtTLSPriority:
description: > description: >
Override the compile time default TLS priority string. Override the compile time default TLS priority string.
@ -369,8 +369,8 @@ resources:
RoleName: {get_param: RoleName} RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters} RoleParameters: {get_param: RoleParameters}
VirtCommon: NovaLibvirtCommon:
type: ./nova-virt-common.yaml type: ./nova-libvirt-common.yaml
outputs: outputs:
role_data: role_data:
@ -448,7 +448,6 @@ outputs:
nova::compute::libvirt::services::modular_libvirt: true nova::compute::libvirt::services::modular_libvirt: true
nova::compute::libvirt::modular_libvirt: true nova::compute::libvirt::modular_libvirt: true
nova::migration::libvirt::modular_libvirt: true nova::migration::libvirt::modular_libvirt: true
nova::params::modular_libvirt: true
- if: - if:
- use_tls_for_live_migration - use_tls_for_live_migration
- tripleo::profile::base::nova::migration::client::libvirt_tls: true - tripleo::profile::base::nova::migration::client::libvirt_tls: true
@ -494,28 +493,28 @@ outputs:
- {get_param: NovaEnableVirtlogdContainerWrapper} - {get_param: NovaEnableVirtlogdContainerWrapper}
- /usr/local/bin/virtlogd_wrapper - /usr/local/bin/virtlogd_wrapper
- /usr/sbin/virtlogd --config /etc/libvirt/virtlogd.conf - /usr/sbin/virtlogd --config /etc/libvirt/virtlogd.conf
config_files: {get_attr: [VirtCommon, kolla_config_files]} config_files: {get_attr: [NovaLibvirtCommon, kolla_config_files]}
permissions: {get_attr: [VirtCommon, kolla_permissions]} permissions: {get_attr: [NovaLibvirtCommon, kolla_permissions]}
/var/lib/kolla/config_files/nova_virtsecretd.json: /var/lib/kolla/config_files/nova_virtsecretd.json:
command: /usr/sbin/virtsecretd --config /etc/libvirt/virtsecretd.conf command: /usr/sbin/virtsecretd --config /etc/libvirt/virtsecretd.conf
config_files: {get_attr: [VirtCommon, kolla_config_files]} config_files: {get_attr: [NovaLibvirtCommon, kolla_config_files]}
permissions: {get_attr: [VirtCommon, kolla_permissions]} permissions: {get_attr: [NovaLibvirtCommon, kolla_permissions]}
/var/lib/kolla/config_files/nova_virtnodedevd.json: /var/lib/kolla/config_files/nova_virtnodedevd.json:
command: /usr/sbin/virtnodedevd --config /etc/libvirt/virtnodedevd.conf command: /usr/sbin/virtnodedevd --config /etc/libvirt/virtnodedevd.conf
config_files: {get_attr: [VirtCommon, kolla_config_files]} config_files: {get_attr: [NovaLibvirtCommon, kolla_config_files]}
permissions: {get_attr: [VirtCommon, kolla_permissions]} permissions: {get_attr: [NovaLibvirtCommon, kolla_permissions]}
/var/lib/kolla/config_files/nova_virtstoraged.json: /var/lib/kolla/config_files/nova_virtstoraged.json:
command: /usr/sbin/virtstoraged --config /etc/libvirt/virtstoraged.conf command: /usr/sbin/virtstoraged --config /etc/libvirt/virtstoraged.conf
config_files: {get_attr: [VirtCommon, kolla_config_files]} config_files: {get_attr: [NovaLibvirtCommon, kolla_config_files]}
permissions: {get_attr: [VirtCommon, kolla_permissions]} permissions: {get_attr: [NovaLibvirtCommon, kolla_permissions]}
/var/lib/kolla/config_files/nova_virtqemud.json: /var/lib/kolla/config_files/nova_virtqemud.json:
command: /usr/sbin/virtqemud --config /etc/libvirt/virtqemud.conf command: /usr/sbin/virtqemud --config /etc/libvirt/virtqemud.conf
config_files: {get_attr: [VirtCommon, kolla_config_files]} config_files: {get_attr: [NovaLibvirtCommon, kolla_config_files]}
permissions: {get_attr: [VirtCommon, kolla_permissions]} permissions: {get_attr: [NovaLibvirtCommon, kolla_permissions]}
/var/lib/kolla/config_files/nova_virtproxyd.json: /var/lib/kolla/config_files/nova_virtproxyd.json:
command: /usr/sbin/virtproxyd --config /etc/libvirt/virtproxyd.conf command: /usr/sbin/virtproxyd --config /etc/libvirt/virtproxyd.conf
config_files: {get_attr: [VirtCommon, kolla_config_files]} config_files: {get_attr: [NovaLibvirtCommon, kolla_config_files]}
permissions: {get_attr: [VirtCommon, kolla_permissions]} permissions: {get_attr: [NovaLibvirtCommon, kolla_permissions]}
container_config_scripts: container_config_scripts:
nova_libvirt_init_secret.sh: nova_libvirt_init_secret.sh:
mode: "0755" mode: "0755"
@ -563,7 +562,7 @@ outputs:
list_concat: list_concat:
- {get_attr: [ContainersCommon, volumes]} - {get_attr: [ContainersCommon, volumes]}
- {get_attr: [NovaLibvirtLogging, volumes]} - {get_attr: [NovaLibvirtLogging, volumes]}
- {get_attr: [VirtCommon, volumes]} - {get_attr: [NovaLibvirtCommon, volumes]}
- - /var/lib/kolla/config_files/nova_virtlogd.json:/var/lib/kolla/config_files/config.json:ro - - /var/lib/kolla/config_files/nova_virtlogd.json:/var/lib/kolla/config_files/config.json:ro
- if: - if:
- {get_param: NovaEnableVirtlogdContainerWrapper} - {get_param: NovaEnableVirtlogdContainerWrapper}
@ -593,7 +592,7 @@ outputs:
list_concat: list_concat:
- {get_attr: [ContainersCommon, volumes]} - {get_attr: [ContainersCommon, volumes]}
- {get_attr: [NovaLibvirtLogging, volumes]} - {get_attr: [NovaLibvirtLogging, volumes]}
- {get_attr: [VirtCommon, volumes]} - {get_attr: [NovaLibvirtCommon, volumes]}
- {get_attr: [RoleParametersValue, value, nova_libvirt_opt_volumes]} - {get_attr: [RoleParametersValue, value, nova_libvirt_opt_volumes]}
- - /var/lib/kolla/config_files/nova_virtsecretd.json:/var/lib/kolla/config_files/config.json:ro - - /var/lib/kolla/config_files/nova_virtsecretd.json:/var/lib/kolla/config_files/config.json:ro
- nova_virtnodedevd: - nova_virtnodedevd:
@ -618,7 +617,7 @@ outputs:
list_concat: list_concat:
- {get_attr: [ContainersCommon, volumes]} - {get_attr: [ContainersCommon, volumes]}
- {get_attr: [NovaLibvirtLogging, volumes]} - {get_attr: [NovaLibvirtLogging, volumes]}
- {get_attr: [VirtCommon, volumes]} - {get_attr: [NovaLibvirtCommon, volumes]}
- {get_attr: [RoleParametersValue, value, nova_libvirt_opt_volumes]} - {get_attr: [RoleParametersValue, value, nova_libvirt_opt_volumes]}
- - /var/lib/kolla/config_files/nova_virtnodedevd.json:/var/lib/kolla/config_files/config.json:ro - - /var/lib/kolla/config_files/nova_virtnodedevd.json:/var/lib/kolla/config_files/config.json:ro
- nova_virtstoraged: - nova_virtstoraged:
@ -643,7 +642,7 @@ outputs:
list_concat: list_concat:
- {get_attr: [ContainersCommon, volumes]} - {get_attr: [ContainersCommon, volumes]}
- {get_attr: [NovaLibvirtLogging, volumes]} - {get_attr: [NovaLibvirtLogging, volumes]}
- {get_attr: [VirtCommon, volumes]} - {get_attr: [NovaLibvirtCommon, volumes]}
- {get_attr: [RoleParametersValue, value, nova_libvirt_opt_volumes]} - {get_attr: [RoleParametersValue, value, nova_libvirt_opt_volumes]}
- - /var/lib/kolla/config_files/nova_virtstoraged.json:/var/lib/kolla/config_files/config.json:ro - - /var/lib/kolla/config_files/nova_virtstoraged.json:/var/lib/kolla/config_files/config.json:ro
- nova_virtqemud: - nova_virtqemud:
@ -668,7 +667,7 @@ outputs:
list_concat: list_concat:
- {get_attr: [ContainersCommon, volumes]} - {get_attr: [ContainersCommon, volumes]}
- {get_attr: [NovaLibvirtLogging, volumes]} - {get_attr: [NovaLibvirtLogging, volumes]}
- {get_attr: [VirtCommon, volumes]} - {get_attr: [NovaLibvirtCommon, volumes]}
- {get_attr: [RoleParametersValue, value, nova_libvirt_opt_volumes]} - {get_attr: [RoleParametersValue, value, nova_libvirt_opt_volumes]}
- - /var/lib/kolla/config_files/nova_virtqemud.json:/var/lib/kolla/config_files/config.json:ro - - /var/lib/kolla/config_files/nova_virtqemud.json:/var/lib/kolla/config_files/config.json:ro
- nova_virtproxyd: - nova_virtproxyd:
@ -693,7 +692,7 @@ outputs:
list_concat: list_concat:
- {get_attr: [ContainersCommon, volumes]} - {get_attr: [ContainersCommon, volumes]}
- {get_attr: [NovaLibvirtLogging, volumes]} - {get_attr: [NovaLibvirtLogging, volumes]}
- {get_attr: [VirtCommon, volumes]} - {get_attr: [NovaLibvirtCommon, volumes]}
- {get_attr: [RoleParametersValue, value, nova_libvirt_opt_volumes]} - {get_attr: [RoleParametersValue, value, nova_libvirt_opt_volumes]}
- - /var/lib/kolla/config_files/nova_virtproxyd.json:/var/lib/kolla/config_files/config.json:ro - - /var/lib/kolla/config_files/nova_virtproxyd.json:/var/lib/kolla/config_files/config.json:ro
step_4: step_4: