Browse Source

Merge "Remove deprecated support for GlusterFS volume driver"

changes/90/802290/1 19.1.0
Zuul 3 months ago
committed by Gerrit Code Review
parent
commit
28edb4ebad
  1. 109
      manifests/backend/glusterfs.pp
  2. 4
      releasenotes/notes/remove-glusterfs-volume-driver-cb403cb7973cc30a.yaml
  3. 67
      spec/defines/cinder_backend_glusterfs_spec.rb

109
manifests/backend/glusterfs.pp

@ -1,109 +0,0 @@
#
# == Class: cinder::backend::glusterfs
#
# DEPRECATED!
# Configures Cinder to use GlusterFS as a volume driver
#
# === Parameters
#
# [*glusterfs_shares*]
# (required) An array of GlusterFS volume locations.
# Must be an array even if there is only one volume.
#
# [*volume_backend_name*]
# (optional) Allows for the volume_backend_name to be separate of $name.
# Defaults to: $name
#
# [*backend_availability_zone*]
# (Optional) Availability zone for this volume backend.
# If not set, the storage_availability_zone option value
# is used as the default for all backends.
# Defaults to $::os_service_default.
#
# [*glusterfs_backup_mount_point*]
# (optional) Base dir containing mount point for gluster share.
# Defaults to $::os_service_default
#
# [*glusterfs_backup_share*]
# (optonal) GlusterFS share in <hostname|ipv4addr|ipv6addr>:<gluster_vol_name>
# format. Eg: 1.2.3.4:backup_vol
# Defaults to $::os_service_default
#
# [*glusterfs_sparsed_volumes*]
# (optional) Whether or not to use sparse (thin) volumes.
# Defaults to $::os_service_default which uses the driver's default of "true".
#
# [*glusterfs_mount_point_base*]
# (optional) Where to mount the Gluster volumes.
# Defaults to $::os_service_default which uses the driver's default of
# "$state_path/mnt".
#
# [*glusterfs_shares_config*]
# (optional) The config file to store the given $glusterfs_shares.
# Defaults to '/etc/cinder/shares.conf'
#
# [*extra_options*]
# (optional) Hash of extra options to pass to the backend stanza
# Defaults to: {}
# Example :
# { 'glusterfs_backend/param1' => { 'value' => value1 } }
#
# [*manage_volume_type*]
# (Optional) Whether or not manage Cinder Volume type.
# If set to true, a Cinder Volume type will be created
# with volume_backend_name=$volume_backend_name key/value.
# Defaults to false.
#
# === Examples
#
# cinder::backend::glusterfs { 'myGluster':
# glusterfs_shares = ['192.168.1.1:/volumes'],
# }
#
define cinder::backend::glusterfs (
$glusterfs_shares,
$volume_backend_name = $name,
$backend_availability_zone = $::os_service_default,
$glusterfs_backup_mount_point = $::os_service_default,
$glusterfs_backup_share = $::os_service_default,
$glusterfs_sparsed_volumes = $::os_service_default,
$glusterfs_mount_point_base = $::os_service_default,
$glusterfs_shares_config = '/etc/cinder/shares.conf',
$manage_volume_type = false,
$extra_options = {},
) {
include cinder::deps
warning('Support for glustefs volume driver is deprecated and will be removed \
in a future release')
$content = join($glusterfs_shares, "\n")
file { $glusterfs_shares_config:
content => "${content}\n",
require => Anchor['cinder::install::end'],
notify => Anchor['cinder::service::begin'],
}
cinder_config {
"${name}/volume_backend_name": value => $volume_backend_name;
"${name}/backend_availability_zone": value => $backend_availability_zone;
"${name}/volume_driver": value => 'cinder.volume.drivers.glusterfs.GlusterfsDriver';
"${name}/glusterfs_backup_mount_point": value => $glusterfs_backup_mount_point;
"${name}/glusterfs_backup_share": value => $glusterfs_backup_share;
"${name}/glusterfs_shares_config": value => $glusterfs_shares_config;
"${name}/glusterfs_sparsed_volumes": value => $glusterfs_sparsed_volumes;
"${name}/glusterfs_mount_point_base": value => $glusterfs_mount_point_base;
}
if $manage_volume_type {
cinder_type { $volume_backend_name:
ensure => present,
properties => ["volume_backend_name=${volume_backend_name}"],
}
}
create_resources('cinder_config', $extra_options)
}

4
releasenotes/notes/remove-glusterfs-volume-driver-cb403cb7973cc30a.yaml

@ -0,0 +1,4 @@
---
upgrade:
- |
The ``cinder::backend::glusterfs`` resource type has been removed.

67
spec/defines/cinder_backend_glusterfs_spec.rb

@ -1,67 +0,0 @@
require 'spec_helper'
describe 'cinder::backend::glusterfs' do
let(:title) {'mygluster'}
let :params do
{
:backend_availability_zone => 'my_zone',
:glusterfs_shares => ['10.10.10.10:/volumes', '10.10.10.11:/volumes'],
:glusterfs_shares_config => '/etc/cinder/other_shares.conf',
:glusterfs_sparsed_volumes => true,
:glusterfs_mount_point_base => '/cinder_mount_point',
}
end
shared_examples 'glusterfs volume driver' do
it { is_expected.to contain_cinder_config('mygluster/volume_driver').with(
:value => 'cinder.volume.drivers.glusterfs.GlusterfsDriver'
)}
it {
is_expected.to contain_cinder_config('mygluster/backend_availability_zone').with_value('my_zone')
is_expected.to contain_cinder_config('mygluster/glusterfs_backup_mount_point').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('mygluster/glusterfs_backup_share').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('mygluster/glusterfs_shares_config').with_value('/etc/cinder/other_shares.conf')
is_expected.to contain_cinder_config('mygluster/glusterfs_sparsed_volumes').with_value(true)
is_expected.to contain_cinder_config('mygluster/glusterfs_mount_point_base').with_value('/cinder_mount_point')
}
it { is_expected.to contain_file('/etc/cinder/other_shares.conf').with(
:content => "10.10.10.10:/volumes\n10.10.10.11:/volumes\n",
:require => 'Anchor[cinder::install::end]',
:notify => 'Anchor[cinder::service::begin]'
)}
context 'glusterfs backend with additional configuration' do
before do
params.merge!( :extra_options => {'mygluster/param1' => { 'value' => 'value1' }} )
end
it { is_expected.to contain_cinder_config('mygluster/param1').with_value('value1') }
end
context 'glusterfs backend with cinder type' do
before do
params.merge!( :manage_volume_type => true )
end
it { is_expected.to contain_cinder_type('mygluster').with(
:ensure => 'present',
:properties => ['volume_backend_name=mygluster']
)}
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts( :os_workers => 8 ))
end
it_behaves_like 'glusterfs volume driver'
end
end
end
Loading…
Cancel
Save