Merge "Fix missing notifications about virt*d services"

This commit is contained in:
Zuul
2022-05-11 19:01:52 +00:00
committed by Gerrit Code Review
10 changed files with 63 additions and 71 deletions

View File

@@ -105,8 +105,9 @@ class nova::compute::libvirt::services (
ensure => $libvirt_service_ensure, ensure => $libvirt_service_ensure,
enable => $libvirt_service_enable, enable => $libvirt_service_enable,
name => $libvirt_service_name, name => $libvirt_service_name,
require => Anchor['nova::install::end'], tag => 'libvirt-service',
} }
Libvirtd_config<||> ~> Service['libvirt']
# messagebus # messagebus
if($::osfamily == 'RedHat') { if($::osfamily == 'RedHat') {
@@ -114,8 +115,8 @@ class nova::compute::libvirt::services (
ensure => running, ensure => running,
enable => true, enable => true,
name => $::nova::params::messagebus_service_name, name => $::nova::params::messagebus_service_name,
tag => 'libvirt-service',
} }
Package['libvirt'] -> Service['messagebus']
} }
} }
@@ -124,8 +125,8 @@ class nova::compute::libvirt::services (
ensure => running, ensure => running,
enable => true, enable => true,
name => $virtlock_service_name, name => $virtlock_service_name,
tag => 'libvirt-service',
} }
Package<| title == 'libvirt' |> -> Service['virtlockd']
} }
if $virtlog_service_name { if $virtlog_service_name {
@@ -133,8 +134,9 @@ class nova::compute::libvirt::services (
ensure => running, ensure => running,
enable => true, enable => true,
name => $virtlog_service_name, name => $virtlog_service_name,
tag => 'libvirt-service',
} }
Package<| title == 'libvirt' |> -> Service['virtlogd'] Virtlogd_config<||> ~> Service['libvirt']
} }
if ! $modular_libvirt { if ! $modular_libvirt {
@@ -157,43 +159,46 @@ class nova::compute::libvirt::services (
if $virtsecret_service_name { if $virtsecret_service_name {
package { 'virtsecret': package { 'virtsecret':
ensure => present, ensure => present,
name => "${::nova::params::libvirt_daemon_package_prefix}driver-secret" name => "${::nova::params::libvirt_daemon_package_prefix}driver-secret",
tag => ['openstack', 'nova-support-package'],
} }
service { 'virtsecretd': service { 'virtsecretd':
ensure => running, ensure => running,
enable => true, enable => true,
name => $virtsecret_service_name, name => $virtsecret_service_name,
require => Package['virtsecret'], tag => ['libvirt-service', 'libvirt-modular-service'],
tag => 'libvirt-modular-service',
} }
Virtsecretd_config<||> ~> Service['virtlogd']
} }
if $virtnodedev_service_name { if $virtnodedev_service_name {
package { 'virtnodedev': package { 'virtnodedev':
ensure => present, ensure => present,
name => "${::nova::params::libvirt_daemon_package_prefix}driver-nodedev" name => "${::nova::params::libvirt_daemon_package_prefix}driver-nodedev",
tag => ['openstack', 'nova-support-package'],
} }
service { 'virtnodedevd': service { 'virtnodedevd':
ensure => running, ensure => running,
enable => true, enable => true,
name => $virtnodedev_service_name, name => $virtnodedev_service_name,
require => Package['virtnodedev'], tag => ['libvirt-service', 'libvirt-modular-service'],
tag => 'libvirt-modular-service',
} }
Virtnodedevd_config<||> ~> Service['virtlogd']
} }
if $virtqemu_service_name { if $virtqemu_service_name {
package { 'virtqemu': package { 'virtqemu':
ensure => present, ensure => present,
name => "${::nova::params::libvirt_daemon_package_prefix}driver-qemu" name => "${::nova::params::libvirt_daemon_package_prefix}driver-qemu",
tag => ['openstack', 'nova-support-package'],
} }
service { 'virtqemud': service { 'virtqemud':
ensure => running, ensure => running,
enable => true, enable => true,
name => $virtqemu_service_name, name => $virtqemu_service_name,
require => Package['virtqemu'], tag => ['libvirt-service', 'libvirt-modular-service'],
tag => 'libvirt-modular-service',
} }
Virtqemud_config<||> ~> Service['virtlogd']
} }
if $virtproxy_service_name { if $virtproxy_service_name {
@@ -201,23 +206,24 @@ class nova::compute::libvirt::services (
ensure => running, ensure => running,
enable => true, enable => true,
name => $virtproxy_service_name, name => $virtproxy_service_name,
tag => 'libvirt-modular-service', tag => ['libvirt-service', 'libvirt-modular-service'],
} }
Package<| title == 'libvirt' |> -> Service['virtproxyd'] Virtproxyd_config<||> ~> Service['virtlogd']
} }
if $virtstorage_service_name { if $virtstorage_service_name {
package { 'virtstorage': package { 'virtstorage':
ensure => present, ensure => present,
name => "${::nova::params::libvirt_daemon_package_prefix}driver-storage" name => "${::nova::params::libvirt_daemon_package_prefix}driver-storage",
tag => ['openstack', 'nova-support-package'],
} }
service { 'virtstoraged': service { 'virtstoraged':
ensure => running, ensure => running,
enable => true, enable => true,
name => $virtstorage_service_name, name => $virtstorage_service_name,
require => Package['virtstorage'], tag => ['libvirt-service', 'libvirt-modular-service'],
tag => 'libvirt-modular-service', }
} Virtstoraged_config<||> ~> Service['virtlogd']
} }
} }
} }

View File

@@ -58,8 +58,4 @@ class nova::compute::libvirt::virtlogd (
'max_size': value => pick($max_size, $::os_service_default); 'max_size': value => pick($max_size, $::os_service_default);
'max_backups': value => pick($max_backups, $::os_service_default); 'max_backups': value => pick($max_backups, $::os_service_default);
} }
Anchor['nova::config::begin']
-> Virtlogd_config<||>
-> Anchor['nova::config::end']
} }

View File

@@ -52,8 +52,4 @@ class nova::compute::libvirt::virtnodedevd (
'admin_max_clients': value => $admin_max_clients; 'admin_max_clients': value => $admin_max_clients;
'ovs_timeout': value => $ovs_timeout; 'ovs_timeout': value => $ovs_timeout;
} }
Anchor['nova::config::begin']
-> Virtnodedevd_config<||>
-> Anchor['nova::config::end']
} }

View File

@@ -61,8 +61,4 @@ class nova::compute::libvirt::virtproxyd (
'ovs_timeout': value => $ovs_timeout; 'ovs_timeout': value => $ovs_timeout;
'tls_priority': value => $tls_priority, quote => true; 'tls_priority': value => $tls_priority, quote => true;
} }
Anchor['nova::config::begin']
-> Virtproxyd_config<||>
-> Anchor['nova::config::end']
} }

View File

@@ -53,8 +53,4 @@ class nova::compute::libvirt::virtqemud (
'admin_max_clients': value => $admin_max_clients; 'admin_max_clients': value => $admin_max_clients;
'ovs_timeout': value => $ovs_timeout; 'ovs_timeout': value => $ovs_timeout;
} }
Anchor['nova::config::begin']
-> Virtqemud_config<||>
-> Anchor['nova::config::end']
} }

View File

@@ -52,8 +52,4 @@ class nova::compute::libvirt::virtsecretd (
'admin_max_clients': value => $admin_max_clients; 'admin_max_clients': value => $admin_max_clients;
'ovs_timeout': value => $ovs_timeout; 'ovs_timeout': value => $ovs_timeout;
} }
Anchor['nova::config::begin']
-> Virtsecretd_config<||>
-> Anchor['nova::config::end']
} }

View File

@@ -38,9 +38,5 @@ class nova::compute::libvirt::virtstoraged (
'log_outputs': value => $log_outputs, quote => true; 'log_outputs': value => $log_outputs, quote => true;
'ovs_timeout': value => $ovs_timeout; 'ovs_timeout': value => $ovs_timeout;
} }
Anchor['nova::config::begin']
-> Virtstoraged_config<||>
-> Anchor['nova::config::end']
} }

View File

@@ -58,6 +58,20 @@ class nova::deps {
-> Package<| tag == 'nova-support-package'|> -> Package<| tag == 'nova-support-package'|>
-> Anchor['nova::install::end'] -> Anchor['nova::install::end']
# Start libvirt services during the service phase
Anchor['nova::service::begin']
-> Service<| tag == 'libvirt-service'|>
-> Anchor['nova::service::end']
# Manage libvirt configurations during the config phase
Anchor['nova::config::begin'] -> Libvirtd_config<||> -> Anchor['nova::config::end']
Anchor['nova::config::begin'] -> Virtlogd_config<||> -> Anchor['nova::config::end']
Anchor['nova::config::begin'] -> Virtnodedevd_config<||> -> Anchor['nova::config::end']
Anchor['nova::config::begin'] -> Virtproxyd_config<||> -> Anchor['nova::config::end']
Anchor['nova::config::begin'] -> Virtqemud_config<||> -> Anchor['nova::config::end']
Anchor['nova::config::begin'] -> Virtsecretd_config<||> -> Anchor['nova::config::end']
Anchor['nova::config::begin'] -> Virtstoraged_config<||> -> Anchor['nova::config::end']
# all cache settings should be applied and all packages should be installed # all cache settings should be applied and all packages should be installed
# before service startup # before service startup
Oslo::Cache<||> -> Anchor['nova::service::begin'] Oslo::Cache<||> -> Anchor['nova::service::begin']

View File

@@ -221,14 +221,10 @@ class nova::migration::libvirt(
if $configure_libvirt { if $configure_libvirt {
Anchor['nova::config::begin'] Anchor['nova::config::begin']
-> Libvirtd_config<||>
-> File<| tag == 'libvirt-file'|> -> File<| tag == 'libvirt-file'|>
-> File_line<| tag == 'libvirt-file_line'|> -> File_line<| tag == 'libvirt-file_line'|>
-> Anchor['nova::config::end'] -> Anchor['nova::config::end']
Libvirtd_config<||>
~> Service['libvirt']
File_line<| tag == 'libvirt-file_line' |> File_line<| tag == 'libvirt-file_line' |>
~> Service['libvirt'] ~> Service['libvirt']

View File

@@ -162,7 +162,7 @@ describe 'nova::compute::libvirt' do
:name => 'custom_service', :name => 'custom_service',
:enable => true, :enable => true,
:ensure => 'running', :ensure => 'running',
:before => ['Service[nova-compute]'] :before => ['Anchor[nova::service::end]', 'Service[nova-compute]']
) )
is_expected.to contain_service('virtlockd').with( is_expected.to contain_service('virtlockd').with(
:name => 'virtlock', :name => 'virtlock',
@@ -266,12 +266,12 @@ describe 'nova::compute::libvirt' do
:name => 'libvirtd', :name => 'libvirtd',
:enable => true, :enable => true,
:ensure => 'running', :ensure => 'running',
:before => ['Service[nova-compute]'], :before => ['Anchor[nova::service::end]', 'Service[nova-compute]'],
)} )}
it { is_expected.to contain_service('messagebus').with( it { is_expected.to contain_service('messagebus').with(
:ensure => 'running', :ensure => 'running',
:enable => true, :enable => true,
:before => ['Service[libvirt]'], :before => ['Anchor[nova::service::end]', 'Service[libvirt]'],
:name => 'dbus' :name => 'dbus'
) } ) }