hypervisor: disable NBD dependancy

- Disable the kernel module load
- Configure Nova to not use NBD driver injection, since we use
  Cloud-init now to inject keys.
- Update unit tests
This commit is contained in:
Emilien Macchi 2014-04-15 14:24:21 +02:00
parent 9fcc32e5aa
commit f7d140b0e9
2 changed files with 7 additions and 21 deletions

View File

@ -44,15 +44,6 @@ class cloud::compute::hypervisor(
include 'cloud::telemetry'
include 'cloud::network'
exec { 'insert_module_nbd':
command => '/bin/echo "nbd" > /etc/modules',
unless => '/bin/grep "nbd" /etc/modules',
}
exec { '/sbin/modprobe nbd':
unless => '/bin/grep -q "^nbd " "/proc/modules"'
}
file{ '/var/lib/nova/.ssh':
ensure => directory,
mode => '0700',
@ -130,13 +121,6 @@ Host *
'DEFAULT/rbd_secret_uuid': value => $nova_rbd_secret_uuid;
}
# Extra config for nova-compute
nova_config {
'DEFAULT/libvirt_inject_key': value => false;
'DEFAULT/libvirt_inject_partition': value => '-2';
'DEFAULT/live_migration_flag': value => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST';
}
File <<| tag == 'ceph_compute_secret_file' |>>
Exec <<| tag == 'get_or_set_virsh_secret' |>>
Exec <<| tag == 'set_secret_value_virsh' |>>
@ -175,6 +159,13 @@ Host *
libvirt_disk_cachemodes => $libvirt_disk_cachemodes_real
}
# Extra config for nova-compute
nova_config {
'DEFAULT/libvirt_inject_key': value => false;
'DEFAULT/libvirt_inject_partition': value => '-2';
'DEFAULT/live_migration_flag': value => 'VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST';
}
class { 'ceilometer::agent::compute': }
}

View File

@ -192,11 +192,6 @@ describe 'cloud::compute::hypervisor' do
)
end
it 'insert and activate nbd module' do
should contain_exec('insert_module_nbd').with('command' => '/bin/echo "nbd" > /etc/modules', 'unless' => '/bin/grep "nbd" /etc/modules')
should contain_exec('/sbin/modprobe nbd').with('unless' => '/bin/grep -q "^nbd " "/proc/modules"')
end
it 'configure nova-compute' do
should contain_class('nova::compute').with(
:enabled => true,