Settings for libvirt's guest handling in CentOS.

$libvirt_guest_on_boot
    Action to taken on host boot [start, ignore] (default: start)

$libvirt_guest_on_shutdown
    Action to taken on host shutdown [suspend, shutdown] (default: suspend)

$libvirt_parallel_shutdown
    If set to non-zero, shutdown will suspend guests concurrently. (default: 0)
This commit is contained in:
Ossi Herrala 2012-11-08 08:58:20 +00:00
parent 5ff240ed4e
commit f05ec860ed
2 changed files with 75 additions and 4 deletions

View file

@ -35,8 +35,33 @@ class libvirt::client {
# $libvirt_admingroup:
# Group which has access to system libvirtd.
#
# $libvirt_guest_on_boot
# Action to taken on host boot [start, ignore] (default: start)
#
# $libvirt_guest_on_shutdown
# Action to taken on host shutdown [suspend, shutdown] (default: suspend)
#
# $libvirt_parallel_shutdown
# If set to non-zero, shutdown will suspend guests concurrently. (default: 0)
#
class libvirt::kvm inherits libvirt::client {
if !$libvirt_admingroup {
$libvirt_admingroup = "root"
}
if !$libvirt_guest_on_boot {
$libvirt_guest_on_boot = "start"
}
if !$libvirt_guest_on_shutdown {
$libvirt_guest_on_shutdown = "suspend"
}
if !$libvirt_parallel_shutdown {
$libvirt_parallel_shutdown = 0
}
case $operatingsystem {
centos,fedora: {
case $operatingsystemrelease {
@ -58,16 +83,21 @@ class libvirt::kvm inherits libvirt::client {
}
}
}
file { "/etc/sysconfig/libvirt-guests":
ensure => present,
mode => "0644",
owner => "root",
group => "root",
content => template("libvirt/sysconfig-libvirt-guests.erb"),
require => Package["libvirt"],
notify => Service["libvirtd"],
}
}
default: {
fail("Operating system not supported")
}
}
if !$libvirt_admingroup {
$libvirt_admingroup = "root"
}
file { "/etc/libvirt/libvirtd.conf":
ensure => present,
mode => "0644",