Browse Source

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
Mark Vanderwiel 4 years ago
parent
commit
98688befe1
3 changed files with 14 additions and 0 deletions
  1. 3
    0
      attributes/default.rb
  2. 7
    0
      recipes/volume.rb
  3. 4
    0
      spec/volume_spec.rb

+ 3
- 0
attributes/default.rb View File

@@ -336,6 +336,7 @@ when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
336 336
     'cinder_nfs_packages' => ['nfs-utils', 'nfs-utils-lib'],
337 337
     'cinder_emc_packages' => ['pywbem'],
338 338
     'cinder_svc_packages' => ['sysfsutils'],
339
+    'cinder_lvm_packages' => ['lvm2'],
339 340
     'cinder_flashsystem_packages' => ['sysfsutils'],
340 341
     'package_overrides' => ''
341 342
   }
@@ -358,6 +359,7 @@ when 'suse'
358 359
     'cinder_nfs_packages' => ['nfs-utils'],
359 360
     'cinder_emc_packages' => ['python-pywbem'],
360 361
     'cinder_svc_packages' => ['sysfsutils'],
362
+    'cinder_lvm_packages' => ['lvm2'],
361 363
     'cinder_flashsystem_packages' => ['sysfsutils']
362 364
   }
363 365
 when 'debian'
@@ -379,6 +381,7 @@ when 'debian'
379 381
     'cinder_nfs_packages' => ['nfs-common'],
380 382
     'cinder_emc_packages' => ['python-pywbem'],
381 383
     'cinder_svc_packages' => ['sysfsutils'],
384
+    'cinder_lvm_packages' => ['lvm2'],
382 385
     'cinder_flashsystem_packages' => ['sysfsutils'],
383 386
     'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'"
384 387
   }

+ 7
- 0
recipes/volume.rb View File

@@ -171,6 +171,13 @@ when 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver'
171 171
 
172 172
 when 'cinder.volume.drivers.lvm.LVMISCSIDriver'
173 173
 
174
+  platform_options['cinder_lvm_packages'].each do |pkg|
175
+    package pkg do
176
+      options platform_options['package_overrides']
177
+      action :upgrade
178
+    end
179
+  end
180
+
174 181
   if node['openstack']['block-storage']['volume']['create_volume_group']
175 182
     vg_name = node['openstack']['block-storage']['volume']['volume_group']
176 183
 

+ 4
- 0
spec/volume_spec.rb View File

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

Loading…
Cancel
Save