Add IBMNAS driver configuration flags
- Add support for IBMNAS volume driver configuration flags. (nfs_shares_config, nfs_sparsed_volumes, nfs_mount_point_base nas_ip, nas_login, nas_password) - Add initialization of nfs_mount_point_base directory, nfs_shares_config with proper owner and permission settings. - Updated README.md with ibmnas attributes Change-Id: I88607740963916ccc26daee5873cca532b00a434 Implements: blueprint ibmnas-chef-support
This commit is contained in:
parent
5cdb6ba827
commit
5103ccd784
|
@ -162,6 +162,15 @@ Cinder attributes
|
|||
* `openstack['block-storage']['gpfs']['gpfs_max_clone_depth']` - Maximum clone indirections allowed when creating volume file snapshots clones; zero indicates unlimited clone depth (integer, defalut 0)
|
||||
* `openstack['block-storage']['gpfs']['gpfs_storage_pool']` - GPFS storage pool that volumes are assigned to (string value)
|
||||
|
||||
### IBMNAS (SONAS/Storwize V7000 Unified) attributes ###
|
||||
* `openstack['block-storage']['ibmnas']['nas_ip']` - Management IP address of IBMNAS storage
|
||||
* `openstack['block-storage']['ibmnas']['nas_login']` - Username for IBMNAS storage system
|
||||
* `openstack['block-storage']['ibmnas']['nas_access_ip']` - Hostname/Public IP address to access shares
|
||||
* `openstack['block-storage']['ibmnas']['export']` - Storage system shares/export path parameter
|
||||
* `openstack['block-storage']['ibmnas']['shares_config']` - File that contains list of IBMNAS Shares
|
||||
* `openstack['block-storage']['ibmnas']['mount_point_base']` - Storage system autoexpand parameter for volumes
|
||||
* `openstack['block-storage']['ibmnas']['nfs_sparsed_volumes']` - Storage system volume creation method
|
||||
|
||||
Testing
|
||||
=====
|
||||
|
||||
|
|
|
@ -97,6 +97,11 @@ default['openstack']['block-storage']['san']['san_login'] = 'admin'
|
|||
default['openstack']['block-storage']['san']['san_private_key'] = '/v7000_rsa'
|
||||
default['openstack']['block-storage']['san']['san_password'] = 'san_password'
|
||||
|
||||
# NFS support
|
||||
default['openstack']['block-storage']['nfs']['nas_ip'] = '127.0.0.1'
|
||||
default['openstack']['block-storage']['nfs']['nas_login'] = 'admin'
|
||||
default['openstack']['block-storage']['nfs']['nas_ssh_port'] = '22'
|
||||
|
||||
# Netapp support
|
||||
default['openstack']['block-storage']['netapp']['protocol'] = 'http'
|
||||
default['openstack']['block-storage']['netapp']['dfm_hostname'] = nil
|
||||
|
@ -173,6 +178,17 @@ default['openstack']['block-storage']['gpfs']['gpfs_sparse_volumes'] = true
|
|||
default['openstack']['block-storage']['gpfs']['gpfs_max_clone_depth'] = 8
|
||||
default['openstack']['block-storage']['gpfs']['gpfs_storage_pool'] = 'system'
|
||||
|
||||
# IBMNAS (SONAS, Storwize V7000 Unified) Support
|
||||
# The attribute "nas_password" is stored in databag and
|
||||
# accessed with openstack-common cookbook library's "get_password" routeine.
|
||||
default['openstack']['block-storage']['ibmnas']['nas_ip'] = node['openstack']['block-storage']['nfs']['nas_ip']
|
||||
default['openstack']['block-storage']['ibmnas']['nas_login'] = node['openstack']['block-storage']['nfs']['nas_login']
|
||||
default['openstack']['block-storage']['ibmnas']['shares_config'] = '/etc/cinder/nfs_shares.conf'
|
||||
default['openstack']['block-storage']['ibmnas']['mount_point_base'] = '/mnt/cinder-volumes'
|
||||
default['openstack']['block-storage']['ibmnas']['nfs_sparsed_volumes'] = 'true'
|
||||
default['openstack']['block-storage']['ibmnas']['nas_access_ip'] = nil
|
||||
default['openstack']['block-storage']['ibmnas']['export'] = nil
|
||||
|
||||
# logging attribute
|
||||
default['openstack']['block-storage']['syslog']['use'] = false
|
||||
default['openstack']['block-storage']['syslog']['facility'] = 'LOG_LOCAL2'
|
||||
|
|
|
@ -47,6 +47,8 @@ end
|
|||
|
||||
if node['openstack']['block-storage']['volume']['driver'] == 'cinder.volume.drivers.solidfire.SolidFire'
|
||||
solidfire_pass = get_password 'user', node['openstack']['block-storage']['solidfire']['san_login']
|
||||
elsif node['openstack']['block-storage']['volume']['driver'] == 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver'
|
||||
ibmnas_pass = get_password 'user', node['openstack']['block-storage']['ibmnas']['nas_login']
|
||||
end
|
||||
|
||||
glance_api_endpoint = endpoint 'image-api'
|
||||
|
@ -71,6 +73,7 @@ template '/etc/cinder/cinder.conf' do
|
|||
rabbit_hosts: rabbit_hosts,
|
||||
glance_host: glance_api_endpoint.host,
|
||||
glance_port: glance_api_endpoint.port,
|
||||
ibmnas_pass: ibmnas_pass,
|
||||
solidfire_pass: solidfire_pass,
|
||||
volume_api_address: cinder_api_endpoint.host
|
||||
)
|
||||
|
|
|
@ -126,6 +126,34 @@ when 'cinder.volume.drivers.gpfs.GPFSDriver'
|
|||
recursive true
|
||||
end
|
||||
|
||||
when 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver'
|
||||
directory node['openstack']['block-storage']['ibmnas']['mount_point_base'] do
|
||||
owner node['openstack']['block-storage']['user']
|
||||
group node['openstack']['block-storage']['group']
|
||||
mode '0755'
|
||||
recursive true
|
||||
action :create
|
||||
end
|
||||
|
||||
platform_options['cinder_nfs_packages'].each do |pkg|
|
||||
package pkg do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
end
|
||||
end
|
||||
|
||||
template node['openstack']['block-storage']['ibmnas']['shares_config'] do
|
||||
source 'nfs_shares.conf.erb'
|
||||
mode '0600'
|
||||
owner node['openstack']['block-storage']['user']
|
||||
group node['openstack']['block-storage']['group']
|
||||
variables(
|
||||
host: node['openstack']['block-storage']['ibmnas']['nas_access_ip'],
|
||||
export: node['openstack']['block-storage']['ibmnas']['export']
|
||||
)
|
||||
notifies :restart, 'service[cinder-volume]'
|
||||
end
|
||||
|
||||
when 'cinder.volume.drivers.lvm.LVMISCSIDriver'
|
||||
if node['openstack']['block-storage']['volume']['create_volume_group']
|
||||
volume_size = node['openstack']['block-storage']['volume']['volume_group_size']
|
||||
|
|
|
@ -295,6 +295,47 @@ describe 'openstack-block-storage::cinder-common' do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'ibmnas settings' do
|
||||
before do
|
||||
chef_run.node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver'
|
||||
chef_run.node.set['openstack']['block-storage']['ibmnas']['nas_ip'] = '127.0.0.1'
|
||||
chef_run.node.set['openstack']['block-storage']['ibmnas']['nas_login'] = 'ibmnas_admin'
|
||||
chef_run.node.set['openstack']['block-storage']['ibmnas']['nas_ssh_port'] = '22'
|
||||
chef_run.node.set['openstack']['block-storage']['ibmnas']['shares_config'] = '/etc/cinder/nfs_shares.conf'
|
||||
chef_run.node.set['openstack']['block-storage']['ibmnas']['mount_point_base'] = '/mnt/cinder-volumes'
|
||||
chef_run.node.set['openstack']['block-storage']['ibmnas']['nfs_sparsed_volumes'] = 'true'
|
||||
chef_run.converge 'openstack-block-storage::cinder-common'
|
||||
end
|
||||
|
||||
it 'has ibmnas nas_ip' do
|
||||
expect(chef_run).to render_file(file.name).with_content('nas_ip=127.0.0.1')
|
||||
end
|
||||
|
||||
it 'has ibmnas nas_login' do
|
||||
expect(chef_run).to render_file(file.name).with_content('nas_login=ibmnas_admin')
|
||||
end
|
||||
|
||||
it 'has ibmnas nas_password' do
|
||||
expect(chef_run).to render_file(file.name).with_content('nas_password=test_pass')
|
||||
end
|
||||
|
||||
it 'has ibmnas nas_ssh_port' do
|
||||
expect(chef_run).to render_file(file.name).with_content('nas_ssh_port=22')
|
||||
end
|
||||
|
||||
it 'has ibmnas shares_config' do
|
||||
expect(chef_run).to render_file(file.name).with_content('shares_config=/etc/cinder/nfs_shares.conf')
|
||||
end
|
||||
|
||||
it 'has ibmnas mount_point_base' do
|
||||
expect(chef_run).to render_file(file.name).with_content('mount_point_base=/mnt/cinder-volumes')
|
||||
end
|
||||
|
||||
it 'has ibmnas nfs_sparsed_volumes' do
|
||||
expect(chef_run).to render_file(file.name).with_content('nfs_sparsed_volumes=true')
|
||||
end
|
||||
end
|
||||
|
||||
describe 'vmware vmdk settings' do
|
||||
before do
|
||||
chef_run.node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver'
|
||||
|
|
|
@ -60,6 +60,9 @@ shared_context 'block-storage-stubs' do
|
|||
Chef::Recipe.any_instance.stub(:get_password)
|
||||
.with('user', 'admin')
|
||||
.and_return('emc_test_pass')
|
||||
Chef::Recipe.any_instance.stub(:get_password)
|
||||
.with('user', 'ibmnas_admin')
|
||||
.and_return('test_pass')
|
||||
Chef::Application.stub(:fatal!)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -57,6 +57,37 @@ describe 'openstack-block-storage::volume' do
|
|||
end
|
||||
end
|
||||
|
||||
context 'IBMNAS Driver' do
|
||||
let(:file) { chef_run.template('/etc/cinder/nfs_shares.conf') }
|
||||
before do
|
||||
node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver'
|
||||
node.set['openstack']['block-storage']['ibmnas']['nas_access_ip'] = '127.0.0.1'
|
||||
node.set['openstack']['block-storage']['ibmnas']['export'] = '/ibm/fs/export'
|
||||
end
|
||||
|
||||
it 'creates IBMNAS shares_config file' do
|
||||
expect(chef_run).to create_template(file.name).with(
|
||||
owner: 'cinder',
|
||||
group: 'cinder',
|
||||
mode: '0600'
|
||||
)
|
||||
expect(chef_run).to render_file(file.name).with_content('127.0.0.1:/ibm/fs/export')
|
||||
end
|
||||
|
||||
it 'installs nfs packages' do
|
||||
expect(chef_run).to upgrade_package 'nfs-utils'
|
||||
expect(chef_run).to upgrade_package 'nfs-utils-lib'
|
||||
end
|
||||
|
||||
it 'creates the nfs mount point' do
|
||||
expect(chef_run).to create_directory('/mnt/cinder-volumes').with(
|
||||
owner: 'cinder',
|
||||
group: 'cinder',
|
||||
mode: '0755'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'NFS Driver' do
|
||||
before do
|
||||
node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver'
|
||||
|
|
|
@ -52,6 +52,36 @@ describe 'openstack-block-storage::volume' do
|
|||
expect(chef_run).to upgrade_package 'python-pywbem'
|
||||
end
|
||||
|
||||
context 'IBMNAS Driver' do
|
||||
let(:file) { chef_run.template('/etc/cinder/nfs_shares.conf') }
|
||||
before do
|
||||
node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver'
|
||||
node.set['openstack']['block-storage']['ibmnas']['nas_access_ip'] = '127.0.0.1'
|
||||
node.set['openstack']['block-storage']['ibmnas']['export'] = '/ibm/fs/export'
|
||||
end
|
||||
|
||||
it 'creates IBMNAS shares_config file' do
|
||||
expect(chef_run).to create_template(file.name).with(
|
||||
owner: 'cinder',
|
||||
group: 'cinder',
|
||||
mode: '0600'
|
||||
)
|
||||
expect(chef_run).to render_file(file.name).with_content('127.0.0.1:/ibm/fs/export')
|
||||
end
|
||||
|
||||
it 'installs nfs packages' do
|
||||
expect(chef_run).to upgrade_package 'nfs-common'
|
||||
end
|
||||
|
||||
it 'creates the nfs mount point' do
|
||||
expect(chef_run).to create_directory('/mnt/cinder-volumes').with(
|
||||
owner: 'cinder',
|
||||
group: 'cinder',
|
||||
mode: '0755'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'NetApp Driver' do
|
||||
describe 'NFS' do
|
||||
before do
|
||||
|
|
|
@ -672,6 +672,20 @@ nfs_sparsed_volumes=<%= node["openstack"]["block-storage"]["nfs"]["nfs_sparsed_v
|
|||
|
||||
######## defined in cinder.volume.nfs ########
|
||||
|
||||
<% if node["openstack"]["block-storage"]["volume"]["driver"] == "cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver" %>
|
||||
|
||||
nfs_shares_config=<%= node["openstack"]["block-storage"]["ibmnas"]["shares_config"] %>
|
||||
#### (StrOpt) File with the list of available nfs shares
|
||||
|
||||
nfs_mount_point_base=<%= node["openstack"]["block-storage"]["ibmnas"]["mount_point_base"] %>
|
||||
#### (StrOpt) Base dir where nfs expected to be mounted
|
||||
|
||||
nfs_sparsed_volumes=<%= node["openstack"]["block-storage"]["ibmnas"]["nfs_sparsed_volumes"] %>
|
||||
#### (BoolOpt) Create volumes as sparsed files which take no space.If set
|
||||
#### to False volume is created as regular file.In such case
|
||||
#### volume creation takes a lot of time.
|
||||
|
||||
<% else %>
|
||||
# nfs_shares_config=<None>
|
||||
#### (StrOpt) File with the list of available nfs shares
|
||||
|
||||
|
@ -685,6 +699,7 @@ nfs_sparsed_volumes=<%= node["openstack"]["block-storage"]["nfs"]["nfs_sparsed_v
|
|||
#### (BoolOpt) Create volumes as sparsed files which take no space.If set
|
||||
#### to False volume is created as regular file.In such case
|
||||
#### volume creation takes a lot of time.
|
||||
<% end %>
|
||||
|
||||
|
||||
######## defined in cinder.volume.san ########
|
||||
|
@ -809,6 +824,22 @@ cinder_emc_config_file=<%= node["openstack"]["block-storage"]["emc"]["cinder_emc
|
|||
|
||||
<% end %>
|
||||
|
||||
<% if node["openstack"]["block-storage"]["volume"]["driver"] == "cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver" %>
|
||||
######## defined in cinder.volume.ibm.ibmnas ########
|
||||
|
||||
nas_ip=<%= node["openstack"]["block-storage"]["ibmnas"]["nas_ip"] %>
|
||||
#### (StrOpt) IP address of IBMNAS storage
|
||||
|
||||
nas_login=<%= node["openstack"]["block-storage"]["ibmnas"]["nas_login"] %>
|
||||
#### (StrOpt) Username for IBMNAS Cluster
|
||||
|
||||
nas_password=<%= @ibmnas_pass %>
|
||||
#### (StrOpt) Password for IBMNAS Cluster
|
||||
|
||||
nas_ssh_port=<%= node["openstack"]["block-storage"]["ibmnas"]["nas_ssh_port"] %>
|
||||
#### (StrOpt) IP address of IBMNAS storage
|
||||
<% end %>
|
||||
|
||||
######## defined in cinder.volume.xiv ########
|
||||
|
||||
# xiv_proxy=xiv_openstack.nova_proxy.XIVNovaProxy
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<%= node["openstack"]["block-storage"]["custom_template_banner"] %>
|
||||
|
||||
<%= @host %>:<%= @export %>
|
Loading…
Reference in New Issue