Add other virt services

This change adds the management of virtlockd and virtlogd services
to the nova::compute::libvirt. These services are actually required
for nova to be able to communicate correctly with libvirt.  Virtlockd
exists for RedHat and Ubuntu but is not currently available under
Debian. Virtlogd is Ubuntu specific service that is usually started
automatically on install of the libvirt package. However if you
disable that or some how prevent it from running, then it may
interfere with nova.  We should explicitly manage them since they
are required.

Change-Id: I52c6609e547fa50dccb4b31b9d93748b2b02dee0
This commit is contained in:
Alex Schultz 2016-04-15 20:39:01 -06:00
parent 48815a3bb2
commit 465a1a7a35
4 changed files with 58 additions and 0 deletions

View File

@ -93,6 +93,14 @@
# (optional) libvirt service name.
# Defaults to $::nova::params::libvirt_service_name
#
# [*virtlock_service_name*]
# (optional) virtlock service name.
# Defaults to $::nova::params::virtlock_service_name
#
# [*virtlog_service_name*]
# (optional) virtlog service name.
# Defaults to $::nova::params::virtlog_service_name
#
# [*compute_driver*]
# (optional) Compute driver.
# Defaults to 'libvirt.LibvirtDriver'
@ -114,6 +122,8 @@ class nova::compute::libvirt (
$remove_unused_resized_minimum_age_seconds = undef,
$remove_unused_original_minimum_age_seconds = undef,
$libvirt_service_name = $::nova::params::libvirt_service_name,
$virtlock_service_name = $::nova::params::virtlock_service_name,
$virtlog_service_name = $::nova::params::virtlog_service_name,
$compute_driver = 'libvirt.LibvirtDriver'
) inherits nova::params {
@ -194,6 +204,26 @@ class nova::compute::libvirt (
require => Package['libvirt'],
}
if $virtlock_service_name {
service { 'virtlockd':
ensure => running,
enable => true,
name => $virtlock_service_name,
provider => $::nova::params::special_service_provider,
require => Package['libvirt']
}
}
if $virtlog_service_name {
service { 'virtlogd':
ensure => running,
enable => true,
name => $virtlog_service_name,
provider => $::nova::params::special_service_provider,
require => Package['libvirt']
}
}
nova_config {
'DEFAULT/compute_driver': value => $compute_driver;
'vnc/vncserver_listen': value => $vncserver_listen;

View File

@ -36,6 +36,8 @@ class nova::params {
$conductor_service_name = 'openstack-nova-conductor'
$consoleauth_service_name = 'openstack-nova-consoleauth'
$libvirt_service_name = 'libvirtd'
$virtlock_service_name = 'virtlockd'
$virtlog_service_name = undef
$network_service_name = 'openstack-nova-network'
$objectstore_service_name = 'openstack-nova-objectstore'
$scheduler_service_name = 'openstack-nova-scheduler'
@ -113,6 +115,8 @@ class nova::params {
# Use default provider on Debian
$special_service_provider = undef
$libvirt_service_name = 'libvirtd'
$virtlock_service_name = undef
$virtlog_service_name = undef
}
default: {
$spicehtml5proxy_package_name = 'nova-spiceproxy'
@ -121,6 +125,8 @@ class nova::params {
# some of the services need to be started form the special upstart provider
$special_service_provider = 'upstart'
$libvirt_service_name = 'libvirt-bin'
$virtlock_service_name = 'virtlockd'
$virtlog_service_name = 'virtlogd'
}
}
}

View File

@ -0,0 +1,9 @@
---
fixes:
- Manage virtlockd and virtlogd services as part of
the nova::compute::libvirt as they are needed for
nova. The virtlockd service is currently managed
for RedHat and Ubuntu but skipped under Debian.
The virtlogd service is Ubuntu specific but can
be managed if the virtlog_service_name is provided
to the nova::compute::libvirt class.

View File

@ -66,6 +66,8 @@ describe 'nova::compute::libvirt' do
:remove_unused_resized_minimum_age_seconds => 3600,
:remove_unused_original_minimum_age_seconds => 3600,
:libvirt_service_name => 'custom_service',
:virtlock_service_name => 'virtlock',
:virtlog_service_name => 'virtlog',
:compute_driver => 'libvirt.FoobarDriver',
}
end
@ -92,6 +94,17 @@ describe 'nova::compute::libvirt' do
:ensure => 'running',
:before => ['Service[nova-compute]']
)
is_expected.to contain_service('virtlockd').with(
:name => 'virtlock',
:enable => true,
:ensure => 'running'
)
is_expected.to contain_service('virtlogd').with(
:name => 'virtlog',
:enable => true,
:ensure => 'running'
)
}
end