Configure iscsi target service for RHEL7
In RHEL7, tgtd is replaced by LIO, and target deamon service and targetcli package is used to manage iscsi target. This fix also set iscsi_helper to lioadm for RHEL7 Change-Id: I5a5b1faec6a6aed9b9f3d5632e704a59e2d5c7b7 closes-bug: #1409619
This commit is contained in:
parent
0f61b0e4a2
commit
996254f21c
|
@ -2,9 +2,11 @@ openstack-block-storage Cookbook CHANGELOG
|
|||
==============================
|
||||
This file is used to list changes made in each version of the openstack-block-storage cookbook.
|
||||
## 10.1.0
|
||||
* Add disable logic for stage fix to tgtd issue on RHEL 7
|
||||
* Use common specific_endpoint routines (bug 1412919)
|
||||
* Install qemu-img package for volume nodes
|
||||
* update iscsi_helper for RHEL7
|
||||
* update cinder_iscsitarget_packages for RHEL7
|
||||
* update cinder_iscsitarget_service for RHEL7
|
||||
|
||||
## 10.0.1
|
||||
# Update cinder.conf mode from 0644 to 0640
|
||||
|
|
|
@ -305,6 +305,7 @@ when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
|
|||
# operating system user and group names
|
||||
default['openstack']['block-storage']['user'] = 'cinder'
|
||||
default['openstack']['block-storage']['group'] = 'cinder'
|
||||
default['openstack']['block-storage']['volume']['iscsi_helper'] = 'lioadm'
|
||||
|
||||
default['openstack']['block-storage']['platform'] = {
|
||||
'cinder_common_packages' => ['openstack-cinder'],
|
||||
|
@ -315,21 +316,14 @@ when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
|
|||
'cinder_volume_service' => 'openstack-cinder-volume',
|
||||
'cinder_scheduler_packages' => [],
|
||||
'cinder_scheduler_service' => 'openstack-cinder-scheduler',
|
||||
'cinder_iscsitarget_packages' => ['scsi-target-utils'],
|
||||
'cinder_iscsitarget_service' => 'tgtd',
|
||||
'cinder_iscsitarget_packages' => ['targetcli'],
|
||||
'cinder_iscsitarget_service' => 'target',
|
||||
'cinder_ceph_packages' => ['python-ceph', 'ceph-common'],
|
||||
'cinder_nfs_packages' => ['nfs-utils', 'nfs-utils-lib'],
|
||||
'cinder_emc_packages' => ['pywbem'],
|
||||
'cinder_svc_packages' => ['sysfsutils'],
|
||||
'package_overrides' => ''
|
||||
}
|
||||
if platform_family == 'rhel' && platform_version.to_i == 7
|
||||
# On RHEL7, tgtd has been removed, disable it here just for now.
|
||||
# This is a stage fix for bug #1400958, new logic should be added to fully
|
||||
# support new targetcli on RHEL7
|
||||
default['openstack']['block-storage']['platform']['cinder_iscsitarget_packages'] = []
|
||||
default['openstack']['block-storage']['platform']['cinder_iscsitarget_service'] = []
|
||||
end
|
||||
when 'suse'
|
||||
# operating system user and group names
|
||||
default['openstack']['block-storage']['user'] = 'openstack-cinder'
|
||||
|
|
|
@ -227,19 +227,16 @@ service 'cinder-volume' do
|
|||
subscribes :restart, 'template[/etc/cinder/cinder.conf]'
|
||||
end
|
||||
|
||||
unless node['platform_family'] == 'rhel' && node['platform_version'].to_i == 7
|
||||
# On RHEL7, tgtd has been removed, disable it here just for now.
|
||||
# This is a stage fix for bug #1400958, new logic should be added to fully
|
||||
# support new targetcli on RHEL7
|
||||
service 'iscsitarget' do
|
||||
service_name platform_options['cinder_iscsitarget_service']
|
||||
supports status: true, restart: true
|
||||
action :enable
|
||||
end
|
||||
|
||||
template '/etc/tgt/targets.conf' do
|
||||
source 'targets.conf.erb'
|
||||
mode 00600
|
||||
notifies :restart, 'service[iscsitarget]', :immediately
|
||||
end
|
||||
service 'iscsitarget' do
|
||||
service_name platform_options['cinder_iscsitarget_service']
|
||||
supports status: true, restart: true
|
||||
action :enable
|
||||
end
|
||||
|
||||
# RHEL7 doesn't need targets.conf file
|
||||
template '/etc/tgt/targets.conf' do
|
||||
source 'targets.conf.erb'
|
||||
mode 00600
|
||||
notifies :restart, 'service[iscsitarget]', :immediately
|
||||
not_if { node['platform_family'] == 'rhel' && node['platform_version'].to_i == 7 }
|
||||
end
|
||||
|
|
|
@ -16,11 +16,6 @@ SUSE_OPTS = {
|
|||
log_level: LOG_LEVEL
|
||||
}
|
||||
REDHAT_OPTS = {
|
||||
platform: 'redhat',
|
||||
version: '6.5',
|
||||
log_level: LOG_LEVEL
|
||||
}
|
||||
REDHAT7_OPTS = {
|
||||
platform: 'redhat',
|
||||
version: '7.0',
|
||||
log_level: LOG_LEVEL
|
||||
|
|
|
@ -36,7 +36,7 @@ describe 'openstack-block-storage::volume' do
|
|||
end
|
||||
|
||||
it 'upgrades cinder iscsi package' do
|
||||
expect(chef_run).to upgrade_package('scsi-target-utils')
|
||||
expect(chef_run).to upgrade_package('targetcli')
|
||||
end
|
||||
|
||||
it 'starts cinder volume' do
|
||||
|
@ -48,17 +48,8 @@ describe 'openstack-block-storage::volume' do
|
|||
end
|
||||
|
||||
context 'ISCSI' do
|
||||
let(:file) { chef_run.template('/etc/tgt/targets.conf') }
|
||||
it 'starts iscsi target on boot' do
|
||||
expect(chef_run).to enable_service('tgtd')
|
||||
end
|
||||
|
||||
it 'has redhat include' do
|
||||
node.set['openstack']['block-storage']['volume']['volumes_dir'] = 'volumes_dir_value'
|
||||
expect(chef_run).to render_file(file.name).with_content(
|
||||
'include volumes_dir_value/*')
|
||||
expect(chef_run).not_to render_file(file.name).with_content(
|
||||
'include /etc/tgt/conf.d/*.conf')
|
||||
expect(chef_run).to enable_service('target')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -191,22 +182,5 @@ describe 'openstack-block-storage::volume' do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe 'redhat' do
|
||||
let(:runner) { ChefSpec::Runner.new(REDHAT7_OPTS) }
|
||||
let(:node) { runner.node }
|
||||
let(:chef_run) { runner.converge(described_recipe) }
|
||||
|
||||
include_context 'block-storage-stubs'
|
||||
|
||||
it 'disable tgtd for rhel7' do
|
||||
# test temp solution for RHEL7 to disable tgtd
|
||||
# stage fix for bug #1400958
|
||||
expect(chef_run).not_to upgrade_package('scsi-target-utils')
|
||||
expect(chef_run).not_to enable_service('iscsitarget')
|
||||
expect(chef_run).not_to create_template('/etc/tgt/targets.conf')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue