Add a boot delay to ensure a good detection of all LVM

This commit is contained in:
gardouille 2016-09-06 14:39:56 +02:00
parent fd092dd23b
commit 7ed2cb9abb
4 changed files with 26 additions and 0 deletions

View File

@ -53,6 +53,9 @@ class proxmox4::hypervisor (
$pve_modules_list = $proxmox4::params::pve_modules_list,
$pve_modules_file_path = $proxmox4::params::pve_modules_file_path,
$pve_modules_file_content = $proxmox4::params::pve_modules_file_content,
$pve_lvm_delay = $proxmox4::params::pve_lvm_delay,
$init_lvm_script_path = $proxmox4::params::init_lvm_script_path,
$init_lvm_script_content = $proxmox4::params::init_lvm_script_content,
$labs_firewall_rule = $proxmox4::params::labs_firewall_rule,
$cluster_master_ip = undef,
$cluster_name = undef,

View File

@ -59,4 +59,13 @@ class proxmox4::hypervisor::preconfig {
require => File['/etc/modules-load.d'],
}
# Add a delay at boot to allow a good LVM detection
if $proxmox4::hypervisor::pve_lvm_delay == true {
file { $proxmox4::params::init_lvm_script_path:
ensure => present,
content => template($proxmox4::hypervisor::init_lvm_script_content),
}
}
} # Private class: proxmox4::hypervisor::preconfig

View File

@ -36,6 +36,11 @@ class proxmox4::params {
$pve_modules_file_path = '/etc/modules-load.d/proxmox.conf'
$pve_modules_file_content = 'proxmox4/hypervisor/proxmox_modules.conf.erb'
# Boot
$pve_lvm_delay = true
$init_lvm_script_path = '/etc/initramfs-tools/scripts/local-top/lvm-manual'
$init_lvm_script_content = 'proxmox4/hypervisor/initramfs-lvm-manual.erb'
# Firewall
$labs_firewall_rule = false

View File

@ -0,0 +1,9 @@
# Ensure to detect all LV
/sbin/lvm pvscan
/sbin/lvm vgscan
/sbin/lvm vgchange -ay
echo "Wait for 2s"
sleep 2
exit 0