Make sure lvm2 package is installed

lvm volume recipe makes use of lvm commands like vgcreate. These
commands are part of the lvm2 package which may not be a
dependency for the base openstack cinder packages anymore. So,
make sure this get installed before using those commands.

Change-Id: I75f47260677b409ff32c4b2c6fc5598a31214ecf
Closes-Bug: #1435968
This commit is contained in:
Mark Vanderwiel 2015-03-24 11:58:28 -05:00 committed by Ma Wen Cheng
parent 440f32f4fb
commit 98688befe1
3 changed files with 14 additions and 0 deletions

View File

@ -336,6 +336,7 @@ when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
'cinder_nfs_packages' => ['nfs-utils', 'nfs-utils-lib'],
'cinder_emc_packages' => ['pywbem'],
'cinder_svc_packages' => ['sysfsutils'],
'cinder_lvm_packages' => ['lvm2'],
'cinder_flashsystem_packages' => ['sysfsutils'],
'package_overrides' => ''
}
@ -358,6 +359,7 @@ when 'suse'
'cinder_nfs_packages' => ['nfs-utils'],
'cinder_emc_packages' => ['python-pywbem'],
'cinder_svc_packages' => ['sysfsutils'],
'cinder_lvm_packages' => ['lvm2'],
'cinder_flashsystem_packages' => ['sysfsutils']
}
when 'debian'
@ -379,6 +381,7 @@ when 'debian'
'cinder_nfs_packages' => ['nfs-common'],
'cinder_emc_packages' => ['python-pywbem'],
'cinder_svc_packages' => ['sysfsutils'],
'cinder_lvm_packages' => ['lvm2'],
'cinder_flashsystem_packages' => ['sysfsutils'],
'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'"
}

View File

@ -171,6 +171,13 @@ when 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver'
when 'cinder.volume.drivers.lvm.LVMISCSIDriver'
platform_options['cinder_lvm_packages'].each do |pkg|
package pkg do
options platform_options['package_overrides']
action :upgrade
end
end
if node['openstack']['block-storage']['volume']['create_volume_group']
vg_name = node['openstack']['block-storage']['volume']['volume_group']

View File

@ -243,6 +243,10 @@ describe 'openstack-block-storage::volume' do
stub_command('vgs cinder-volumes').and_return(false)
end
it 'upgrades lvm packages' do
expect(chef_run).to upgrade_package 'lvm2'
end
it 'cinder vg active' do
expect(chef_run).to enable_service 'cinder-group-active'
end