From f0227c71b1b9694560fcf845fa2b47d4eeee8b05 Mon Sep 17 00:00:00 2001 From: Ivan Chavero Date: Sun, 10 Aug 2014 22:33:25 -0600 Subject: [PATCH] Disable file injection when using RBD as compute ephemeral storage When using Ceph/RBD as ephemeral storage for Nova compute, it is recommended by Inktank to disable file injection. See: http://ceph.com/docs/next/rbd/rbd-openstack/ Change-Id: I73e016e861ef8b0aead840fa7c519f58068074df --- manifests/compute/libvirt.pp | 20 ++++++++++++++++++++ spec/classes/nova_compute_libvirt_spec.rb | 6 ++++++ 2 files changed, 26 insertions(+) diff --git a/manifests/compute/libvirt.pp b/manifests/compute/libvirt.pp index 37df7761e..2af2455d7 100644 --- a/manifests/compute/libvirt.pp +++ b/manifests/compute/libvirt.pp @@ -30,6 +30,20 @@ # will be removed from nova.conf completely. # Defaults to an empty list # +# [*libvirt_inject_password*] +# (optional) Inject the admin password at boot time, without an agent. +# Defaults to false +# +# [*libvirt_inject_key*] +# (optional) Inject the ssh public key at boot time. +# Defaults to false +# +# [*libvirt_inject_partition*] +# (optional) The partition to inject to : -2 => disable, -1 => inspect +# (libguestfs only), 0 => not partitioned, >0 => partition +# number (integer value) +# Defaults to -2 +# # [*remove_unused_base_images*] # (optional) Should unused base images be removed? # If undef is specified, remove the line in nova.conf @@ -70,6 +84,9 @@ class nova::compute::libvirt ( $migration_support = false, $libvirt_cpu_mode = false, $libvirt_disk_cachemodes = [], + $libvirt_inject_password = false, + $libvirt_inject_key = false, + $libvirt_inject_partition = -2, $remove_unused_base_images = undef, $remove_unused_kernels = undef, $remove_unused_resized_minimum_age_seconds = undef, @@ -140,6 +157,9 @@ class nova::compute::libvirt ( 'DEFAULT/vncserver_listen': value => $vncserver_listen; 'libvirt/virt_type': value => $libvirt_virt_type; 'libvirt/cpu_mode': value => $libvirt_cpu_mode_real; + 'libvirt/inject_password': value => $libvirt_inject_password; + 'libvirt/inject_key': value => $libvirt_inject_key; + 'libvirt/inject_partition': value => $libvirt_inject_partition; } if size($libvirt_disk_cachemodes) > 0 { diff --git a/spec/classes/nova_compute_libvirt_spec.rb b/spec/classes/nova_compute_libvirt_spec.rb index b4d957e47..049d13477 100644 --- a/spec/classes/nova_compute_libvirt_spec.rb +++ b/spec/classes/nova_compute_libvirt_spec.rb @@ -38,6 +38,9 @@ describe 'nova::compute::libvirt' do it { should contain_nova_config('libvirt/virt_type').with_value('kvm')} it { should contain_nova_config('libvirt/cpu_mode').with_value('host-model')} it { should contain_nova_config('libvirt/disk_cachemodes').with_ensure('absent')} + it { should contain_nova_config('libvirt/inject_password').with_value(false)} + it { should contain_nova_config('libvirt/inject_key').with_value(false)} + it { should contain_nova_config('libvirt/inject_partition').with_value(-2)} it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')} it { should contain_nova_config('DEFAULT/remove_unused_base_images').with_ensure('absent')} it { should contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_ensure('absent')} @@ -158,6 +161,9 @@ describe 'nova::compute::libvirt' do it { should contain_nova_config('DEFAULT/compute_driver').with_value('libvirt.LibvirtDriver')} it { should contain_nova_config('libvirt/virt_type').with_value('kvm')} + it { should contain_nova_config('libvirt/inject_password').with_value(false)} + it { should contain_nova_config('libvirt/inject_key').with_value(false)} + it { should contain_nova_config('libvirt/inject_partition').with_value(-2)} it { should contain_nova_config('DEFAULT/vncserver_listen').with_value('127.0.0.1')} it { should contain_nova_config('DEFAULT/remove_unused_base_images').with_ensure('absent')} it { should contain_nova_config('DEFAULT/remove_unused_original_minimum_age_seconds').with_ensure('absent')}