7 Commits

Author SHA1 Message Date
Takashi Kajinami
e192c9c789 Remove unnecessary class dependencies
Some classes require nova::compute::libvirt but there is no need to
put that class into dependencies because resource orders are defined
by deps or explicit definitions. Also, the base libvirt class is not
really required.

This change removes these dependencies, to avoid enforcing orders as
much as possible.

Change-Id: Icbb2fa209effd355cef36f35662bfdcf18d8b090
2022-06-25 15:54:31 +00:00
Takashi Kajinami
fe790906a6 Update unit tests for nova::compute::libvirt_guests
CentOS 6 and 7 are no longer supported. Update the test cases to cover
supported versions.

Change-Id: Ie702c0e33ee394e6dde5a5c54aad7ea8806299dd
2022-06-01 14:54:21 +09:00
Takashi Kajinami
aa2db56179 Do not define service resource when service management is disabled
Change-Id: I78662bd9579f3e920f0a08cf9cd27de1defb02aa
2022-02-11 00:14:40 +09:00
Alfredo Moralejo
99830f8a2d CentOS: Ensure /etc/sysconfig/libvirtd(-guests) exists
Last build of libvirt in CentOS9 has removed default config files in
/etc/sysconfig . This is making some file_line resources to fail as
the original files no longer exist.

This patch is creating empty files if the target files don't exist, so
that this is compatible with centos8 and centos9 (before and after
default config files removal).

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2042529

Closes-Bug: #1959601
Change-Id: Iff9daf3d284c725d40ecfb85500d77951c3fefcd
2022-02-01 23:07:05 +09:00
Takashi Kajinami
4b553afc8c Avoid usage of custom os_package_type fact
Currently the os_package_type fact is used to distinguish Ubuntu and
Debian but it's redundant and built-in $::operatingsystem should be
enough. What is worse the custom fact is not injected while composing
facts data in unit tests and has never been tested properly.

Change-Id: Ie1d6006020970ade3e1597dc9f68f9a5503283b4
2021-11-05 09:15:22 +09:00
Martin Schuppert
0e1da12265 Don't restart libvirt-guests on config change
When there is a config change the service gets notfied to be
restarted, which is not required as /usr/libexec/libvirt-guests.sh
sources /etc/sysconfig/libvirt-guests on each run. As a side
effect of the service restart, instances get stopped which is bad.

In addition manage_service was bound to the enabled parameter.
This introduces manage_service to be able to manage start/stop
independent from enabled parameter.

Change-Id: Icf52a2272601401c423ae07f7b10474bdc190574
Closes-Bug: #1849264
2019-10-22 15:34:43 +02:00
Martin Schuppert
df325e8f6d Add functionality to manage /etc/sysconfig/libvirt-guests
If resume_guests_state_on_host_boot is set in nova.conf also
libvirt-guests need to be configured in the right way to shutdown
running instances on a compute reboot.

Closes-bug: 1778216
Change-Id: I2766cdd66ff17756daaf1a75ad516a7af6eebddc
2018-07-05 15:33:49 +02:00