From 36e8bf659a3d48ba4eb028ece6f3656e62f358c2 Mon Sep 17 00:00:00 2001 From: Daniel Badea Date: Mon, 30 Oct 2017 21:50:45 +0200 Subject: [PATCH] Roll up TIS patches --- lib/puppet/provider/cinder.rb | 5 ++++- manifests/backend/iscsi.pp | 19 ++++++++++++++++--- manifests/backend/rbd.pp | 14 +++++++++++--- manifests/db/sync.pp | 3 +++ manifests/init.pp | 7 ++++--- manifests/quota_set.pp | 2 ++ manifests/volume/rbd.pp | 1 + spec/classes/cinder_volume_iscsi_spec.rb | 2 +- 8 files changed, 42 insertions(+), 11 deletions(-) diff --git a/lib/puppet/provider/cinder.rb b/lib/puppet/provider/cinder.rb index 924e8d7..6a0ef2f 100644 --- a/lib/puppet/provider/cinder.rb +++ b/lib/puppet/provider/cinder.rb @@ -36,7 +36,10 @@ class Puppet::Provider::Cinder < Puppet::Provider::Openstack @credentials.user_domain_name = cinder_credentials['user_domain_name'] @credentials.project_domain_name = cinder_credentials['project_domain_name'] end + @credentials.region_name = cinder_credentials['region_name'] raise error unless @credentials.set? + # set OS_INTERFACE for cinder requests + ENV.store('OS_INTERFACE','internal') Puppet::Provider::Openstack.request(service, action, properties, @credentials) end @@ -50,7 +53,7 @@ class Puppet::Provider::Cinder < Puppet::Provider::Openstack def self.get_cinder_credentials auth_keys = ['auth_uri', 'project_name', 'username', - 'password'] + 'password', 'region_name'] conf = cinder_conf if conf and conf['keystone_authtoken'] and auth_keys.all?{|k| !conf['keystone_authtoken'][k].nil?} diff --git a/manifests/backend/iscsi.pp b/manifests/backend/iscsi.pp index 9530958..1ccc27c 100644 --- a/manifests/backend/iscsi.pp +++ b/manifests/backend/iscsi.pp @@ -103,12 +103,25 @@ define cinder::backend::iscsi ( } 'lioadm': { - service { 'target': - ensure => running, - enable => true, + # This service is being managed by Services Manager + # and it will be started by SM on an active controller + service { 'iscsi': + ensure => stopped, + name => 'target', + enable => false, tag => 'cinder-support-service', } + cinder_config { + "DEFAULT/iscsi_helper": value => $iscsi_helper; + "DEFAULT/num_shell_tries": value => 3; + "DEFAULT/num_iscsi_scan_tries": value => 3; + "DEFAULT/iscsi_num_targets": value => 10000; + "DEFAULT/iscsi_target_prefix": value => 'iqn.2010-10.org.openstack:'; + "DEFAULT/iscsi_ip_address": value => '$my_ip'; + "DEFAULT/iscsi_port": value => 3260; + } + package { 'targetcli': ensure => present, name => $::cinder::params::lio_package_name, diff --git a/manifests/backend/rbd.pp b/manifests/backend/rbd.pp index b310468..2607c7f 100644 --- a/manifests/backend/rbd.pp +++ b/manifests/backend/rbd.pp @@ -83,7 +83,7 @@ define cinder::backend::rbd ( $volume_backend_name = $name, $rbd_ceph_conf = '/etc/ceph/ceph.conf', $rbd_flatten_volume_from_snapshot = $::os_service_default, - $rbd_secret_uuid = $::os_service_default, + $rbd_secret_uuid = false, $rbd_max_clone_depth = $::os_service_default, $rados_connect_timeout = $::os_service_default, $rados_connection_interval = $::os_service_default, @@ -102,11 +102,9 @@ define cinder::backend::rbd ( "${name}/volume_backend_name": value => $volume_backend_name; "${name}/volume_driver": value => 'cinder.volume.drivers.rbd.RBDDriver'; "${name}/rbd_ceph_conf": value => $rbd_ceph_conf; - "${name}/rbd_user": value => $rbd_user; "${name}/rbd_pool": value => $rbd_pool; "${name}/rbd_max_clone_depth": value => $rbd_max_clone_depth; "${name}/rbd_flatten_volume_from_snapshot": value => $rbd_flatten_volume_from_snapshot; - "${name}/rbd_secret_uuid": value => $rbd_secret_uuid; "${name}/rados_connect_timeout": value => $rados_connect_timeout; "${name}/rados_connection_interval": value => $rados_connection_interval; "${name}/rados_connection_retries": value => $rados_connection_retries; @@ -130,6 +128,14 @@ define cinder::backend::rbd ( } } + if $rbd_secret_uuid { + cinder_config {"${name}/rbd_secret_uuid": value => $rbd_secret_uuid;} + cinder_config {"${name}/rbd_user": value => $rbd_user;} + } else { + cinder_config {"${name}/rbd_secret_uuid": ensure => absent;} + cinder_config {"${name}/rbd_user": ensure => absent;} + } + if $volume_tmp_dir { cinder_config {"${name}/volume_tmp_dir": value => $volume_tmp_dir;} warning('The rbd volume_tmp_dir parameter is deprecated. Please use image_conversion_dir in the cinder base class instead.') @@ -151,6 +157,7 @@ define cinder::backend::rbd ( } } + if $override_line { # Creates an empty file if it doesn't yet exist ensure_resource('file', $::cinder::params::ceph_init_override, {'ensure' => 'present'}) @@ -159,5 +166,6 @@ define cinder::backend::rbd ( path => $::cinder::params::ceph_init_override, notify => Anchor['cinder::service::begin'], } + } } diff --git a/manifests/db/sync.pp b/manifests/db/sync.pp index a37f746..90f910a 100644 --- a/manifests/db/sync.pp +++ b/manifests/db/sync.pp @@ -30,5 +30,8 @@ class cinder::db::sync( Anchor['cinder::dbsync::begin'] ], notify => Anchor['cinder::dbsync::end'], + # Only do the db sync if both controllers are running the same software + # version. Avoids impacting mate controller during an upgrade. + onlyif => "test $::controller_sw_versions_match = true", } } diff --git a/manifests/init.pp b/manifests/init.pp index d58b653..bf23eaa 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -19,8 +19,9 @@ # Defaults to $::os_service_default # # [*rpc_response_timeout*] -# (optional) Seconds to wait for a response from a call -# Defaults to $::os_service_default +# (Optional) rpc_response_timeout for rpc calls +# Defaults to 60. +# # # [*control_exchange*] # (Optional) @@ -318,7 +319,7 @@ class cinder ( $database_retry_interval = undef, $database_max_overflow = undef, $default_transport_url = $::os_service_default, - $rpc_response_timeout = $::os_service_default, + $rpc_response_timeout = '60', $control_exchange = 'openstack', $rabbit_ha_queues = $::os_service_default, $rabbit_heartbeat_timeout_threshold = $::os_service_default, diff --git a/manifests/quota_set.pp b/manifests/quota_set.pp index 10c690a..fb4cbe8 100644 --- a/manifests/quota_set.pp +++ b/manifests/quota_set.pp @@ -67,6 +67,7 @@ define cinder::quota_set ( "OS_PASSWORD=${os_password}", "OS_AUTH_URL=${os_auth_url}", "OS_REGION_NAME=${os_region_name}", + "CINDER_ENDPOINT_TYPE=internalURL", ] } else { @@ -75,6 +76,7 @@ define cinder::quota_set ( "OS_USERNAME=${os_username}", "OS_PASSWORD=${os_password}", "OS_AUTH_URL=${os_auth_url}", + "CINDER_ENDPOINT_TYPE=internalURL", ] } diff --git a/manifests/volume/rbd.pp b/manifests/volume/rbd.pp index accf47b..3971008 100644 --- a/manifests/volume/rbd.pp +++ b/manifests/volume/rbd.pp @@ -93,5 +93,6 @@ cinder::backend::rbd instead.') rados_connection_retries => $rados_connection_retries, rbd_store_chunk_size => $rbd_store_chunk_size, extra_options => $extra_options, + backend_host => '$host', } } diff --git a/spec/classes/cinder_volume_iscsi_spec.rb b/spec/classes/cinder_volume_iscsi_spec.rb index 9fc87a9..4e8585a 100644 --- a/spec/classes/cinder_volume_iscsi_spec.rb +++ b/spec/classes/cinder_volume_iscsi_spec.rb @@ -19,7 +19,7 @@ describe 'cinder::volume::iscsi' do it { is_expected.to contain_cinder_config('DEFAULT/volume_driver').with( :value => 'cinder.volume.drivers.lvm.LVMVolumeDriver')} it { is_expected.to contain_cinder_config('DEFAULT/iscsi_ip_address').with(:value => '127.0.0.2')} - it { is_expected.to contain_cinder_config('DEFAULT/iscsi_helper').with(:value => 'tgtadm')} + it { is_expected.to contain_cinder_config('DEFAULT/iscsi_helper').with(:value => 'lioadm')} it { is_expected.to contain_cinder_config('DEFAULT/volume_group').with(:value => '')} it { is_expected.to contain_cinder_config('DEFAULT/volumes_dir').with(:value => '/var/lib/cinder/volumes')} it { is_expected.to contain_cinder_config('DEFAULT/iscsi_protocol').with(:value => '')} -- 2.7.4