diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index aee1852..9efec5e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,21 +1,31 @@ -# This configuration was generated by `rubocop --auto-gen-config` -# on 2015-05-28 14:36:48 -0500 using RuboCop version 0.29.1. -# The point is for the user to remove these configuration records -# one by one as the offenses are removed from the code base. -# Note that changes in the inspected code, or installation of new -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 1 -Metrics/AbcSize: - Max: 18 - -# Offense count: 5 -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/ClassAndModuleChildren: - Enabled: false - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. -Style/SymbolProc: - Enabled: false +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2016-02-04 16:35:09 +0100 using RuboCop version 0.35.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 10 +Lint/ParenthesesAsGroupedExpression: + Exclude: + - 'recipes/identity_registration.rb' + +# Offense count: 1 +Metrics/AbcSize: + Max: 18 + +# Offense count: 1 +# Configuration parameters: CountComments. +Metrics/MethodLength: + Max: 13 + +# Offense count: 5 +# Configuration parameters: EnforcedStyle, SupportedStyles. +Style/ClassAndModuleChildren: + Exclude: + - 'recipes/api.rb' + - 'recipes/cinder-common.rb' + - 'recipes/client.rb' + - 'recipes/identity_registration.rb' + - 'recipes/volume.rb' diff --git a/attributes/cinder_conf.rb b/attributes/cinder_conf.rb new file mode 100644 index 0000000..9dcf713 --- /dev/null +++ b/attributes/cinder_conf.rb @@ -0,0 +1,19 @@ +default['openstack']['block-storage']['conf_secrets'] = {} +default['openstack']['block-storage']['conf'].tap do |conf| + conf['DEFAULT']['notification_driver'] = 'cinder.openstack.common.notifier.rpc_notifier' + if node['openstack']['block-storage']['syslog']['use'] + conf['DEFAULT']['log_config'] = '/etc/openstack/logging.conf' + end + conf['DEFAULT']['rpc_backend'] = node['openstack']['mq']['service_type'] + conf['DEFAULT']['my_ip'] = '127.0.0.1' + conf['DEFAULT']['auth_strategy'] = 'keystone' + conf['DEFAULT']['control_exchange'] = 'cinder' + conf['DEFAULT']['volume_group'] = 'cinder-volumes' + conf['DEFAULT']['state_path'] = '/var/lib/cinder' + conf['keystone_authtoken']['auth_plugin'] = 'v2password' + conf['keystone_authtoken']['region_name'] = node['openstack']['region'] + conf['keystone_authtoken']['username'] = 'cinder' + conf['keystone_authtoken']['tenant_name'] = 'service' + conf['keystone_authtoken']['signing_dir'] = '/var/cache/cinder/api' + conf['oslo_concurrency']['lock_path'] = '/var/lib/cinder/tmp' +end diff --git a/attributes/default.rb b/attributes/default.rb index 714b1c2..0dc961c 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -24,7 +24,7 @@ ######################################################################## # Toggles - These can be overridden at the environment level -default['developer_mode'] = false # we want secure passwords by default +default['developer_mode'] = false # we want secure passwords by default ######################################################################## # Set to some text value if you want templated config files @@ -34,32 +34,13 @@ default['openstack']['block-storage']['custom_template_banner'] = ' # Do not edit, changes will be overwritten ' -default['openstack']['block-storage']['verbose'] = 'False' -default['openstack']['block-storage']['debug'] = 'False' - -# Name of this node. This can be an opaque identifier. It is -# not necessarily a hostname, FQDN, or IP address. (StrOpt) -default['openstack']['block-storage']['host'] = nil - # Specify policy.json remote file to import default['openstack']['block-storage']['policyfile_url'] = nil -# Default notification_driver and control exchange -default['openstack']['block-storage']['notification_driver'] = 'cinder.openstack.common.notifier.rpc_notifier' -default['openstack']['block-storage']['control_exchange'] = 'cinder' # Availability zone/region for the OpenStack Block-Storage service default['openstack']['block-storage']['region'] = node['openstack']['region'] default['openstack']['block-storage']['scheduler_role'] = 'os-block-storage-scheduler' -# Number of workers for OpenStack Volume API service. The -# default is equal to the number of CPUs available. (integer -# value) -default['openstack']['block-storage']['osapi_volume_workers'] = [8, node['cpu']['total'].to_i].min - -# Template strings to be used to generate resource names -default['openstack']['block-storage']['volume_name_template'] = 'volume-%s' -default['openstack']['block-storage']['snapshot_name_template'] = 'snapshot-%s' - # The name of the Chef role that knows about the message queue server # that Cinder uses default['openstack']['block-storage']['rabbit_server_chef_role'] = 'os-ops-messaging' @@ -67,212 +48,18 @@ default['openstack']['block-storage']['rabbit_server_chef_role'] = 'os-ops-messa # This is the name of the Chef role that will install the Keystone Service API default['openstack']['block-storage']['keystone_service_chef_role'] = 'keystone' -# Whether to enable cinder-backup service or not -default['openstack']['block-storage']['backup']['enabled'] = false - -# Keystone PKI signing directory -default['openstack']['block-storage']['api']['auth']['cache_dir'] = '/var/cache/cinder/api' - -default['openstack']['block-storage']['api']['auth']['version'] = node['openstack']['api']['auth']['version'] - -# A list of memcached server(s) to use for caching -default['openstack']['block-storage']['api']['auth']['memcached_servers'] = nil - -# Whether token data should be authenticated or authenticated and encrypted. Acceptable values are MAC or ENCRYPT -default['openstack']['block-storage']['api']['auth']['memcache_security_strategy'] = nil - -# This string is used for key derivation -default['openstack']['block-storage']['api']['auth']['memcache_secret_key'] = nil - -# Hash algorithms to use for hashing PKI tokens -default['openstack']['block-storage']['api']['auth']['hash_algorithms'] = 'md5' - -# A PEM encoded Certificate Authority to use when verifying HTTPs connections -default['openstack']['block-storage']['api']['auth']['cafile'] = nil - -# Verify HTTPS connections -default['openstack']['block-storage']['api']['auth']['insecure'] = false - -# If True, this indicates that glance-api allows the client to perform -# insecure SSL(https) requests; this should be the same as the setting -# in the glance-api service. -default['openstack']['block-storage']['image']['glance_api_insecure'] = false - -# Location of ca certificates file to use for glance client requests -default['openstack']['block-storage']['image']['glance_ca_certificates_file'] = nil - -# Which version of the glance API cinder should use when talking to glance. -default['openstack']['block-storage']['image']['glance_api_version'] = 1 - -# Maximum allocatable gigabytes -# Should equal total backend storage, default is 10TB -default['openstack']['block-storage']['max_gigabytes'] = '10000' - -# Storage availability zone -# Default is nova -default['openstack']['block-storage']['storage_availability_zone'] = 'nova' - -# Quota definitions -default['openstack']['block-storage']['quota_volumes'] = '10' -default['openstack']['block-storage']['quota_gigabytes'] = '1000' -default['openstack']['block-storage']['quota_driver'] = 'cinder.quota.DbQuotaDriver' -default['openstack']['block-storage']['quota_snapshots'] = 10 -default['openstack']['block-storage']['no_snapshot_gb_quota'] = false -default['openstack']['block-storage']['use_default_quota_class'] = true - -# Common rpc definitions -default['openstack']['block-storage']['rpc_thread_pool_size'] = 64 -default['openstack']['block-storage']['rpc_conn_pool_size'] = 30 -default['openstack']['block-storage']['rpc_response_timeout'] = 60 -case node['openstack']['mq']['service_type'] -when 'rabbitmq' - default['openstack']['block_storage']['rpc_backend'] = 'cinder.openstack.common.rpc.impl_kombu' -when 'qpid' - default['openstack']['block_storage']['rpc_backend'] = 'cinder.openstack.common.rpc.impl_qpid' -end - -default['openstack']['block-storage']['service_tenant_name'] = 'service' default['openstack']['block-storage']['service_user'] = 'cinder' +default['openstack']['block-storage']['service_tenant_name'] = 'service' default['openstack']['block-storage']['service_role'] = 'service' default['openstack']['block-storage']['service_name'] = 'cinderv2' default['openstack']['block-storage']['service_type'] = 'volumev2' -# SAN Support -default['openstack']['block-storage']['san']['san_ip'] = '127.0.0.1' -default['openstack']['block-storage']['san']['san_login'] = 'admin' -default['openstack']['block-storage']['san']['san_private_key'] = '/v7000_rsa' -# The location(URL) of the san_private_key. This value may also specify HTTP(http://), FTP("ftp://"), or local(file://), if the san private key is in the local, you should also specify this attribute using(file://) -default['openstack']['block-storage']['san']['san_private_key_url'] = nil - -# 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 -default['openstack']['block-storage']['netapp']['dfm_login'] = nil -default['openstack']['block-storage']['netapp']['dfm_password'] = nil -default['openstack']['block-storage']['netapp']['dfm_port'] = '8088' -default['openstack']['block-storage']['netapp']['dfm_web_port'] = '8080' -default['openstack']['block-storage']['netapp']['storage_service'] = 'storage_service' - -# Netapp direct NFS -default['openstack']['block-storage']['netapp']['netapp_server_port'] = '80' -default['openstack']['block-storage']['netapp']['netapp_server_hostname'] = nil -default['openstack']['block-storage']['netapp']['netapp_server_password'] = nil -default['openstack']['block-storage']['netapp']['netapp_server_login'] = nil -default['openstack']['block-storage']['netapp']['export'] = nil -default['openstack']['block-storage']['nfs']['shares_config'] = '/etc/cinder/shares.conf' -default['openstack']['block-storage']['nfs']['mount_point_base'] = '/mnt/cinder-volumes' -default['openstack']['block-storage']['nfs']['nfs_disk_util'] = 'df' -default['openstack']['block-storage']['nfs']['nfs_sparsed_volumes'] = 'true' - -# Storwize/SVC Support -default['openstack']['block-storage']['storwize']['san_ip'] = node['openstack']['block-storage']['san']['san_ip'] -default['openstack']['block-storage']['storwize']['san_login'] = node['openstack']['block-storage']['san']['san_login'] -# If the key is set to nil, the san_login and san_password will be used. -default['openstack']['block-storage']['storwize']['san_private_key'] = node['openstack']['block-storage']['san']['san_private_key'] -default['openstack']['block-storage']['storwize']['san_private_key_url'] = node['openstack']['block-storage']['san']['san_private_key_url'] -default['openstack']['block-storage']['storwize']['storwize_svc_volpool_name'] = 'volpool' -default['openstack']['block-storage']['storwize']['storwize_svc_vol_rsize'] = 2 -default['openstack']['block-storage']['storwize']['storwize_svc_vol_warning'] = 0 -default['openstack']['block-storage']['storwize']['storwize_svc_vol_autoexpand'] = true -default['openstack']['block-storage']['storwize']['storwize_svc_vol_grainsize'] = 256 -default['openstack']['block-storage']['storwize']['storwize_svc_vol_compression'] = false -default['openstack']['block-storage']['storwize']['storwize_svc_vol_easytier'] = true -default['openstack']['block-storage']['storwize']['storwize_svc_flashcopy_timeout'] = 120 -default['openstack']['block-storage']['storwize']['storwize_svc_vol_iogrp'] = 0 -default['openstack']['block-storage']['storwize']['storwize_svc_connection_protocol'] = 'iSCSI' -default['openstack']['block-storage']['storwize']['storwize_svc_iscsi_chap_enabled'] = true -default['openstack']['block-storage']['storwize']['storwize_svc_multipath_enabled'] = false -default['openstack']['block-storage']['storwize']['storwize_svc_multihostmap_enabled'] = true -default['openstack']['block-storage']['storwize']['storwize_svc_allow_tenant_qos'] = false -default['openstack']['block-storage']['storwize']['storwize_svc_stretched_cluster_partner'] = nil - -# SolidFire Support -default['openstack']['block-storage']['solidfire']['san_ip'] = node['openstack']['block-storage']['san']['san_ip'] -default['openstack']['block-storage']['solidfire']['san_login'] = node['openstack']['block-storage']['san']['san_login'] -default['openstack']['block-storage']['solidfire']['sf_emulate'] = 'False' -default['openstack']['block-storage']['solidfire']['iscsi_ip_prefix'] = nil - -# FlashSystem Support -default['openstack']['block-storage']['flashsystem']['san_ip'] = node['openstack']['block-storage']['san']['san_ip'] -default['openstack']['block-storage']['flashsystem']['san_login'] = node['openstack']['block-storage']['san']['san_login'] -# The connection protocol for FlashSystem data path (FC only, will introduce iSCSI in Liberty) -default['openstack']['block-storage']['flashsystem']['flashsystem_connection_protocol'] = 'FC' -# The multipath enablement flag (FC only, iSCSI multipath will be controlled by Nova) -default['openstack']['block-storage']['flashsystem']['flashsystem_multipath_enabled'] = false -# Enable vdisk to multi-host mapping -default['openstack']['block-storage']['flashsystem']['flashsystem_multihostmap_enabled'] = true - -# EMC VMAX/VNX tSupport -# The EmcUserName user's password is stored in an encrypted databag and -# accessed with openstack-common cookbook library's "get_password" routeine. You -# are expected to create the user and pass in a wrapper cookbook. -default['openstack']['block-storage']['emc']['iscsi_target_prefix'] = 'iqn.1992-04.com.emc' -default['openstack']['block-storage']['emc']['cinder_emc_config_file'] = '/etc/cinder/cinder_emc_config.xml' -default['openstack']['block-storage']['emc']['StorageType'] = 0 -default['openstack']['block-storage']['emc']['EcomServerIP'] = '127.0.0.1' -default['openstack']['block-storage']['emc']['EcomServerPort'] = '5988' -default['openstack']['block-storage']['emc']['EcomUserName'] = 'admin' -default['openstack']['block-storage']['emc']['MaskingView'] = nil - -# VMware Support -default['openstack']['block-storage']['vmware']['secret_name'] = 'openstack_vmware_secret_name' -default['openstack']['block-storage']['vmware']['vmware_host_ip'] = '' -default['openstack']['block-storage']['vmware']['vmware_host_username'] = '' -default['openstack']['block-storage']['vmware']['vmware_wsdl_location'] = nil -default['openstack']['block-storage']['vmware']['vmware_api_retry_count'] = 10 -default['openstack']['block-storage']['vmware']['vmware_task_poll_interval'] = 5 -default['openstack']['block-storage']['vmware']['vmware_volume_folder'] = 'cinder-volumes' -default['openstack']['block-storage']['vmware']['vmware_image_transfer_timeout_secs'] = 7200 -default['openstack']['block-storage']['vmware']['vmware_max_objects_retrieval'] = 100 - -# IBM GPFS Support -default['openstack']['block-storage']['gpfs']['gpfs_mount_point_base'] = node['openstack']['block-storage']['gpfs']['gpfs_mount_point_base'] -default['openstack']['block-storage']['gpfs']['gpfs_images_dir'] = node['openstack']['block-storage']['gpfs']['gpfs_images_dir'] -default['openstack']['block-storage']['gpfs']['gpfs_images_share_mode'] = 'copy_on_write' -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']['nas_ssh_port'] = node['openstack']['block-storage']['nfs']['nas_ssh_port'] -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 -# Platform type to be used as backend storage, valid values are: -# 'v7ku : for using IBM Storwize V7000 Unified -# 'sonas : for using IBM Scale Out NAS -# 'gpfs-nas : for using NFS based IBM GPFS deployments -default['openstack']['block-storage']['ibmnas']['ibmnas_platform_type'] = 'v7ku' - # logging attribute default['openstack']['block-storage']['syslog']['use'] = false default['openstack']['block-storage']['syslog']['facility'] = 'LOG_LOCAL2' default['openstack']['block-storage']['syslog']['config_facility'] = 'local2' -default['openstack']['block-storage']['api']['ratelimit'] = 'True' -default['openstack']['block-storage']['cron']['minute'] = '00' -default['openstack']['block-storage']['cron']['audit_logfile'] = '/var/log/cinder/audit.log' - -default['openstack']['block-storage']['volume']['state_path'] = '/var/lib/cinder' -default['openstack']['block-storage']['volume']['volumes_dir'] = '/var/lib/cinder/volumes' -default['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.lvm.LVMVolumeDriver' -default['openstack']['block-storage']['volume']['volume_group'] = 'cinder-volumes' default['openstack']['block-storage']['volume']['volume_group_size'] = 40 -default['openstack']['block-storage']['volume']['volume_clear_size'] = 0 -default['openstack']['block-storage']['volume']['volume_clear'] = 'zero' - -default['openstack']['block-storage']['volume']['create_volume_group'] = false # Type of volume group to create: # - 'file' for basic 40g file for testing # - 'block_devices' for using block devices, specified in block_devices attribute @@ -281,72 +68,13 @@ default['openstack']['block-storage']['volume']['create_volume_group_type'] = 'f # Examples: '/dev/sdx /dev/sdx1' or '/dev/sd[k-m]1' default['openstack']['block-storage']['volume']['block_devices'] = nil -default['openstack']['block-storage']['volume']['iscsi_helper'] = 'tgtadm' -default['openstack']['block-storage']['volume']['iscsi_ip_address'] = node['ipaddress'] -default['openstack']['block-storage']['volume']['iscsi_port'] = '3260' - -# Ceph/RADOS options -default['openstack']['block-storage']['rbd']['cinder']['pool'] = 'volumes' -default['openstack']['block-storage']['rbd']['glance']['pool'] = 'images' -default['openstack']['block-storage']['rbd']['nova']['pool'] = 'instances' -default['openstack']['block-storage']['rbd']['user'] = 'cinder' -default['openstack']['block-storage']['rbd']['secret_uuid'] = '00000000-0000-0000-0000-000000000000' -default['openstack']['block-storage']['rbd']['flatten_volume'] = false -default['openstack']['block-storage']['rbd']['max_clone_depth'] = 5 -default['openstack']['block-storage']['rbd']['chunk_size'] = 4 -default['openstack']['block-storage']['rbd']['rados_timeout'] = '-1' -default['openstack']['block-storage']['rbd']['conf_dir'] = '/etc/ceph/ceph.conf' - -# Multiple backend support -# Allow multiple backends configured in cinder.conf -# For example: { -# 'lvm1' => { -# 'volume_driver': 'cinder.volume.drivers.lvm.LVMISCSIDriver', -# 'volume_backend_name': 'lvm-backend-1' -# } -# 'lvm2' => { -# 'volume_driver': 'cinder.volume.drivers.lvm.LVMISCSIDriver', -# 'volume_backend_name': 'lvm-backend-2' -# } -# } -default['openstack']['block-storage']['volume']['multi_backend'] = nil - -# Default volume-type for volumes to be created as when client does not request -# a specific type. Volume types are configured from cinder-client and -# will reference the backend name. -default['openstack']['block-storage']['volume']['default_volume_type'] = nil - -# Misc option support -# Allow additional strings to be added to cinder.conf -# For example: ['# Comment', 'key=value'] -default['openstack']['block-storage']['misc_cinder'] = [] - -# Default lock_path -# The lock_path normally uses /var/lock/cinder, but it's does not work -# in cases like systemd, so setting lock_path to $state_path/lock like -# in nova and neutron. -default['openstack']['block-storage']['lock_path'] = - "#{node['openstack']['block-storage']['volume']['state_path']}/lock" - -# Whether to enable cinder v1 api or not -default['openstack']['block-storage']['enable_v1_api'] = 'False' - -# Whether to enable cinder v2 api or not -default['openstack']['block-storage']['enable_v2_api'] = 'True' - -# The full class name of the key manager api class -default['openstack']['block-storage']['keymgr']['api_class'] = 'cinder.keymgr.conf_key_mgr.ConfKeyManager' - -# Fixed key returned by key manager, specified in hex -default['openstack']['block-storage']['keymgr']['fixed_key'] = nil +default['openstack']['block-storage']['user'] = 'cinder' +default['openstack']['block-storage']['group'] = 'cinder' case platform_family -when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this +when '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'], 'cinder_api_packages' => ['python-cinderclient'], @@ -368,39 +96,12 @@ when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this 'cinder_flashsystem_packages' => ['sysfsutils'], 'package_overrides' => '' } -when 'suse' - # operating system user and group names - default['openstack']['block-storage']['user'] = 'openstack-cinder' - default['openstack']['block-storage']['group'] = 'openstack-cinder' - default['openstack']['block-storage']['platform'] = { - 'cinder_common_packages' => ['openstack-cinder'], - 'cinder_api_packages' => ['openstack-cinder-api'], - 'cinder_api_service' => 'openstack-cinder-api', - 'cinder_client_packages' => ['python-cinderclient'], - 'cinder_scheduler_packages' => ['openstack-cinder-scheduler'], - 'cinder_scheduler_service' => 'openstack-cinder-scheduler', - 'cinder_backup_packages' => ['openstack-cinder-backup'], - 'cinder_backup_service' => 'openstack-cinder-backup', - 'cinder_volume_packages' => ['openstack-cinder-volume', 'qemu-img'], - 'cinder_volume_service' => 'openstack-cinder-volume', - 'cinder_ceph_packages' => ['python-ceph', 'ceph-common'], - 'cinder_iscsitarget_packages' => ['tgt'], - 'cinder_iscsitarget_service' => 'tgtd', - 'cinder_nfs_packages' => ['nfs-utils'], - 'cinder_emc_packages' => ['python-pywbem'], - 'cinder_svc_packages' => ['sysfsutils'], - 'cinder_lvm_packages' => ['lvm2'], - 'cinder_flashsystem_packages' => ['sysfsutils'] - } when 'debian' # operating system user and group names - default['openstack']['block-storage']['user'] = 'cinder' - default['openstack']['block-storage']['group'] = 'cinder' default['openstack']['block-storage']['platform'] = { 'cinder_common_packages' => ['cinder-common'], 'cinder_api_packages' => ['cinder-api', 'python-cinderclient'], 'cinder_api_service' => 'cinder-api', - 'cinder_client_packages' => ['python-cinderclient'], 'cinder_volume_packages' => ['cinder-volume', 'qemu-utils'], 'cinder_volume_service' => 'cinder-volume', 'cinder_scheduler_packages' => ['cinder-scheduler'], @@ -419,33 +120,26 @@ when 'debian' } end -# Attributes for cinder-backup service -default['openstack']['block-storage']['backup']['driver'] = 'cinder.backup.drivers.swift' +# ******************** OpenStack Volume Endpoints ***************************** -# Swift support -# The URL of Swift endpoint (string value) -default['openstack']['block-storage']['backup']['swift']['url'] = nil -# Info to match when looking for swift in the service catalog -default['openstack']['block-storage']['backup']['swift']['catalog_info'] = 'object-store:swift:publicURL' -# Swift authentication mechanism (string value) -default['openstack']['block-storage']['backup']['swift']['auth'] = 'per_user' -# Swift authentication version -default['openstack']['block-storage']['backup']['swift']['auth_version'] = 1 -# Swift user name -default['openstack']['block-storage']['backup']['swift']['user'] = nil -# Swift tenant/account name. Required when connecting -default['openstack']['block-storage']['backup']['swift']['tenant'] = nil -# Swift key for authentication (string value) -default['openstack']['block-storage']['backup']['swift']['key'] = nil -# The default Swift container to use -default['openstack']['block-storage']['backup']['swift']['container'] = 'volumebackups' -# The size in bytes of Swift backup objects -default['openstack']['block-storage']['backup']['swift']['object_size'] = 52428800 -# The size in bytes that changes are tracked for incremental backups -default['openstack']['block-storage']['backup']['swift']['block_size'] = 32768 -# The number of retries to make for Swift operations -default['openstack']['block-storage']['backup']['swift']['retry_attempts'] = 3 -# The backoff time in seconds between Swift retries -default['openstack']['block-storage']['backup']['swift']['retry_backoff'] = 2 -# Enable or Disable the timer to send the periodic progress notifications to Ceilometer when backing up the volume to the Swift backend storage. -default['openstack']['block-storage']['backup']['swift']['enable_progress_timer'] = 'True' +# The OpenStack Volume (Cinder) API endpoint +%w(public internal admin).each do |ep_type| + default['openstack']['endpoints']['block-storage'][ep_type]['scheme'] = 'http' + default['openstack']['endpoints']['block-storage'][ep_type]['path'] = '/v2/%(tenant_id)s' + %w(endpoints bind_service).each do |type| + default['openstack'][type]['block-storage'][ep_type]['host'] = '127.0.0.1' + default['openstack'][type]['block-storage'][ep_type]['port'] = '8776' + end +end + +# ============================= rootwrap Configuration =================== +# use cinder root wrap +default['openstack']['block-storage']['use_rootwrap'] = true +# rootwrap.conf +default['openstack']['block-storage']['rootwrap']['conf'].tap do |conf| + conf['DEFAULT']['filters_path'] = '/etc/cinder/rootwrap.d,/usr/share/cinder/rootwrap' + conf['DEFAULT']['exec_dirs'] = '/sbin,/usr/sbin,/bin,/usr/bin' + conf['DEFAULT']['use_syslog'] = false + conf['DEFAULT']['syslog_log_facility'] = 'syslog' + conf['DEFAULT']['syslog_log_level'] = 'ERROR' +end diff --git a/metadata.rb b/metadata.rb index 1c1d50f..13bba40 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,7 +5,7 @@ maintainer_email 'openstack-dev@lists.openstack.org' license 'Apache 2.0' description 'The OpenStack Advanced Volume Management service Cinder.' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '12.0.0' +version '13.0.0' recipe 'openstack-block-storage::api', 'Installs the cinder-api, sets up the cinder database, and cinder service/user/endpoints in keystone' recipe 'openstack-block-storage::client', 'Install packages required for cinder client' @@ -15,14 +15,13 @@ recipe 'openstack-block-storage::scheduler', 'Installs the cinder-scheduler serv recipe 'openstack-block-storage::volume', 'Installs the cinder-volume service and sets up the iscsi helper' recipe 'openstack-block-storage::backup', 'Installs the cinder-backup service' -%w(ubuntu fedora redhat centos suse).each do |os| +%w(ubuntu redhat centos).each do |os| supports os end depends 'apt', '~> 2.8' -depends 'openstack-common', '>= 12.0.0' -depends 'openstack-identity', '>= 12.0.0' -depends 'openstack-image', '>= 12.0.0' +depends 'openstack-common', '>= 13.0.0' +depends 'openstack-identity', '>= 13.0.0' +depends 'openstack-image', '>= 13.0.0' depends 'selinux', '~> 0.9.0' depends 'python', '~> 1.4.6' -depends 'ceph', '>= 0.8.1' diff --git a/recipes/api.rb b/recipes/api.rb index d5c7494..69d236d 100644 --- a/recipes/api.rb +++ b/recipes/api.rb @@ -20,8 +20,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -class ::Chef::Recipe # rubocop:disable Documentation +# Make Openstack object available in Chef::Recipe +class ::Chef::Recipe include ::Openstack end @@ -43,9 +43,10 @@ node['openstack']['db']['python_packages'][db_type].each do |pkg| end end -directory ::File.dirname(node['openstack']['block-storage']['api']['auth']['cache_dir']) do +directory node['openstack']['block-storage']['conf']['keystone_authtoken']['signing_dir'] do owner node['openstack']['block-storage']['user'] group node['openstack']['block-storage']['group'] + recursive true mode 00700 end @@ -53,7 +54,10 @@ service 'cinder-api' do service_name platform_options['cinder_api_service'] supports status: true, restart: true action :enable - subscribes :restart, 'template[/etc/cinder/cinder.conf]' + subscribes :restart, [ + 'template[/etc/cinder/cinder.conf]', + 'remote_file[/etc/cinder/policy.json]' + ] end execute 'cinder-manage db sync' do @@ -67,6 +71,5 @@ if node['openstack']['block-storage']['policyfile_url'] owner node['openstack']['block-storage']['user'] group node['openstack']['block-storage']['group'] mode 00644 - notifies :restart, 'service[cinder-api]' end end diff --git a/recipes/backup.rb b/recipes/backup.rb index 2206580..7a158a5 100644 --- a/recipes/backup.rb +++ b/recipes/backup.rb @@ -16,8 +16,6 @@ # limitations under the License. # -return unless node['openstack']['block-storage']['backup']['enabled'] - include_recipe 'openstack-block-storage::cinder-common' platform_options = node['openstack']['block-storage']['platform'] diff --git a/recipes/cinder-common.rb b/recipes/cinder-common.rb index 4128ecd..f988341 100644 --- a/recipes/cinder-common.rb +++ b/recipes/cinder-common.rb @@ -11,9 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# - -class ::Chef::Recipe # rubocop:disable Documentation +# Make Openstack object available in Chef::Recipe +class ::Chef::Recipe include ::Openstack end @@ -32,39 +31,32 @@ end db_user = node['openstack']['db']['block-storage']['username'] db_pass = get_password 'db', 'cinder' -sql_connection = db_uri('block-storage', db_user, db_pass) +node.default['openstack']['block-storage']['conf_secrets'] + .[]('database')['connection'] = + db_uri('block-storage', db_user, db_pass) + if node['openstack']['endpoints']['db']['enabled_slave'] - slave_connection = db_uri('block-storage', db_user, db_pass, true) + node.default['openstack']['block-storage']['conf_secrets'] + .[]('database')['slave_connection'] = + db_uri('block-storage', db_user, db_pass, true) end -mq_service_type = node['openstack']['mq']['block-storage']['service_type'] - -if mq_service_type == 'rabbitmq' - if node['openstack']['mq']['block-storage']['rabbit']['ha'] - rabbit_hosts = rabbit_servers - end - mq_password = get_password 'user', node['openstack']['mq']['block-storage']['rabbit']['userid'] -elsif mq_service_type == 'qpid' - mq_password = get_password 'user', node['openstack']['mq']['block-storage']['qpid']['username'] +if node['openstack']['block-storage']['conf']['DEFAULT']['rpc_backend'] == 'rabbit' + user = node['openstack']['mq']['block-storage']['rabbit']['userid'] + node.default['openstack']['block-storage']['conf_secrets'] + .[]('oslo_messaging_rabbit')['rabbit_userid'] = user + node.default['openstack']['block-storage']['conf_secrets'] + .[]('oslo_messaging_rabbit')['rabbit_password'] = + get_password 'user', user end -case node['openstack']['block-storage']['volume']['driver'] -when 'cinder.volume.drivers.ibm.storwize_svc.StorwizeSVCDriver' - if node['openstack']['block-storage']['storwize']['san_private_key'].to_s.empty? - storwize_pass = get_password 'user', node['openstack']['block-storage']['storwize']['san_login'] - end -when 'cinder.volume.drivers.solidfire.SolidFire' - solidfire_pass = get_password 'user', node['openstack']['block-storage']['solidfire']['san_login'] -when 'cinder.volume.drivers.ibm.flashsystem.FlashSystemDriver' - flashsystem_pass = get_password 'user', node['openstack']['block-storage']['flashsystem']['san_login'] -when 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver' - ibmnas_pass = get_password 'user', node['openstack']['block-storage']['ibmnas']['nas_login'] -when 'cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver' - vmware_host_pass = get_password 'token', node['openstack']['block-storage']['vmware']['secret_name'] -end - -glance_api_endpoint = internal_endpoint 'image-api' -cinder_api_bind = endpoint 'block-storage-api-bind' +glance_api_endpoint = internal_endpoint 'image_api' +cinder_api_bind = node['openstack']['bind_service']['block-storage']['public'] +identity_endpoint = public_endpoint 'identity' +node.default['openstack']['block-storage']['conf_secrets'] + .[]('keystone_authtoken')['password'] = + get_password 'service', 'openstack-block-storage' +auth_url = auth_uri_transform(identity_endpoint.to_s, node['openstack']['api']['auth']['version']) directory '/etc/cinder' do group node['openstack']['block-storage']['group'] @@ -73,67 +65,53 @@ directory '/etc/cinder' do action :create end -multi_backend_sections = {} -multi_backend = node['openstack']['block-storage']['volume']['multi_backend'] -if multi_backend.nil? - enabled_drivers = [node['openstack']['block-storage']['volume']['driver']] -else - enabled_drivers = [] - multi_backend.each do |drv, options| - optlines = [] - options.each do |optkey, optvalue| - optlines.push "#{optkey} = #{optvalue}" - enabled_drivers.push optvalue if optkey == 'volume_driver' - end - multi_backend_sections[drv] = optlines - end +node.default['openstack']['block-storage']['conf'].tap do |conf| + conf['DEFAULT']['glance_host'] = glance_api_endpoint.host + conf['DEFAULT']['glance_port'] = glance_api_endpoint.port + conf['DEFAULT']['glance_api_servers'] = "#{glance_api_endpoint.scheme}://#{glance_api_endpoint.host}:#{glance_api_endpoint.port}" + conf['DEFAULT']['osapi_volume_listen'] = cinder_api_bind.host + conf['DEFAULT']['osapi_volume_listen_port'] = cinder_api_bind.port + conf['keystone_authtoken']['auth_url'] = auth_url end -identity_endpoint = internal_endpoint 'identity-internal' -identity_admin_endpoint = admin_endpoint 'identity-admin' -service_pass = get_password 'service', 'openstack-block-storage' - -auth_uri = auth_uri_transform(identity_endpoint.to_s, node['openstack']['block-storage']['api']['auth']['version']) -identity_uri = identity_uri_transform(identity_admin_endpoint) +# merge all config options and secrets to be used in the nova.conf.erb +cinder_conf_options = merge_config_options 'block-storage' template '/etc/cinder/cinder.conf' do - source 'cinder.conf.erb' + source 'openstack-service.conf.erb' + cookbook 'openstack-common' group node['openstack']['block-storage']['group'] owner node['openstack']['block-storage']['user'] mode 00640 variables( - sql_connection: sql_connection, - slave_connection: slave_connection, - mq_service_type: mq_service_type, - mq_password: mq_password, - rabbit_hosts: rabbit_hosts, - glance_scheme: glance_api_endpoint.scheme, - glance_host: glance_api_endpoint.host, - glance_port: glance_api_endpoint.port, - ibmnas_pass: ibmnas_pass, - solidfire_pass: solidfire_pass, - flashsystem_pass: flashsystem_pass, - storwize_pass: storwize_pass, - volume_api_bind_address: cinder_api_bind.host, - volume_api_bind_port: cinder_api_bind.port, - vmware_host_pass: vmware_host_pass, - enabled_drivers: enabled_drivers, - multi_backend_sections: multi_backend_sections, - auth_uri: auth_uri, - identity_uri: identity_uri, - service_pass: service_pass + service_config: cinder_conf_options ) end -directory node['openstack']['block-storage']['lock_path'] do +# delete all secrets saved in the attribute +# node['openstack']['block-storage']['conf_secrets'] after creating the cinder.conf +ruby_block "delete all attributes in node['openstack']['block-storage']['conf_secrets']" do + block do + node.rm(:openstack, :'block-storage', :conf_secrets) + end +end + +directory node['openstack']['block-storage']['conf']['oslo_concurrency']['lock_path'] do group node['openstack']['block-storage']['group'] owner node['openstack']['block-storage']['user'] + recursive true mode 00755 end -template '/etc/cinder/rootwrap.conf' do - source 'rootwrap.conf.erb' - owner 'root' - group 'root' - mode 00644 +if node['openstack']['block-storage']['use_rootwrap'] + template '/etc/cinder/rootwrap.conf' do + source 'openstack-service.conf.erb' + cookbook 'openstack-common' + owner 'root' + group 'root' + mode 00644 + variables( + service_config: node['openstack']['block-storage']['rootwrap']['conf'] + ) + end end diff --git a/recipes/client.rb b/recipes/client.rb index 6ac5086..84ee995 100644 --- a/recipes/client.rb +++ b/recipes/client.rb @@ -17,8 +17,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -class ::Chef::Recipe # rubocop:disable Documentation +# Make Openstack object available in Chef::Recipe +class ::Chef::Recipe include ::Openstack end @@ -26,7 +26,6 @@ platform_options = node['openstack']['block-storage']['platform'] platform_options['cinder_client_packages'].each do |pkg| package pkg do options platform_options['package_overrides'] - action :upgrade end end diff --git a/recipes/identity_registration.rb b/recipes/identity_registration.rb index 1b676c9..44e91c4 100644 --- a/recipes/identity_registration.rb +++ b/recipes/identity_registration.rb @@ -21,17 +21,17 @@ # require 'uri' - -class ::Chef::Recipe # rubocop:disable Documentation +# Make Openstack object available in Chef::Recipe +class ::Chef::Recipe include ::Openstack end -identity_admin_endpoint = admin_endpoint 'identity-admin' +identity_admin_endpoint = admin_endpoint 'identity' bootstrap_token = get_password 'token', 'openstack_identity_bootstrap_token' auth_uri = ::URI.decode identity_admin_endpoint.to_s -admin_cinder_api_endpoint = admin_endpoint 'block-storage-api' -internal_cinder_api_endpoint = internal_endpoint 'block-storage-api' -public_cinder_api_endpoint = public_endpoint 'block-storage-api' +admin_cinder_api_endpoint = admin_endpoint 'block-storage' +internal_cinder_api_endpoint = internal_endpoint 'block-storage' +public_cinder_api_endpoint = public_endpoint 'block-storage' service_pass = get_password 'service', 'openstack-block-storage' region = node['openstack']['block-storage']['region'] service_tenant_name = node['openstack']['block-storage']['service_tenant_name'] @@ -45,7 +45,6 @@ openstack_identity_register 'Register Service Tenant' do bootstrap_token bootstrap_token tenant_name service_tenant_name tenant_description 'Service Tenant' - action :create_tenant end @@ -75,6 +74,40 @@ openstack_identity_register 'Register Cinder V2 Volume Endpoint' do action :create_endpoint end +# --------------------- WORKAROUND --------------------------------------# +# Currently this bug is still open +# (https://bugs.launchpad.net/horizon/+bug/1415712) and we need to register and +# enable the cinder v1 api to make it available via the dashboard. This should +# be removed with the final mitaka release. + +openstack_identity_register 'Register Cinder V1 Volume Service' do + auth_uri auth_uri + bootstrap_token bootstrap_token + service_name ((service_name).gsub(/v2/, '')) + service_type ((service_type).gsub(/v2/, '')) + service_description 'Cinder Volume Service V1' + endpoint_region region + endpoint_adminurl ((::URI.decode admin_cinder_api_endpoint.to_s).gsub(/v2/, 'v1')) + endpoint_internalurl ((::URI.decode internal_cinder_api_endpoint.to_s).gsub(/v2/, 'v1')) + endpoint_publicurl ((::URI.decode public_cinder_api_endpoint.to_s).gsub(/v2/, 'v1')) + action :create_service +end + +openstack_identity_register 'Register Cinder V1 Volume Endpoint' do + auth_uri auth_uri + bootstrap_token bootstrap_token + service_name ((service_name).gsub(/v2/, '')) + service_type ((service_type).gsub(/v2/, '')) + service_description 'Cinder Volume Service V1' + endpoint_region region + endpoint_adminurl ((::URI.decode admin_cinder_api_endpoint.to_s).gsub(/v2/, 'v1')) + endpoint_internalurl ((::URI.decode internal_cinder_api_endpoint.to_s).gsub(/v2/, 'v1')) + endpoint_publicurl ((::URI.decode public_cinder_api_endpoint.to_s).gsub(/v2/, 'v1')) + action :create_endpoint +end + +# --------------------- WORKAROUND --------------------------------------# + openstack_identity_register 'Register Cinder Service User' do auth_uri auth_uri bootstrap_token bootstrap_token diff --git a/recipes/scheduler.rb b/recipes/scheduler.rb index e8753fb..0ae374e 100644 --- a/recipes/scheduler.rb +++ b/recipes/scheduler.rb @@ -28,7 +28,6 @@ platform_options = node['openstack']['block-storage']['platform'] platform_options['cinder_scheduler_packages'].each do |pkg| package pkg do options platform_options['package_overrides'] - action :upgrade end end @@ -46,24 +45,3 @@ service 'cinder-scheduler' do action [:enable, :start] subscribes :restart, 'template[/etc/cinder/cinder.conf]' end - -audit_bin_dir = platform_family?('debian') ? '/usr/bin' : '/usr/local/bin' -audit_log = node['openstack']['block-storage']['cron']['audit_logfile'] - -if node['openstack']['telemetry'] - scheduler_role = node['openstack']['block-storage']['scheduler_role'] - results = search(:node, "roles:#{scheduler_role}") - cron_node = results.map { |a| a.name }.sort[0] - Chef::Log.debug("Volume audit cron node: #{cron_node}") - - cron 'cinder-volume-usage-audit' do - day node['openstack']['block-storage']['cron']['day'] || '*' - hour node['openstack']['block-storage']['cron']['hour'] || '*' - minute node['openstack']['block-storage']['cron']['minute'] - month node['openstack']['block-storage']['cron']['month'] || '*' - weekday node['openstack']['block-storage']['cron']['weekday'] || '*' - command "#{audit_bin_dir}/cinder-volume-usage-audit > #{audit_log} 2>&1" - action cron_node == node.name ? :create : :delete - user node['openstack']['block-storage']['user'] - end -end diff --git a/recipes/volume.rb b/recipes/volume.rb index b51df97..79f6202 100644 --- a/recipes/volume.rb +++ b/recipes/volume.rb @@ -52,209 +52,6 @@ platform_options['cinder_iscsitarget_packages'].each do |pkg| end end -case node['openstack']['block-storage']['volume']['driver'] -when 'cinder.volume.drivers.netapp.iscsi.NetAppISCSIDriver' - node.override['openstack']['block-storage']['netapp']['dfm_password'] = get_password 'service', 'netapp' - -when 'cinder.volume.drivers.rbd.RBDDriver' - include_recipe 'ceph' - - cinder_pool = node['openstack']['block-storage']['rbd']['cinder']['pool'] - nova_pool = node['openstack']['block-storage']['rbd']['nova']['pool'] - glance_pool = node['openstack']['block-storage']['rbd']['glance']['pool'] - - caps = { 'mon' => 'allow r', - 'osd' => "allow class-read object_prefix rbd_children, allow rwx pool=#{cinder_pool}, allow rwx pool=#{nova_pool}, allow rx pool=#{glance_pool}" } - - ceph_client node['openstack']['block-storage']['rbd']['user'] do - name node['openstack']['block-storage']['rbd']['user'] - caps caps - keyname "client.#{node['openstack']['block-storage']['rbd']['user']}" - filename "/etc/ceph/ceph.client.#{node['openstack']['block-storage']['rbd']['user']}.keyring" - owner node['openstack']['block-storage']['user'] - group node['openstack']['block-storage']['group'] - - action :add - notifies :restart, 'service[cinder-volume]' - end - -when 'cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver' - node.override['openstack']['block-storage']['netapp']['netapp_server_password'] = get_password 'service', 'netapp-filer' - - directory node['openstack']['block-storage']['nfs']['mount_point_base'] do - owner node['openstack']['block-storage']['user'] - group node['openstack']['block-storage']['group'] - action :create - end - - template node['openstack']['block-storage']['nfs']['shares_config'] do - source 'shares.conf.erb' - mode '0600' - owner node['openstack']['block-storage']['user'] - group node['openstack']['block-storage']['group'] - variables( - host: node['openstack']['block-storage']['netapp']['netapp_server_hostname'], - export: node['openstack']['block-storage']['netapp']['export'] - ) - notifies :restart, 'service[cinder-volume]' - end - - platform_options['cinder_nfs_packages'].each do |pkg| - package pkg do - options platform_options['package_overrides'] - action :upgrade - end - end - -when 'cinder.volume.drivers.ibm.storwize_svc.StorwizeSVCDriver' - san_private_key = node['openstack']['block-storage']['storwize']['san_private_key'] - san_private_key_url = node['openstack']['block-storage']['storwize']['san_private_key_url'] - - if san_private_key && san_private_key_url - remote_file san_private_key do - source san_private_key_url - mode '0400' - owner node['openstack']['block-storage']['user'] - group node['openstack']['block-storage']['group'] - end - end - - platform_options['cinder_svc_packages'].each do |pkg| - package pkg do - options platform_options['package_overrides'] - action :upgrade - end - end - -when 'cinder.volume.drivers.ibm.flashsystem.FlashSystemDriver' - platform_options['cinder_flashsystem_packages'].each do |pkg| - package pkg do - options platform_options['package_overrides'] - action :upgrade - end - end - -when 'cinder.volume.drivers.ibm.gpfs.GPFSDriver' - directory node['openstack']['block-storage']['gpfs']['gpfs_mount_point_base'] do - mode '0755' - owner node['openstack']['block-storage']['user'] - group node['openstack']['block-storage']['group'] - recursive true - end - multi_backend = node['openstack']['block-storage']['volume']['multi_backend'] - unless multi_backend.nil? - multi_backend.each do |_drv, options| - options.select { |optkey, _optvalue| optkey == 'gpfs_mount_point_base' }.each do |_optkey, optvalue| - directory optvalue do - mode '0755' - owner node['openstack']['block-storage']['user'] - group node['openstack']['block-storage']['group'] - recursive true - end - end - end - 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.LVMVolumeDriver' - - platform_options['cinder_lvm_packages'].each do |pkg| - package pkg do - options platform_options['package_overrides'] - action :upgrade - end - end - - if node['openstack']['block-storage']['volume']['create_volume_group'] - vg_name = node['openstack']['block-storage']['volume']['volume_group'] - - case node['openstack']['block-storage']['volume']['create_volume_group_type'] - when 'file' - volume_size = node['openstack']['block-storage']['volume']['volume_group_size'] - seek_count = volume_size.to_i * 1024 - vg_file = "#{node['openstack']['block-storage']['volume']['state_path']}/#{vg_name}.img" - - # create volume group - execute 'Create Cinder volume group' do - command "dd if=/dev/zero of=#{vg_file} bs=1M seek=#{seek_count} count=0; vgcreate #{vg_name} $(losetup --show -f #{vg_file})" - action :run - not_if "vgs #{vg_name}" - end - - template '/etc/init.d/cinder-group-active' do - source 'cinder-group-active.erb' - mode '755' - variables( - volume_name: vg_name, - volume_file: vg_file - ) - notifies :start, 'service[cinder-group-active]', :immediately - end - - service 'cinder-group-active' do - service_name 'cinder-group-active' - - action [:enable, :start] - end - - when 'block_devices' - - block_devices = node['openstack']['block-storage']['volume']['block_devices'] - execute 'Create Cinder volume group with block devices' do - command "pvcreate #{block_devices}; vgcreate #{vg_name} #{block_devices}" - action :run - not_if "vgs #{vg_name}" - end - end - end - -when 'cinder.volume.drivers.emc.emc_smis_iscsi.EMCSMISISCSIDriver' - platform_options['cinder_emc_packages'].each do |pkg| - package pkg do - options platform_options['package_overrides'] - action :upgrade - end - end - - ecom_password = get_password('user', node['openstack']['block-storage']['emc']['EcomUserName']) - - template node['openstack']['block-storage']['emc']['cinder_emc_config_file'] do - source 'cinder_emc_config.xml.erb' - variables( - ecom_password: ecom_password - ) - mode 00644 - notifies :restart, 'service[iscsitarget]', :immediately - end -end - service 'cinder-volume' do service_name platform_options['cinder_volume_service'] supports status: true, restart: true diff --git a/recipes/volume_driver_lvm.rb b/recipes/volume_driver_lvm.rb new file mode 100644 index 0000000..ccb8729 --- /dev/null +++ b/recipes/volume_driver_lvm.rb @@ -0,0 +1,66 @@ +# encoding: UTF-8 +# +# Cookbook Name:: openstack-block-storage +# Recipe:: volume_driver_lvm +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +platform_options = node['openstack']['block-storage']['platform'] +platform_options['cinder_lvm_packages'].each do |pkg| + package pkg do + options platform_options['package_overrides'] + action :upgrade + end +end + +# TODO: (jklare) this whole section should be refactored and probably include an +# external cookbook for managing lvm stuff + +vg_name = node['openstack']['block-storage']['conf']['DEFAULT']['volume_group'] +case node['openstack']['block-storage']['volume']['create_volume_group_type'] +when 'file' + volume_size = node['openstack']['block-storage']['volume']['volume_group_size'] + seek_count = volume_size.to_i * 1024 + vg_file = "#{node['openstack']['block-storage']['conf']['DEFAULT']['state_path']}/#{vg_name}.img" + + # create volume group + execute 'Create Cinder volume group' do + command "dd if=/dev/zero of=#{vg_file} bs=1M seek=#{seek_count} count=0; vgcreate #{vg_name} $(losetup --show -f #{vg_file})" + action :run + not_if "vgs #{vg_name}" + end + + template '/etc/init.d/cinder-group-active' do + source 'cinder-group-active.erb' + mode '755' + variables( + volume_name: vg_name, + volume_file: vg_file + ) + notifies :start, 'service[cinder-group-active]', :immediately + end + + service 'cinder-group-active' do + service_name 'cinder-group-active' + action [:enable, :start] + end + +when 'block_devices' + block_devices = node['openstack']['block-storage']['volume']['block_devices'] + execute 'Create Cinder volume group with block devices' do + command "pvcreate #{block_devices}; vgcreate #{vg_name} #{block_devices}" + action :run + not_if "vgs #{vg_name}" + end +end diff --git a/spec/api-opensuse_spec.rb b/spec/api-opensuse_spec.rb deleted file mode 100644 index 22b3443..0000000 --- a/spec/api-opensuse_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -# encoding: UTF-8 -# -# Cookbook Name:: openstack-block-storage - -require_relative 'spec_helper' - -describe 'openstack-block-storage::api' do - describe 'suse' do - let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) } - let(:node) { runner.node } - let(:chef_run) { runner.converge(described_recipe) } - - include_context 'block-storage-stubs' - - it 'upgrades cinder api package' do - expect(chef_run).to upgrade_package 'openstack-cinder-api' - end - - it 'upgrades mysql python package' do - expect(chef_run).to upgrade_package 'python-mysql' - end - - it 'upgrades postgresql python packages if explicitly told' do - node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql' - - expect(chef_run).to upgrade_package 'python-psycopg2' - expect(chef_run).not_to upgrade_package 'python-mysql' - end - - it 'starts cinder api on boot' do - expect(chef_run).to enable_service 'openstack-cinder-api' - end - - expect_creates_cinder_conf( - 'service[cinder-api]', 'openstack-cinder', 'openstack-cinder') - end -end diff --git a/spec/api_spec.rb b/spec/api_spec.rb index 5df877c..d04f2d0 100644 --- a/spec/api_spec.rb +++ b/spec/api_spec.rb @@ -35,8 +35,8 @@ describe 'openstack-block-storage::api' do expect(chef_run).not_to upgrade_package('python-mysqldb') end - describe '/var/cache/cinder' do - let(:dir) { chef_run.directory('/var/cache/cinder') } + describe '/var/cache/cinder/api' do + let(:dir) { chef_run.directory('/var/cache/cinder/api') } it 'should create the directory' do expect(chef_run).to create_directory(dir.name).with( diff --git a/spec/backup-suse_spec.rb b/spec/backup-suse_spec.rb deleted file mode 100644 index 8ee21c4..0000000 --- a/spec/backup-suse_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ -# encoding: UTF-8 -# -# Cookbook Name:: openstack-block-storage - -require_relative 'spec_helper' - -describe 'openstack-block-storage::backup' do - describe 'suse' do - let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) } - let(:node) { runner.node } - let(:chef_run) { runner.converge(described_recipe) } - - include_context 'block-storage-stubs' - - describe 'enable cinder backup service' do - before do - node.set['openstack']['block-storage']['backup']['enabled'] = true - end - it 'upgrades cinder backup package' do - expect(chef_run).to upgrade_package 'openstack-cinder-backup' - end - - it 'starts cinder backup' do - expect(chef_run).to start_service 'openstack-cinder-backup' - end - - it 'starts cinder backup on boot' do - expect(chef_run).to enable_service 'openstack-cinder-backup' - end - - it 'upgrades mysql python package' do - expect(chef_run).to upgrade_package 'python-mysql' - end - - it 'upgrades postgresql python packages if explicitly told' do - node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql' - - expect(chef_run).to upgrade_package 'python-psycopg2' - expect(chef_run).not_to upgrade_package 'python-mysql' - end - end - end -end diff --git a/spec/backup_spec.rb b/spec/backup_spec.rb index 06705a3..d8ff358 100644 --- a/spec/backup_spec.rb +++ b/spec/backup_spec.rb @@ -13,9 +13,6 @@ describe 'openstack-block-storage::backup' do include_context 'block-storage-stubs' describe 'enable cinder backup service' do - before do - node.set['openstack']['block-storage']['backup']['enabled'] = true - end it 'upgrades cinder backup package' do expect(chef_run).to upgrade_package 'cinder-backup' end @@ -43,37 +40,5 @@ describe 'openstack-block-storage::backup' do expect(chef_run).not_to upgrade_package 'python-mysqldb' end end - - describe 'disable cinder backup service' do - before do - node.set['openstack']['block-storage']['backup']['enabled'] = false - end - it 'not to upgrades cinder backup package' do - expect(chef_run).not_to upgrade_package 'cinder-backup' - end - - it 'not to starts cinder backup' do - expect(chef_run).not_to start_service 'cinder-backup' - end - - it 'not to starts cinder backup on boot' do - expect(chef_run).not_to enable_service 'cinder-backup' - end - - it 'not to subscribes to the template change' do - expect(chef_run.service('cinder-backup')).not_to subscribe_to('template[/etc/cinder/cinder.conf]') - end - - it 'not to upgrades mysql python package' do - expect(chef_run).not_to upgrade_package 'python-mysqldb' - end - - it 'not to upgrades postgresql python packages if explicitly told' do - node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql' - - expect(chef_run).not_to upgrade_package 'python-psycopg2' - expect(chef_run).not_to upgrade_package 'python-mysqldb' - end - end end end diff --git a/spec/cinder_common-suse_spec.rb b/spec/cinder_common-suse_spec.rb deleted file mode 100644 index 4164ea7..0000000 --- a/spec/cinder_common-suse_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -# encoding: UTF-8 -# -# Cookbook Name:: openstack-block-storage - -require_relative 'spec_helper' - -describe 'openstack-block-storage::cinder-common' do - describe 'suse' do - let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) } - let(:node) { runner.node } - let(:chef_run) { runner.converge(described_recipe) } - - include_context 'block-storage-stubs' - - it 'upgrades the openstack-cinder package' do - expect(chef_run).to upgrade_package 'openstack-cinder' - end - end -end diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb index 40c928f..a224659 100644 --- a/spec/cinder_common_spec.rb +++ b/spec/cinder_common_spec.rb @@ -66,60 +66,18 @@ describe 'openstack-block-storage::cinder-common' do it 'sets cafile' do expect(chef_run).not_to render_file(file.name).with_content(/^cafile = $/) end - - it 'sets insecure' do - expect(chef_run).to render_file(file.name).with_content(/^insecure = false$/) - end - - it 'sets token hash algorithms' do - expect(chef_run).to render_file(file.name).with_content(/^hash_algorithms = md5$/) - end end context 'keystone authtoken attributes' do it 'has signing_dir' do - node.set['openstack']['block-storage']['api']['auth']['cache_dir'] = 'auth_cache_dir' + node.set['openstack']['block-storage']['conf']['keystone_authtoken']['signing_dir'] = 'auth_cache_dir' expect(chef_run).to render_file(file.name).with_content(/^signing_dir = auth_cache_dir$/) end - it 'sets memcached server(s)' do - node.set['openstack']['block-storage']['api']['auth']['memcached_servers'] = 'localhost:11211' - expect(chef_run).to render_file(file.name).with_content(/^memcached_servers = localhost:11211$/) - end - - it 'sets memcache security strategy' do - node.set['openstack']['block-storage']['api']['auth']['memcache_security_strategy'] = 'MAC' - expect(chef_run).to render_file(file.name).with_content(/^memcache_security_strategy = MAC$/) - end - - it 'sets memcache secret key' do - node.set['openstack']['block-storage']['api']['auth']['memcache_secret_key'] = '0123456789ABCDEF' - expect(chef_run).to render_file(file.name).with_content(/^memcache_secret_key = 0123456789ABCDEF$/) - end - - it 'sets cafile' do - node.set['openstack']['block-storage']['api']['auth']['cafile'] = 'dir/to/path' - expect(chef_run).to render_file(file.name).with_content(%r{^cafile = dir/to/path$}) - end - - it 'sets insecure' do - node.set['openstack']['block-storage']['api']['auth']['insecure'] = true - expect(chef_run).to render_file(file.name).with_content(/^insecure = true$/) - end - - it 'sets token hash algorithms' do - node.set['openstack']['block-storage']['api']['auth']['hash_algorithms'] = 'sha2' - expect(chef_run).to render_file(file.name).with_content(/^hash_algorithms = sha2$/) - end - context 'endpoint related' do it 'has auth_uri' do - expect(chef_run).to render_file(file.name).with_content(%r{^auth_uri = http://127.0.0.1:5000/v2.0$}) - end - - it 'has identity_uri' do - expect(chef_run).to render_file(file.name).with_content(%r{^identity_uri = http://127.0.0.1:35357/$}) + expect(chef_run).to render_file(file.name).with_content(%r{^auth_url = http://127.0.0.1:5000/v2.0$}) end end @@ -129,41 +87,32 @@ describe 'openstack-block-storage::cinder-common' do expect(chef_run).not_to render_file(file.name).with_content(/^auth_version = v2.0$/) end - it 'has auth_version when auth version is not v2.0' do - node.set['openstack']['block-storage']['api']['auth']['version'] = 'v3.0' - - expect(chef_run).to render_file(file.name).with_content(/^auth_version = v3.0$/) - end - it 'has an admin tenant name' do - node.set['openstack']['block-storage']['service_tenant_name'] = 'tenant_name' + node.set['openstack']['block-storage']['conf']['keystone_authtoken']['admin_tenant_name'] = 'tenant_name' expect(chef_run).to render_file(file.name).with_content(/^admin_tenant_name = tenant_name$/) end it 'has an admin user' do - node.set['openstack']['block-storage']['service_user'] = 'username' + node.set['openstack']['block-storage']['conf']['keystone_authtoken']['admin_user'] = 'username' expect(chef_run).to render_file(file.name).with_content(/^admin_user = username$/) end it 'has an admin password' do # (fgimenez) the get_password mocking is set in spec/spec_helper.rb - expect(chef_run).to render_file(file.name).with_content(/^admin_password = cinder-pass$/) + expect(chef_run).to render_file(file.name).with_content(/^password = cinder-pass$/) end end context 'template contents' do context 'commonly named attributes' do %w(debug verbose host notification_driver - storage_availability_zone quota_volumes quota_gigabytes quota_driver - volume_name_template snapshot_name_template osapi_volume_workers - use_default_quota_class quota_snapshots no_snapshot_gb_quota - control_exchange max_gigabytes).each do |attr_key| + osapi_volume_worker control_exchange).each do |attr_key| it "has a #{attr_key} attribute" do - node.set['openstack']['block-storage'][attr_key] = "#{attr_key}_value" + node.set['openstack']['block-storage']['conf']['DEFAULT'][attr_key] = "#{attr_key}_value" - expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^#{attr_key}=#{attr_key}_value$/) + expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^#{attr_key} = #{attr_key}_value$/) end end end @@ -173,89 +122,18 @@ describe 'openstack-block-storage::cinder-common' do node.set['openstack']['block-storage']['backup']['enabled'] = true node.set['openstack']['block-storage']['backup']['driver'] = 'cinder.backup.drivers.swift' end - - it 'has default attributes' do - %w(swift_catalog_info=object-store:swift:publicURL - backup_swift_auth=per_user - backup_swift_auth_version=1 - backup_swift_container=volumebackups - backup_swift_object_size=52428800 - backup_swift_block_size=32768 - backup_swift_retry_attempts=3 - backup_swift_retry_backoff=2 - backup_swift_enable_progress_timer=True).each do |attr| - expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^#{attr}$/) - end - end - - it 'has override attributes' do - %w(url - auth - auth_version - tenant - user - key - container - object_size - block_size - retry_attempts - retry_backoff - enable_progress_timer).each do |attr| - node.set['openstack']['block-storage']['backup']['swift'][attr] = "backup_swift_#{attr}" - expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^backup_swift_#{attr}=backup_swift_#{attr}$/) - end - end - - it 'has a custom catalog_info' do - node.set['openstack']['block-storage']['backup']['swift']['catalog_info'] = 'swift_catalog_info' - expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^swift_catalog_info=swift_catalog_info$/) - end - end - - context 'rdb driver' do - # FIXME(galstrom21): this block needs to check all of the default - # rdb_* configuration options - it 'has default rbd_* options set' do - node.set['openstack']['block-storage']['volume'] = { - 'driver' => 'cinder.volume.drivers.rbd.RBDDriver' - } - expect(chef_run).to render_file(file.name).with_content(/^rbd_/) - expect(chef_run).not_to render_file(file.name).with_content(/^netapp_/) - end end it 'has a lock_path attribute' do - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_concurrency', %r{^lock_path=/var/lib/cinder/lock$}) + expect(chef_run).to render_config_file(file.name).with_section_content('oslo_concurrency', %r{^lock_path = /var/lib/cinder/tmp}) end it 'does not have unique host id by default' do - expect(chef_run).not_to render_config_file(file.name).with_section_content('DEFAULT', /^host=/) - end - - it 'has keymgr api_class attribute default set' do - expect(chef_run).to render_config_file(file.name).with_section_content('keymgr', /^api_class=cinder.keymgr.conf_key_mgr.ConfKeyManager$/) + expect(chef_run).not_to render_config_file(file.name).with_section_content('DEFAULT', /^host = /) end it 'does not have keymgr attribute fixed_key set by default' do - expect(chef_run).not_to render_file(file.name).with_content(/^fixed_key=$/) - end - - it 'allow override for keymgr attribute fixed_key' do - chef_run.node.set['openstack']['block-storage']['keymgr']['fixed_key'] = '1111111111111111111111111111111111111111111111111111111111111111' - expect(chef_run).to render_config_file(file.name)\ - .with_section_content('keymgr', /^fixed_key=1111111111111111111111111111111111111111111111111111111111111111$/) - end - - context 'netapp driver' do - # FIXME(galstrom21): this block needs to check all of the default - # netapp_* configuration options - it 'has default netapp_* options set' do - node.set['openstack']['block-storage']['volume'] = { - 'driver' => 'cinder.volume.drivers.netapp.NetAppISCSIDriver' - } - expect(chef_run).to render_file(file.name).with_content(/^netapp_/) - expect(chef_run).not_to render_file(file.name).with_content(/^rbd_/) - end + expect(chef_run).not_to render_file(file.name).with_content(/^fixed_key = $/) end context 'syslog use' do @@ -265,165 +143,64 @@ describe 'openstack-block-storage::cinder-common' do expect(chef_run).to render_file(file.name) .with_content(%r{^log_config = /etc/openstack/logging.conf$}) end - - it 'sets the log_file value when syslog is not in use' do - node.set['openstack']['block-storage']['syslog']['use'] = false - - expect(chef_run).to render_file(file.name) - .with_content(%r{^log_file = /var/log/cinder/cinder.log$}) - end end it 'has a db connection attribute' do - node.set['openstack']['endpoints']['db']['enabled_slave'] = false allow_any_instance_of(Chef::Recipe).to receive(:db_uri) .and_return('sql_connection_value') expect(chef_run).to render_config_file(file.name) - .with_section_content('database', /^connection=sql_connection_value$/) - expect(chef_run).to_not render_config_file(file.name) - .with_section_content('database', /^slave_connection=sql_connection_value$/) + .with_section_content('database', /^connection = sql_connection_value$/) end it 'has a slave db connection attribute' do - node.set['openstack']['endpoints']['db']['enabled_slave'] = true allow_any_instance_of(Chef::Recipe).to receive(:db_uri) .and_return('sql_connection_value') expect(chef_run).to render_config_file(file.name) - .with_section_content('database', /^connection=sql_connection_value$/) - expect(chef_run).to render_config_file(file.name) - .with_section_content('database', /^slave_connection=sql_connection_value$/) - end - - it 'has a db backend attribute' do - expect(chef_run).to render_config_file(file.name).with_section_content('database', /^backend=sqlalchemy$/) + .with_section_content('database', /^connection = sql_connection_value$/) end it 'has a volume_driver attribute' do - node.set['openstack']['block-storage']['volume']['driver'] = 'volume_driver_value' - expect(chef_run).to render_file(file.name).with_content(/^volume_driver=volume_driver_value$/) + node.set['openstack']['block-storage']['conf']['DEFAULT']['volume_driver'] = 'volume_driver_value' + expect(chef_run).to render_file(file.name).with_content(/^volume_driver = volume_driver_value$/) end it 'has a state_path attribute' do - node.set['openstack']['block-storage']['volume']['state_path'] = 'state_path_value' - expect(chef_run).to render_file(file.name).with_content(/^state_path=state_path_value$/) + node.set['openstack']['block-storage']['conf']['DEFAULT']['state_path'] = 'state_path_value' + expect(chef_run).to render_file(file.name).with_content(/^state_path = state_path_value$/) end context 'glance endpoint' do it 'has a glance_api_servers attribute' do - expect(chef_run).to render_file(file.name).with_content(%r{^glance_api_servers=http://127.0.0.1:9292$}) - end - - it 'has glance_api_version attribute' do - expect(chef_run).to render_file(file.name).with_content(/^glance_api_version=1$/) - end - - it 'has a glance_api_insecure attribute' do - expect(chef_run).to render_file(file.name).with_content(/^glance_api_insecure=false$/) - end - - it 'sets insecure for glance' do - node.set['openstack']['block-storage']['image']['glance_api_insecure'] = true - expect(chef_run).to render_file(file.name).with_content(/^glance_api_insecure=true$/) - end - - it 'has a glance_ca_certificates_file attribute' do - expect(chef_run).to render_file(file.name).with_content(/^glance_ca_certificates_file=$/) - end - - it 'sets glance_ca_certificates_file attribute' do - node.set['openstack']['block-storage']['image']['glance_ca_certificates_file'] = 'dir/to/path' - expect(chef_run).to render_file(file.name).with_content(%r{^glance_ca_certificates_file=dir/to/path$}) + expect(chef_run).to render_file(file.name).with_content(%r{^glance_api_servers = http://127.0.0.1:9292$}) end it 'has a glance host attribute' do - expect(chef_run).to render_file(file.name).with_content(/^glance_host=127.0.0.1$/) + expect(chef_run).to render_file(file.name).with_content(/^glance_host = 127.0.0.1$/) end it 'has a glance port attribute' do - expect(chef_run).to render_file(file.name).with_content(/^glance_port=9292$/) + expect(chef_run).to render_file(file.name).with_content(/^glance_port = 9292$/) end end - it 'has a api_rate_limit attribute' do - node.set['openstack']['block-storage']['api']['ratelimit'] = 'api_rate_limit_value' - expect(chef_run).to render_file(file.name).with_content(/^api_rate_limit=api_rate_limit_value$/) - end - context 'cinder endpoint' do it 'has osapi_volume_listen set' do - expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen=127.0.0.1$/) + expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen = 127.0.0.1$/) end it 'has osapi_volume_listen_port set' do - expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen_port=8776$/) - end - - it 'has default api version set' do - [/^enable_v1_api=False$/, - /^enable_v2_api=True$/].each do |line| - expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line) - end - end - - it 'has override api version set' do - node.set['openstack']['block-storage']['enable_v1_api'] = 'True' - node.set['openstack']['block-storage']['enable_v2_api'] = 'False' - [/^enable_v1_api=True$/, - /^enable_v2_api=False$/].each do |line| - expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line) - end + expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen_port = 8776$/) end end - - it 'has a rpc_backend attribute' do - node.set['openstack']['block_storage']['rpc_backend'] = 'rpc_backend_value' - expect(chef_run).to render_file(file.name).with_content(/^rpc_backend=rpc_backend_value$/) - end - it 'has default RPC/AMQP options set' do - [/^rpc_backend=cinder.openstack.common.rpc.impl_kombu$/, - /^rpc_thread_pool_size=64$/, - /^rpc_response_timeout=60$/].each do |line| + [/^rpc_backend = rabbit/].each do |line| expect(chef_run).to render_file(file.name).with_content(line) end end context 'rabbitmq as mq service' do - before do - node.set['openstack']['mq']['block-storage']['service_type'] = 'rabbitmq' - end - - it 'has default RPC/AMQP options set' do - [/^rpc_conn_pool_size=30$/, - /^amqp_durable_queues=false$/, - /^amqp_auto_delete=false$/, - /^heartbeat_timeout_threshold=0$/, - /^heartbeat_rate=2$/].each do |line| - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', line) - end - end - - context 'ha attributes' do - before do - node.set['openstack']['mq']['block-storage']['rabbit']['ha'] = true - end - - it 'has a rabbit_hosts attribute' do - allow_any_instance_of(Chef::Recipe).to receive(:rabbit_servers) - .and_return('rabbit_servers_value') - - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_hosts=rabbit_servers_value$/) - end - - %w(host port).each do |attr| - it "does not have rabbit_#{attr} attribute" do - expect(chef_run).not_to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_#{attr}=/) - end - end - end - context 'non ha attributes' do before do node.set['openstack']['mq']['block-storage']['rabbit']['ha'] = false @@ -431,108 +208,28 @@ describe 'openstack-block-storage::cinder-common' do %w(host port).each do |attr| it "has rabbit_#{attr} attribute" do - node.set['openstack']['mq']['block-storage']['rabbit'][attr] = "rabbit_#{attr}_value" - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_#{attr}=rabbit_#{attr}_value$/) + node.set['openstack']['block-storage']['conf']['oslo_messaging_rabbit']["rabbit_#{attr}"] = "rabbit_#{attr}_value" + expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_#{attr} = rabbit_#{attr}_value$/) end end it 'does not have a rabbit_hosts attribute' do - expect(chef_run).not_to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_hosts=/) + expect(chef_run).not_to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_hosts = /) end end it 'has rabbit_userid' do node.set['openstack']['mq']['block-storage']['rabbit']['userid'] = 'rabbit_userid_value' - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_userid=rabbit_userid_value$/) + expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_userid = rabbit_userid_value$/) end it 'has rabbit_password' do - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_password=#{test_pass}$/) + expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_password = #{test_pass}$/) end it 'has rabbit_virtual_host' do - node.set['openstack']['mq']['block-storage']['rabbit']['vhost'] = 'vhost_value' - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_virtual_host=vhost_value$/) - end - - it 'does not have ssl config set' do - [/^rabbit_use_ssl=/, - /^kombu_ssl_version=/, - /^kombu_ssl_keyfile=/, - /^kombu_ssl_certfile=/, - /^kombu_ssl_ca_certs=/, - /^kombu_reconnect_delay=/, - /^kombu_reconnect_timeout=/].each do |line| - expect(chef_run).not_to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', line) - end - end - - it 'sets ssl config' do - node.set['openstack']['mq']['block-storage']['rabbit']['use_ssl'] = true - node.set['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_version'] = 'TLSv1.2' - node.set['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_keyfile'] = 'keyfile' - node.set['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_certfile'] = 'certfile' - node.set['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_ca_certs'] = 'certsfile' - node.set['openstack']['mq']['block-storage']['rabbit']['kombu_reconnect_delay'] = 123.123 - node.set['openstack']['mq']['block-storage']['rabbit']['kombu_reconnect_timeout'] = 123 - [/^rabbit_use_ssl=true/, - /^kombu_ssl_version=TLSv1.2$/, - /^kombu_ssl_keyfile=keyfile$/, - /^kombu_ssl_certfile=certfile$/, - /^kombu_ssl_ca_certs=certsfile$/, - /^kombu_reconnect_delay=123.123$/, - /^kombu_reconnect_timeout=123$/].each do |line| - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', line) - end - end - - it 'has the default rabbit_retry_interval set' do - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_retry_interval=1$/) - end - - it 'has the default rabbit_max_retries set' do - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_max_retries=0$/) - end - end - - context 'qpid as mq service' do - before do - node.set['openstack']['mq']['block-storage']['service_type'] = 'qpid' - end - - it 'has default RPC/AMQP options set' do - [/^rpc_conn_pool_size=30$/, - /^amqp_durable_queues=false$/, - /^amqp_auto_delete=false$/].each do |line| - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', line) - end - end - - %w(port username sasl_mechanisms reconnect reconnect_timeout reconnect_limit - reconnect_interval_min reconnect_interval_max reconnect_interval heartbeat protocol - tcp_nodelay).each do |attr| - it "has qpid_#{attr} attribute" do - node.set['openstack']['mq']['block-storage']['qpid'][attr] = "qpid_#{attr}_value" - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', /^qpid_#{attr}=qpid_#{attr}_value$/) - end - end - - it 'has qpid_hostname' do - node.set['openstack']['mq']['block-storage']['qpid']['host'] = 'qpid_host_value' - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', /^qpid_hostname=qpid_host_value$/) - end - - it 'has qpid_password' do - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', /^qpid_password=#{test_pass}$/) - end - - it 'has default qpid topology version' do - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', /^qpid_topology_version=1$/) - end - - it 'has qpid notification_topics' do - node.set['openstack']['mq']['block-storage']['qpid']['notification_topic'] = 'qpid_notification_topic_value' - expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_qpid', /^notification_topics=qpid_notification_topic_value$/) + node.set['openstack']['block-storage']['conf']['oslo_messaging_rabbit']['rabbit_virtual_host'] = 'vhost_value' + expect(chef_run).to render_config_file(file.name).with_section_content('oslo_messaging_rabbit', /^rabbit_virtual_host = vhost_value$/) end end @@ -540,20 +237,13 @@ describe 'openstack-block-storage::cinder-common' do before do node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.lvm.LVMVolumeDriver' end - - %w(group clear clear_size).each do |attr| - it "has lvm volume_#{attr} attribute" do - node.set['openstack']['block-storage']['volume']["volume_#{attr}"] = "volume_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^volume_#{attr}=volume_#{attr}_value$/) - end - end end context 'commonly named volume attributes' do %w(iscsi_ip_address iscsi_port iscsi_helper volumes_dir).each do |attr| it "has volume related #{attr} attribute" do - node.set['openstack']['block-storage']['volume'][attr] = "common_volume_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^#{attr}=common_volume_#{attr}_value$/) + node.set['openstack']['block-storage']['conf']['DEFAULT'][attr] = "common_volume_#{attr}_value" + expect(chef_run).to render_file(file.name).with_content(/^#{attr} = common_volume_#{attr}_value$/) end end end @@ -562,519 +252,25 @@ describe 'openstack-block-storage::cinder-common' do before do node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.rbd.RBDDriver' end - - it 'has a rbd_pool attribute' do - node.set['openstack']['block-storage']['rbd']['cinder']['pool'] = 'cinder_value' - expect(chef_run).to render_file(file.name).with_content(/^rbd_pool=cinder_value$/) - end - it 'has a rbd_user attribute' do - node.set['openstack']['block-storage']['rbd']['user'] = 'rbd_user_value' - expect(chef_run).to render_file(file.name).with_content(/^rbd_user=rbd_user_value$/) - end - it 'has a rbd_secret_uuid attribute' do - node.set['openstack']['block-storage']['rbd']['secret_uuid'] = 'rbd_secret_uuid_value' - expect(chef_run).to render_file(file.name).with_content(/^rbd_secret_uuid=rbd_secret_uuid_value$/) - end end it 'has volume_driver attribute' do - node.set['openstack']['block-storage']['volume']['driver'] = 'volume_driver_value' - expect(chef_run).to render_file(file.name).with_content(/^volume_driver=volume_driver_value$/) + node.set['openstack']['block-storage']['conf']['DEFAULT']['volume_driver'] = 'volume_driver_value' + expect(chef_run).to render_file(file.name).with_content(/^volume_driver = volume_driver_value$/) end context 'netapp ISCSI settings' do before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.netapp.NetAppISCSIDriver' + node.set['openstack']['block-storage']['conf']['DEFAULT']['volume_driver'] = 'cinder.volume.drivers.netapp.NetAppISCSIDriver' end - - %w(login password).each do |attr| - it "has a netapp_#{attr} attribute" do - node.set['openstack']['block-storage']['netapp']["dfm_#{attr}"] = "dfm_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^netapp_#{attr}=dfm_#{attr}_value$/) - end - end - - %w(hostname port).each do |attr| - it "has a netapp_server_#{attr} attribute" do - node.set['openstack']['block-storage']['netapp']["dfm_#{attr}"] = "dfm_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^netapp_server_#{attr}=dfm_#{attr}_value$/) - end - end - - it 'has a netapp_storage_service attribute' do - node.set['openstack']['block-storage']['netapp']['storage_service'] = 'netapp_storage_service_value' - expect(chef_run).to render_file(file.name).with_content(/^netapp_storage_service=netapp_storage_service_value$/) - end - end - - context 'netapp direct7 mode nfs settings' do - let(:hostnames) { %w(hostname1 hostname2 hostname3) } - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver' - node.set['openstack']['block-storage']['netapp']['netapp_server_hostname'] = hostnames - end - - %w(mount_point_base shares_config).each do |attr_key| - it "has a nfs_#{attr_key} attribute" do - node.set['openstack']['block-storage']['nfs'][attr_key] = "netapp_nfs_#{attr_key}_value" - expect(chef_run).to render_file(file.name).with_content(/^nfs_#{attr_key}=netapp_nfs_#{attr_key}_value$/) - end - end - - it 'has netapp server_hostname attributes' do - hostnames.each do |hostname| - expect(chef_run).to render_file(file.name).with_content(/^netapp_server_hostname=#{hostname}$/) - end - end - - it 'has a netapp_server_port attribute' do - node.set['openstack']['block-storage']['netapp']['netapp_server_port'] = 'netapp_server_port_value' - expect(chef_run).to render_file(file.name).with_content(/^netapp_server_port=netapp_server_port_value$/) - end - - %w(login password).each do |attr| - it "has a netapp_#{attr} attribute" do - node.set['openstack']['block-storage']['netapp']["netapp_server_#{attr}"] = "netapp_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^netapp_#{attr}=netapp_#{attr}_value$/) - end - end - - %w(disk_util sparsed_volumes).each do |attr| - it "has a nfs_#{attr} attribute" do - node.set['openstack']['block-storage']['nfs']["nfs_#{attr}"] = "netapp_nfs_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^nfs_#{attr}=netapp_nfs_#{attr}_value$/) - end - end - end - - context 'ibmnas settings' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver' - end - - %w(mount_point_base shares_config).each do |attr| - it "has a ibmnas_#{attr} attribute" do - node.set['openstack']['block-storage']['ibmnas'][attr] = "ibmnas_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^nfs_#{attr}=ibmnas_#{attr}_value$/) - end - end - - it 'has a nfs_sparsed_volumes attribute' do - node.set['openstack']['block-storage']['ibmnas']['nfs_sparsed_volumes'] = 'ibmnas_nfs_sparsed_volumes_value' - expect(chef_run).to render_file(file.name).with_content(/^nfs_sparsed_volumes=ibmnas_nfs_sparsed_volumes_value$/) - end - - %w(nas_ip nas_login nas_ssh_port ibmnas_platform_type).each do |attr| - it "has a ibmnas #{attr} attribute" do - node.set['openstack']['block-storage']['ibmnas'][attr] = "ibmnas_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^#{attr}=ibmnas_#{attr}_value$/) - end - end - - it 'has a default attributes' do - %w(nas_ip=127.0.0.1 - nas_login=admin - nas_password=test_pass - nas_ssh_port=22 - ibmnas_platform_type=v7ku - nfs_sparsed_volumes=true - nfs_mount_point_base=/mnt/cinder-volumes - nfs_shares_config=/etc/cinder/nfs_shares.conf).each do |attr| - expect(chef_run).to render_file(file.name).with_content(/^#{attr}$/) - end - end - end - - context 'storwize settings' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.storwize_svc.StorwizeSVCDriver' - end - - it 'has a default attribute' do - %w(san_ip=127.0.0.1 - san_private_key=/v7000_rsa - storwize_svc_volpool_name=volpool - storwize_svc_vol_rsize=2 - storwize_svc_vol_warning=0 - storwize_svc_vol_autoexpand=true - storwize_svc_vol_grainsize=256 - storwize_svc_vol_compression=false - storwize_svc_vol_easytier=true - storwize_svc_vol_iogrp=0 - storwize_svc_flashcopy_timeout=120 - storwize_svc_connection_protocol=iSCSI - storwize_svc_iscsi_chap_enabled=true - storwize_svc_multihostmap_enabled=true - storwize_svc_allow_tenant_qos=false).each do |attr| - expect(chef_run).to render_file(file.name).with_content(/^#{attr}$/) - end - end - - it 'has a overridden attribute' do - %w(san_ip - san_private_key - storwize_svc_volpool_name - storwize_svc_vol_rsize - storwize_svc_vol_warning - storwize_svc_vol_autoexpand - storwize_svc_vol_grainsize - storwize_svc_vol_compression - storwize_svc_vol_easytier - storwize_svc_vol_iogrp - storwize_svc_flashcopy_timeout - storwize_svc_connection_protocol - storwize_svc_multihostmap_enabled - storwize_svc_allow_tenant_qos - storwize_svc_stretched_cluster_partner).each do |attr| - node.set['openstack']['block-storage']['storwize'][attr] = "storwize_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^#{attr}=storwize_#{attr}_value$/) - end - end - - context 'storwize with login and password' do - it 'has a login and password' do - node.set['openstack']['block-storage']['storwize']['san_private_key'] = '' - %w(san_login=admin - san_password=test_pass - san_private_key=).each do |attr| - expect(chef_run).to render_file(file.name).with_content(/^#{attr}$/) - end - end - end - - context 'storwize with iSCSI connection protocol' do - before do - node.set['openstack']['block-storage']['storwize']['storwize_svc_connection_protocol'] = 'iSCSI' - end - - it 'has a iscsi chap enabled attribute' do - node.set['openstack']['block-storage']['storwize']['storwize_svc_iscsi_chap_enabled'] = 'storwize_svc_iscsi_chap_enabled_value' - expect(chef_run).to render_file(file.name).with_content(/^storwize_svc_iscsi_chap_enabled=storwize_svc_iscsi_chap_enabled_value$/) - end - - it 'does not have a multipath enabled attribute' do - expect(chef_run).not_to render_file(file.name).with_content(/^storwize_svc_multipath_enabled=/) - end - end - - context 'storwize without iSCSI connection protocol' do - before do - node.set['openstack']['block-storage']['storwize']['storwize_svc_connection_protocol'] = 'non-iSCSI' - end - - it 'does not have a iscsi chap enabled attribute' do - expect(chef_run).not_to render_file(file.name).with_content(/^storwize_svc_iscsi_enabled=/) - end - - it 'has a multipath enabled attribute' do - node.set['openstack']['block-storage']['storwize']['storwize_svc_multipath_enabled'] = 'storwize_svc_multipath_enabled_value' - expect(chef_run).to render_file(file.name).with_content(/^storwize_svc_multipath_enabled=storwize_svc_multipath_enabled_value$/) - end - end - end - - context 'solidfire settings' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.solidfire.SolidFire' - end - - it 'has solidfire sf_emulate set' do - node.set['openstack']['block-storage']['solidfire']['sf_emulate'] = 'test' - expect(chef_run).to render_file(file.name).with_content(/^sf_emulate_512=test$/) - end - - it 'has solidfire password' do - expect(chef_run).to render_file(file.name).with_content(/^san_password=test_pass$/) - end - - %w(san_login san_ip).each do |attr| - it "has solidfire #{attr} set" do - node.set['openstack']['block-storage']['solidfire'][attr] = "solidfire_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^#{attr}=solidfire_#{attr}_value$/) - end - end - - it 'does not have iscsi_ip_prefix not specified' do - node.set['openstack']['block-storage']['solidfire']['iscsi_ip_prefix'] = nil - expect(chef_run).to_not render_file(file.name).with_content(/^iscsi_ip_prefix=/) - end - - it 'does have iscsi_ip_prefix when specified' do - chef_run.node.set['openstack']['block-storage']['solidfire']['iscsi_ip_prefix'] = '203.0.113.*' - expect(chef_run).to render_file(file.name).with_content(/^iscsi_ip_prefix=203.0.113.*$/) - end - end - - context 'flashsystem settings' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.flashsystem.FlashSystemDriver' - end - - it 'has flashsystem password' do - expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^san_password=test_pass$/) - end - - it 'has a default attribute' do - %w(san_ip=127.0.0.1 - flashsystem_connection_protocol=FC - flashsystem_multihostmap_enabled=true).each do |attr| - expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^#{attr}$/) - end - end - - it 'has a overridden attribute' do - %w(san_ip - flashsystem_connection_protocol - flashsystem_multihostmap_enabled).each do |attr| - node.set['openstack']['block-storage']['flashsystem'][attr] = "flashsystem_#{attr}_value" - expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^#{attr}=flashsystem_#{attr}_value$/) - end - end - - context 'FlashSystem with FC connection protocol' do - before do - node.set['openstack']['block-storage']['storwize']['flashsystem_connection_protocol'] = 'FC' - end - - it 'has a multipath enabled attribute' do - node.set['openstack']['block-storage']['flashsystem']['flashsystem_multipath_enabled'] = 'flashsystem_multipath_enabled_value' - expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', /^flashsystem_multipath_enabled=flashsystem_multipath_enabled_value$/) - end - end - end - - context 'emc settings' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.emc.emc_smis_iscsi.EMCSMISISCSIDriver' - end - - %w(iscsi_target_prefix cinder_emc_config_file).each do |attr| - it "has emc #{attr} set" do - node.set['openstack']['block-storage']['emc'][attr] = "emc_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^#{attr}=emc_#{attr}_value$/) - end - end - end - - context 'vmware vmdk settings' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver' - %w(vmware_host_ip vmware_host_username - vmware_api_retry_count vmware_task_poll_interval vmware_volume_folder - vmware_image_transfer_timeout_secs vmware_max_objects_retrieval).each do |attr| - node.set['openstack']['block-storage']['vmware'][attr] = "vmware_#{attr}_value" - end - end - - it 'has vmware attributes set' do - node['openstack']['block-storage']['vmware'].each do |attr, val| - expect(chef_run).to render_file(file.name).with_content(/^#{attr} = #{val}$/) - end - end - - it 'has password set which is from databag' do - expect(chef_run).to render_file(file.name).with_content(/^vmware_host_password = vmware_secret_name$/) - end - - it 'has no wsdl_location line without the attribute' do - node.set['openstack']['block-storage']['vmware']['vmware_wsdl_location'] = nil - expect(chef_run).not_to render_file(file.name).with_content(/^vmware_wsdl_location = /) - end - - it 'has wsdl_location line with attribute present' do - node.set['openstack']['block-storage']['vmware']['vmware_wsdl_location'] = 'http://127.0.0.1/wsdl' - expect(chef_run).to render_file(file.name).with_content(%r{^vmware_wsdl_location = http://127.0.0.1/wsdl$}) - end - end - - context 'gpfs settings' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.gpfs.GPFSDriver' - end - - %w(gpfs_mount_point_base gpfs_max_clone_depth - gpfs_sparse_volumes gpfs_storage_pool).each do |attr| - it "has gpfs #{attr} set" do - node.set['openstack']['block-storage']['gpfs'][attr] = "gpfs_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(/^#{attr} = gpfs_#{attr}_value$/) - end - end - - it 'has no gpfs_images_dir line without the attribute' do - node.set['openstack']['block-storage']['gpfs']['gpfs_images_dir'] = nil - expect(chef_run).not_to render_file(file.name).with_content(/^gpfs_images_dir = /) - expect(chef_run).not_to render_file(file.name).with_content(/^gpfs_images_share_mode = /) - end - - it 'has gpfs_images_dir line with attribute present' do - node.set['openstack']['block-storage']['gpfs']['gpfs_images_dir'] = 'gpfs_images_dir_value' - expect(chef_run).to render_file(file.name).with_content(/^gpfs_images_dir = gpfs_images_dir_value$/) - expect(chef_run).to render_file(file.name).with_content(/^gpfs_images_share_mode = copy_on_write$/) - end - - it 'templates misc_cinder array correctly' do - node.set['openstack']['block-storage']['misc_cinder'] = ['# Comments', 'MISC=OPTION'] - expect(chef_run).to render_file(file.name).with_content( - /^# Comments$/) - expect(chef_run).to render_file(file.name).with_content( - /^MISC=OPTION$/) - end - end - - context 'multiple backend settings' do - before do - node.set['openstack']['block-storage']['volume']['multi_backend'] = { - 'lvm' => { - 'volume_driver' => 'cinder.volume.drivers.lvm.LVMVolumeDriver', - 'volume_backend_name' => 'lvmdrv' - }, - 'rbd' => { - 'volume_driver' => 'cinder.volume.drivers.rbd.RBDDriver', - 'volume_backend_name' => 'rbddrv' - }, - 'netapp_iscsi' => { - 'volume_driver' => 'cinder.volume.drivers.netapp.NetAppISCSIDriver', - 'multi_netapp_iscsi' => 'multi-netapp' - }, - 'netapp_nfs' => { - 'volume_driver' => 'cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver', - 'volume_backend_name' => 'netappnfsdrv', - 'multi_netapp_nfs' => 'multi-netapp' - }, - 'ibmnas' => { - 'volume_driver' => 'cinder.volume.drivers.ibm.ibmnas.IBMNAS_NFSDriver', - 'multi_ibmnas' => 'multi-ibmnas' - }, - 'ibmsvc' => { - 'volume_driver' => 'cinder.volume.drivers.ibm.storwize_svc.StorwizeSVCDriver', - 'multi_ibmsvc' => 'multi-ibmsvc' - }, - 'solidfire' => { - 'volume_driver' => 'cinder.volume.drivers.solidfire.SolidFire', - 'multi_solidfire' => 'multi-solidfire' - }, - 'emciscsi' => { - 'volume_driver' => 'cinder.volume.drivers.emc.emc_smis_iscsi.EMCSMISISCSIDriver', - 'multi_emciscsi' => 'multi-emciscsi' - }, - 'vmware' => { - 'volume_driver' => 'cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver', - 'multi_vmware' => 'multi-vmware' - }, - 'gpfs' => { - 'volume_driver' => 'cinder.volume.drivers.ibm.gpfs.GPFSDriver', - 'multi_gpfs' => 'multi-gpfs' - } - } - node.set['openstack']['block-storage']['volume']['volume_group'] = 'multi-lvm-group' - node.set['openstack']['block-storage']['volume']['default_volume_type'] = 'some-type-name' - node.set['openstack']['block-storage']['rbd']['cinder']['pool'] = 'multi-rbd-pool' - node.set['openstack']['block-storage']['netapp']['dfm_login'] = 'multi-netapp-login' - node.set['openstack']['block-storage']['netapp']['netapp_server_hostname'] = ['netapp-host-1', 'netapp-host-2'] - node.set['openstack']['block-storage']['netapp']['netapp_server_port'] = 'multi-netapp-port' - node.set['openstack']['block-storage']['ibmnas']['shares_config'] = 'multi-ibmnas-share' - node.set['openstack']['block-storage']['storwize']['storwize_svc_volpool_name'] = 'multi-svc-volpool' - node.set['openstack']['block-storage']['solidfire']['sf_emulate'] = 'multi-sf-true' - node.set['openstack']['block-storage']['emc']['cinder_emc_config_file'] = 'multi-emc-conf' - node.set['openstack']['block-storage']['vmware']['vmware_host_ip'] = 'multi-vmware-ip' - node.set['openstack']['block-storage']['gpfs']['gpfs_mount_point_base'] = 'multi-gpfs-mnt' - end - - it 'enable multiple backends' do - expect(chef_run).to render_file(file.name).with_content(/^enabled_backends = lvm,rbd,netapp_iscsi,netapp_nfs,ibmnas,ibmsvc,solidfire,emciscsi,vmware,gpfs$/) - - expect(chef_run).to render_file(file.name).with_content(/^\[lvm\]$/) - expect(chef_run).to render_file(file.name).with_content(/^volume_driver = cinder\.volume\.drivers\.lvm\.LVMVolumeDriver$/) - - expect(chef_run).to render_file(file.name).with_content(/^\[rbd\]$/) - expect(chef_run).to render_file(file.name).with_content(/^volume_driver = cinder\.volume\.drivers\.rbd\.RBDDriver$/) - - expect(chef_run).to render_file(file.name).with_content(/^\[netapp_iscsi\]$/) - expect(chef_run).to render_file(file.name).with_content(/^volume_driver = cinder\.volume\.drivers\.netapp\.NetAppISCSIDriver$/) - - expect(chef_run).to render_file(file.name).with_content(/^netapp_server_hostname=netapp-host-1$/) - expect(chef_run).to render_file(file.name).with_content(/^netapp_server_hostname=netapp-host-2$/) - expect(chef_run).to render_file(file.name).with_content(/^\[netapp_nfs\]$/) - expect(chef_run).to render_file(file.name).with_content(/^volume_driver = cinder\.volume\.drivers\.netapp\.nfs\.NetAppDirect7modeNfsDriver$/) - - expect(chef_run).to render_file(file.name).with_content(/^\[ibmnas\]$/) - expect(chef_run).to render_file(file.name).with_content(/^volume_driver = cinder\.volume\.drivers\.ibm\.ibmnas\.IBMNAS_NFSDriver$/) - - expect(chef_run).to render_file(file.name).with_content(/^\[ibmsvc\]$/) - expect(chef_run).to render_file(file.name).with_content(/^volume_driver = cinder\.volume\.drivers\.ibm\.storwize_svc\.StorwizeSVCDriver$/) - - expect(chef_run).to render_file(file.name).with_content(/^\[solidfire\]$/) - expect(chef_run).to render_file(file.name).with_content(/^volume_driver = cinder\.volume\.drivers\.solidfire\.SolidFire$/) - - expect(chef_run).to render_file(file.name).with_content(/^\[emciscsi\]$/) - expect(chef_run).to render_file(file.name).with_content(/^volume_driver = cinder\.volume\.drivers\.emc\.emc_smis_iscsi\.EMCSMISISCSIDriver$/) - - expect(chef_run).to render_file(file.name).with_content(/^\[vmware\]$/) - expect(chef_run).to render_file(file.name).with_content(/^volume_driver = cinder\.volume\.drivers\.vmware\.vmdk\.VMwareVcVmdkDriver$/) - - expect(chef_run).to render_file(file.name).with_content(/^\[gpfs\]$/) - expect(chef_run).to render_file(file.name).with_content(/^volume_driver = cinder\.volume\.drivers\.ibm\.gpfs\.GPFSDriver$/) - end - - it 'set lvm option' do - expect(chef_run).to render_file(file.name).with_content(/^volume_group=multi-lvm-group$/) - end - - it 'set default_volume_type option' do - expect(chef_run).to render_file(file.name).with_content(/^default_volume_type=some-type-name$/) - end - - it 'set rbd option' do - expect(chef_run).to render_file(file.name).with_content(/^rbd_pool=multi-rbd-pool$/) - end - - it 'set netapp_iscsi option' do - expect(chef_run).to render_file(file.name).with_content(/^netapp_login=multi-netapp-login$/) - end - - it 'set netapp_nfs option' do - expect(chef_run).to render_file(file.name).with_content(/^netapp_server_port=multi-netapp-port$/) - end - - it 'set ibmnas option' do - expect(chef_run).to render_file(file.name).with_content(/^nfs_shares_config=multi-ibmnas-share$/) - end - - it 'set ibmsvc option' do - expect(chef_run).to render_file(file.name).with_content(/^storwize_svc_volpool_name=multi-svc-volpool$/) - end - - it 'set solidfire option' do - expect(chef_run).to render_file(file.name).with_content(/^sf_emulate_512=multi-sf-true$/) - end - - it 'set emciscsi option' do - expect(chef_run).to render_file(file.name).with_content(/^cinder_emc_config_file=multi-emc-conf$/) - end - - it 'set vmware option' do - expect(chef_run).to render_file(file.name).with_content(/^vmware_host_ip = multi-vmware-ip$/) - end - - it 'set gpfs option' do - expect(chef_run).to render_file(file.name).with_content(/^gpfs_mount_point_base = multi-gpfs-mnt$/) - end - end - - it 'no multiple backends configured' do - expect(chef_run).to_not render_file(file.name).with_content(/^enabled_backends = [\w\W]+$/) - end - - it 'does not set default_volume_type' do - expect(chef_run).to_not render_file(file.name).with_content(/^default_volume_type=.*$/) end end end - describe '/var/lib/cinder/lock' do - let(:dir) { chef_run.directory('/var/lib/cinder/lock') } + describe '/var/lib/cinder/tmp' do + let(:dir) { chef_run.directory('/var/lib/cinder/tmp') } - it 'should create the /var/lib/cinder/lock directory' do + it 'should create the /var/lib/cinder/tmp directory' do expect(chef_run).to create_directory(dir.name).with( user: 'cinder', group: 'cinder', @@ -1095,25 +291,21 @@ describe 'openstack-block-storage::cinder-common' do end context 'template contents' do - it 'shows the custom banner' do - node.set['openstack']['block-storage']['custom_template_banner'] = 'banner' - - expect(chef_run).to render_file(file.name) - .with_content(/^banner$/) - end - it 'sets the default attributes' do [ - %r{^filters_path=/etc/cinder/rootwrap.d,/usr/share/cinder/rootwrap$}, - %r{^exec_dirs=/sbin,/usr/sbin,/bin,/usr/bin$}, - /^use_syslog=False$/, - /^syslog_log_facility=syslog$/, - /^syslog_log_level=ERROR$/ + %r{^filters_path = /etc/cinder/rootwrap.d,/usr/share/cinder/rootwrap$}, + %r{^exec_dirs = /sbin,/usr/sbin,/bin,/usr/bin$}, + /^use_syslog = false$/, + /^syslog_log_facility = syslog$/, + /^syslog_log_level = ERROR$/ ].each do |line| expect(chef_run).to render_file(file.name).with_content(line) end end end end + it do + expect(chef_run).to run_ruby_block("delete all attributes in node['openstack']['block-storage']['conf_secrets']") + end end end diff --git a/spec/client_spec.rb b/spec/client_spec.rb index eae242a..c63acc9 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -8,9 +8,5 @@ describe 'openstack-block-storage::client' do let(:chef_run) do runner.converge(described_recipe) end - - it 'upgrades packages' do - expect(chef_run).to upgrade_package('python-cinderclient') - end end end diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb index 7f0547f..2901afd 100644 --- a/spec/identity_registration_spec.rb +++ b/spec/identity_registration_spec.rb @@ -56,86 +56,14 @@ describe 'openstack-block-storage::identity_registration' do ) end - it 'with different admin URL' do - admin_url = 'https://admin.host:123/admin_path' - general_url = 'http://general.host:456/general_path' - - # Set the general endpoint - node.set['openstack']['endpoints']['block-storage-api']['uri'] = general_url - # Set the admin endpoint override - node.set['openstack']['endpoints']['admin']['block-storage-api']['uri'] = admin_url - - expect(chef_run).to create_endpoint_openstack_identity_register( - 'Register Cinder V2 Volume Endpoint' - ).with( - auth_uri: 'http://127.0.0.1:35357/v2.0', - bootstrap_token: 'bootstrap-token', - service_name: 'cinderv2', - service_type: 'volumev2', - service_description: 'Cinder Volume Service V2', - endpoint_region: 'RegionOne', - endpoint_adminurl: admin_url, - endpoint_internalurl: general_url, - endpoint_publicurl: general_url - ) - end - - it 'with different public URL' do - public_url = 'https://public.host:789/public_path' - general_url = 'http://general.host:456/general_path' - - # Set the general endpoint - node.set['openstack']['endpoints']['block-storage-api']['uri'] = general_url - # Set the public endpoint override - node.set['openstack']['endpoints']['public']['block-storage-api']['uri'] = public_url - - expect(chef_run).to create_endpoint_openstack_identity_register( - 'Register Cinder V2 Volume Endpoint' - ).with( - auth_uri: 'http://127.0.0.1:35357/v2.0', - bootstrap_token: 'bootstrap-token', - service_name: 'cinderv2', - service_type: 'volumev2', - service_description: 'Cinder Volume Service V2', - endpoint_region: 'RegionOne', - endpoint_adminurl: general_url, - endpoint_internalurl: general_url, - endpoint_publicurl: public_url - ) - end - - it 'with different internal URL' do - internal_url = 'http://internal.host:456/internal_path' - general_url = 'http://general.host:456/general_path' - - # Set the general endpoint - node.set['openstack']['endpoints']['block-storage-api']['uri'] = general_url - # Set the internal endpoint override - node.set['openstack']['endpoints']['internal']['block-storage-api']['uri'] = internal_url - - expect(chef_run).to create_endpoint_openstack_identity_register( - 'Register Cinder V2 Volume Endpoint' - ).with( - auth_uri: 'http://127.0.0.1:35357/v2.0', - bootstrap_token: 'bootstrap-token', - service_name: 'cinderv2', - service_type: 'volumev2', - service_description: 'Cinder Volume Service V2', - endpoint_region: 'RegionOne', - endpoint_adminurl: general_url, - endpoint_internalurl: internal_url, - endpoint_publicurl: general_url - ) - end - it 'with all different URLs' do admin_url = 'https://admin.host:123/admin_path' internal_url = 'http://internal.host:456/internal_path' public_url = 'https://public.host:789/public_path' - node.set['openstack']['endpoints']['internal']['block-storage-api']['uri'] = internal_url - node.set['openstack']['endpoints']['admin']['block-storage-api']['uri'] = admin_url - node.set['openstack']['endpoints']['public']['block-storage-api']['uri'] = public_url + node.set['openstack']['endpoints']['block-storage']['internal']['uri'] = internal_url + node.set['openstack']['endpoints']['block-storage']['admin']['uri'] = admin_url + node.set['openstack']['endpoints']['block-storage']['public']['uri'] = public_url expect(chef_run).to create_endpoint_openstack_identity_register( 'Register Cinder V2 Volume Endpoint' @@ -203,5 +131,35 @@ describe 'openstack-block-storage::identity_registration' do role_name: 'service' ) end + it do + expect(chef_run).to create_service_openstack_identity_register( + 'Register Cinder V1 Volume Service' + ).with( + auth_uri: 'http://127.0.0.1:35357/v2.0', + bootstrap_token: 'bootstrap-token', + service_name: 'cinder', + service_type: 'volume', + service_description: 'Cinder Volume Service V1', + endpoint_region: 'RegionOne', + endpoint_adminurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s', + endpoint_internalurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s', + endpoint_publicurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s' + ) + end + it do + expect(chef_run).to create_endpoint_openstack_identity_register( + 'Register Cinder V1 Volume Endpoint' + ).with( + auth_uri: 'http://127.0.0.1:35357/v2.0', + bootstrap_token: 'bootstrap-token', + service_name: 'cinder', + service_type: 'volume', + service_description: 'Cinder Volume Service V1', + endpoint_region: 'RegionOne', + endpoint_adminurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s', + endpoint_internalurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s', + endpoint_publicurl: 'http://127.0.0.1:8776/v1/%(tenant_id)s' + ) + end end end diff --git a/spec/scheduler-suse_spec.rb b/spec/scheduler-suse_spec.rb deleted file mode 100644 index 791e1a1..0000000 --- a/spec/scheduler-suse_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -# encoding: UTF-8 -# -# Cookbook Name:: openstack-block-storage - -require_relative 'spec_helper' - -describe 'openstack-block-storage::scheduler' do - describe 'suse' do - let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) } - let(:node) { runner.node } - let(:chef_run) { runner.converge(described_recipe) } - - include_context 'block-storage-stubs' - - it 'upgrades cinder scheduler package' do - expect(chef_run).to upgrade_package 'openstack-cinder-scheduler' - end - - it 'starts cinder scheduler' do - expect(chef_run).to start_service 'openstack-cinder-scheduler' - end - - it 'starts cinder scheduler on boot' do - expect(chef_run).to enable_service 'openstack-cinder-scheduler' - end - - it 'does not upgrade stevedore' do - expect(chef_run).not_to upgrade_python_pip 'stevedore' - end - - it 'upgrades mysql python package' do - expect(chef_run).to upgrade_package 'python-mysql' - end - - it 'upgrades postgresql python packages if explicitly told' do - node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql' - - expect(chef_run).to upgrade_package 'python-psycopg2' - expect(chef_run).not_to upgrade_package 'python-mysql' - end - end -end diff --git a/spec/scheduler_spec.rb b/spec/scheduler_spec.rb index 6d12195..000c942 100644 --- a/spec/scheduler_spec.rb +++ b/spec/scheduler_spec.rb @@ -37,46 +37,5 @@ describe 'openstack-block-storage::scheduler' do expect(chef_run).to upgrade_package 'python-psycopg2' expect(chef_run).not_to upgrade_package 'python-mysqldb' end - - it 'does not setup cron when no metering' do - expect(chef_run.cron('cinder-volume-usage-audit')).to be_nil - end - - it 'creates cron metering default' do - allow_any_instance_of(Chef::Recipe).to receive(:search) - .with(:node, 'roles:os-block-storage-scheduler') - .and_return([OpenStruct.new(name: 'fauxhai.local')]) - node.set['openstack']['telemetry'] = true - - cron = chef_run.cron 'cinder-volume-usage-audit' - bin_str = '/usr/bin/cinder-volume-usage-audit > /var/log/cinder/audit.log' - expect(cron.command).to match(/#{bin_str}/) - crontests = [[:minute, '00'], [:hour, '*'], [:day, '*'], - [:weekday, '*'], [:month, '*'], [:user, 'cinder']] - crontests.each do |k, v| - expect(cron.send(k)).to eq v - expect(chef_run).to create_cron('cinder-volume-usage-audit') - end - expect(cron.action).to include :create - end - - it 'creates cron metering custom' do - crontests = [[:minute, '50'], [:hour, '23'], [:day, '6'], - [:weekday, '5'], [:month, '11'], [:user, 'foobar']] - allow_any_instance_of(Chef::Recipe).to receive(:search) - .with(:node, 'roles:os-block-storage-scheduler') - .and_return([OpenStruct.new(name: 'foobar')]) - node.set['openstack']['telemetry'] = true - crontests.each do |k, v| - node.set['openstack']['block-storage']['cron'][k.to_s] = v - end - node.set['openstack']['block-storage']['user'] = 'foobar' - - cron = chef_run.cron 'cinder-volume-usage-audit' - crontests.each do |k, v| - expect(cron.send(k)).to eq v - end - expect(cron.action).to include :delete - end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ba21c6c..e22dae1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -10,11 +10,6 @@ ChefSpec::Coverage.start! { add_filter 'openstack-block-storage' } require 'chef/application' LOG_LEVEL = :fatal -SUSE_OPTS = { - platform: 'suse', - version: '11.3', - log_level: LOG_LEVEL -} REDHAT_OPTS = { platform: 'redhat', version: '7.1', @@ -95,7 +90,7 @@ def expect_runs_openstack_common_logging_recipe end end -def expect_creates_cinder_conf(service, user, group, action = :restart) # rubocop:disable MethodLength +def expect_creates_cinder_conf(service, user, group, action = :restart) describe 'cinder.conf' do let(:file) { chef_run.template('/etc/cinder/cinder.conf') } diff --git a/spec/volume-redhat_spec.rb b/spec/volume-redhat_spec.rb index 9f433c3..60a8fff 100644 --- a/spec/volume-redhat_spec.rb +++ b/spec/volume-redhat_spec.rb @@ -44,159 +44,5 @@ describe 'openstack-block-storage::volume' do expect(chef_run).to enable_service('target') 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 'upgrades 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' - end - - it 'upgrades nfs packages' do - expect(chef_run).to upgrade_package('nfs-utils') - expect(chef_run).to upgrade_package('nfs-utils-lib') - end - end - - context 'EMC ISCSI Driver' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.emc.emc_smis_iscsi.EMCSMISISCSIDriver' - end - - it 'upgrades emc package' do - expect(chef_run).to upgrade_package('pywbem') - end - end - - describe 'IBM GPFS volume driver' do - before do - @chef_run = ::ChefSpec::SoloRunner.new ::REDHAT_OPTS do |n| - n.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.gpfs.GPFSDriver' - n.set['openstack']['block-storage']['gpfs']['gpfs_mount_point_base'] = 'volumes' - n.set['openstack']['block-storage']['volume']['multi_backend'] = - { - 'gpfs01' => { - 'gpfs_mount_point_base' => 'gpfs_volume01', - 'volume_driver' => 'cinder.volume.drivers.ibm.gpfs.GPFSDriver' - }, - 'gpfs02' => { - 'gpfs_mount_point_base' => 'gpfs_volume02', - 'volume_driver' => 'cinder.volume.drivers.ibm.gpfs.GPFSDriver' - } - } - end - - @conf = '/etc/cinder/cinder.conf' - @chef_run.converge 'openstack-block-storage::volume' - end - - it 'verifies gpfs_mount_point_base' do - expect(@chef_run).to render_file(@conf).with_content( - /^gpfs_mount_point_base = volumes$/) - end - - it 'verifies gpfs_images_dir and gpfs_images_share_mode is set with default value' do - @chef_run.node.set['openstack']['block-storage']['gpfs']['gpfs_images_dir'] = 'images' - expect(@chef_run).to render_file(@conf).with_content( - /^gpfs_images_dir = images$/) - expect(@chef_run).to render_file(@conf).with_content( - /^gpfs_images_share_mode = copy_on_write$/) - end - - it 'verifies gpfs_images_dir and gpfs_images_share_mode set correctly' do - @chef_run.node.set['openstack']['block-storage']['gpfs']['gpfs_images_dir'] = 'images' - @chef_run.node.set['openstack']['block-storage']['gpfs']['gpfs_images_share_mode'] = 'copy' - expect(@chef_run).to render_file(@conf).with_content( - /^gpfs_images_dir = images$/) - expect(@chef_run).to render_file(@conf).with_content( - /^gpfs_images_share_mode = copy$/) - end - - it 'verifies gpfs_sparse_volumes is default' do - expect(@chef_run).to render_file(@conf).with_content( - /^gpfs_sparse_volumes = true$/) - end - - it 'verifies gpfs_max_clone_depth is default' do - expect(@chef_run).to render_file(@conf).with_content( - /^gpfs_max_clone_depth = 8$/) - end - - it 'verifies gpfs_storage_pool is default' do - expect(@chef_run).to render_file(@conf).with_content( - /^gpfs_storage_pool = system$/) - end - - it 'verifies gpfs volume directory is created with owner and mode set correctly' do - expect(@chef_run).to create_directory('volumes').with( - owner: 'cinder', - group: 'cinder', - mode: '0755' - ) - end - - it 'verifies mount point base is created in multi backend case' do - expect(@chef_run).to create_directory('gpfs_volume01').with( - owner: 'cinder', - group: 'cinder', - mode: '0755' - ) - expect(@chef_run).to create_directory('gpfs_volume02').with( - owner: 'cinder', - group: 'cinder', - mode: '0755' - ) - end - end - - describe 'create_vg' do - let(:file) { chef_run.template('/etc/init.d/cinder-group-active') } - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.lvm.LVMVolumeDriver' - node.set['openstack']['block-storage']['volume']['create_volume_group'] = true - stub_command('vgs cinder-volumes').and_return(false) - end - - describe 'template contents' do - it 'sources /etc/rc.d/init.d/functions' do - expect(chef_run).to render_file(file.name).with_content(%r{^\s*. /etc/rc.d/init.d/functions$}) - end - - it 'calls success and echo' do - [/^\s*success$/, /^\s*echo$/].each do |cmd| - expect(chef_run).to render_file(file.name).with_content(cmd) - end - end - end - end end end diff --git a/spec/volume-suse_spec.rb b/spec/volume-suse_spec.rb deleted file mode 100644 index 6e1019a..0000000 --- a/spec/volume-suse_spec.rb +++ /dev/null @@ -1,79 +0,0 @@ -# encoding: UTF-8 -# -# Cookbook Name:: openstack-block-storage - -require_relative 'spec_helper' - -describe 'openstack-block-storage::volume' do - describe 'suse' do - let(:runner) { ChefSpec::SoloRunner.new(SUSE_OPTS) } - let(:node) { runner.node } - let(:chef_run) { runner.converge(described_recipe) } - - include_context 'block-storage-stubs' - - it 'upgrades cinder volume package' do - expect(chef_run).to upgrade_package('openstack-cinder-volume') - end - - it 'upgrades qemu img package' do - expect(chef_run).to upgrade_package('qemu-img') - end - - it 'upgrades mysql python package' do - expect(chef_run).to upgrade_package('python-mysql') - end - - it 'upgrades postgresql python packages if explicitly told' do - node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql' - - expect(chef_run).to upgrade_package('python-psycopg2') - expect(chef_run).not_to upgrade_package('python-mysql') - end - - it 'upgrades cinder iscsi package' do - expect(chef_run).to upgrade_package('tgt') - end - - it 'starts cinder volume' do - expect(chef_run).to start_service('openstack-cinder-volume') - end - - it 'starts cinder volume on boot' do - expect(chef_run).to enable_service('openstack-cinder-volume') - 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 suse include' do - expect(chef_run).to render_file(file.name).with_content('include /var/lib/cinder/volumes/*') - expect(chef_run).not_to render_file(file.name).with_content('include /etc/tgt/conf.d/*.conf') - end - end - - context 'NFS Driver' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver' - end - - it 'installs nfs packages' do - expect(chef_run).to upgrade_package('nfs-utils') - expect(chef_run).not_to upgrade_package('nfs-utils-lib') - end - end - - context 'EMC ISCSI Driver' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.emc.emc_smis_iscsi.EMCSMISISCSIDriver' - end - - it 'installs emc packages' do - expect(chef_run).to upgrade_package('python-pywbem') - end - end - end -end diff --git a/spec/volume_spec.rb b/spec/volume_spec.rb index 7cf8833..25520d3 100644 --- a/spec/volume_spec.rb +++ b/spec/volume_spec.rb @@ -50,168 +50,6 @@ describe 'openstack-block-storage::volume' do expect(chef_run).to upgrade_package 'tgt' end - it 'upgrades emc package' do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.emc.emc_smis_iscsi.EMCSMISISCSIDriver' - - 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' - end - - context 'IBMNAS shares_config file' do - it 'creates the file' do - expect(chef_run).to create_template(file.name).with( - owner: 'cinder', - group: 'cinder', - mode: '0600' - ) - end - - it 'sets the ibmnas access_ip attribute' do - node.set['openstack']['block-storage']['ibmnas']['nas_access_ip'] = '127.0.0.1' - node.set['openstack']['block-storage']['ibmnas']['export'] = '/ibm/fs/export' - expect(chef_run).to render_file(file.name).with_content('127.0.0.1:/ibm/fs/export') - end - end - - it 'upgrades nfs package' 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 - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver' - end - - it 'upgrades nfs package' 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' - end - - context 'shares config file' do - let(:shares_config_file) { 'nfs_shares_config_file' } - let(:file) { chef_run.template(shares_config_file) } - - before do - node.set['openstack']['block-storage']['nfs']['shares_config'] = shares_config_file - end - - it 'creates the file' do - node.set['openstack']['block-storage']['user'] = 'test_user' - node.set['openstack']['block-storage']['group'] = 'test_group' - - expect(chef_run).to create_template(file.name).with( - owner: 'test_user', - group: 'test_group', - mode: '0600' - ) - end - - it 'sets netapp server hostname export settings' do - netapp_server_hostname = %w(hostname1 hostname2) - node.set['openstack']['block-storage']['netapp']['netapp_server_hostname'] = netapp_server_hostname - node.set['openstack']['block-storage']['netapp']['export'] = 'netapp_export_value' - - netapp_server_hostname.each do |hostname| - expect(chef_run).to render_file(file.name).with_content(/^#{hostname}:netapp_export_value$/) - end - end - end - end - - describe 'ISCSI' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.netapp.iscsi.NetAppISCSIDriver' - end - - it 'configures netapp dfm password' do - n = chef_run.node['openstack']['block-storage']['netapp']['dfm_password'] - expect(n).to eq 'netapp-pass' - end - end - end - - context 'Ceph (RBD) Driver' do - let(:file) { chef_run.template('/etc/ceph/ceph.client.cinder.keyring') } - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.rbd.RBDDriver' - node.set['ceph']['config']['fsid'] = '00000000-0000-0000-0000-000000000000' - end - - it 'includes the ceph recipe' do - expect(chef_run).to include_recipe('ceph') - end - end - context 'Storewize Driver' do - let(:file) { chef_run.template('/etc/cinder/cinder.conf') } - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.storwize_svc.StorwizeSVCDriver' - end - - it 'download san private key if needed' do - node.set['openstack']['block-storage']['storwize']['san_private_key_url'] = 'http://server/key' - expect(chef_run).to create_remote_file('/v7000_rsa').with( - source: 'http://server/key', - user: 'cinder', - group: 'cinder', - mode: '0400' - ) - end - - it 'upgrades svc package' do - expect(chef_run).to upgrade_package 'sysfsutils' - end - - context 'ISCSI' do - before do - node.set['openstack']['block-storage']['storwize']['storwize_svc_connection_protocol'] = 'iSCSI' - end - - it 'configures storewize with iscsi' do - # Test that the FC specific options are not set when connected via iSCSI - expect(chef_run).not_to render_file(file.name).with_content('storwize_svc_multipath_enabled') - end - end - - context 'FC' do - before do - node.set['openstack']['block-storage']['storwize']['storwize_svc_connection_protocol'] = 'FC' - end - - it 'configures storewize with fc' do - # Test that the iSCSI specific options are not set when connected via FC - expect(chef_run).not_to render_file(file.name).with_content('storwize_svc_iscsi_chap_enabled') - end - end - end - - context 'FlashSystem Driver' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.ibm.flashsystem.FlashSystemDriver' - end - - it 'upgrades sysfsutils package' do - expect(chef_run).to upgrade_package 'sysfsutils' - end - end - describe 'targets.conf' do let(:file) { chef_run.template('/etc/tgt/targets.conf') } @@ -232,125 +70,5 @@ describe 'openstack-block-storage::volume' do expect(chef_run).not_to render_file(file.name).with_content('include volumes_dir_value/*') end end - - describe 'create_vg' do - let(:file) { chef_run.template('/etc/init.d/cinder-group-active') } - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.lvm.LVMVolumeDriver' - node.set['openstack']['block-storage']['volume']['create_volume_group'] = true - stub_command('vgs cinder-volumes').and_return(false) - end - - it 'upgrades lvm packages' do - expect(chef_run).to upgrade_package 'lvm2' - end - - it 'cinder vg active' do - expect(chef_run).to enable_service 'cinder-group-active' - end - - it 'create volume group' do - volume_size = chef_run.node['openstack']['block-storage']['volume']['volume_group_size'] - seek_count = volume_size.to_i * 1024 - group_name = chef_run.node['openstack']['block-storage']['volume']['volume_group'] - path = chef_run.node['openstack']['block-storage']['volume']['state_path'] - vg_file = "#{path}/#{group_name}.img" - cmd = "dd if=/dev/zero of=#{vg_file} bs=1M seek=#{seek_count} count=0; vgcreate cinder-volumes $(losetup --show -f #{vg_file})" - expect(chef_run).to run_execute(cmd) - end - - it 'notifies cinder group active start' do - expect(file).to notify('service[cinder-group-active]').to(:start) - end - - it 'creates cinder group active template file' do - expect(chef_run).to create_template(file.name) - end - - describe 'template contents' do - let(:volume_group_value) { 'volume_group_value' } - before do - node.set['openstack']['block-storage']['volume']['volume_group'] = volume_group_value - stub_command("vgs #{volume_group_value}").and_return(true) - end - - it 'calls vgs with the volume name attribute' do - expect(chef_run).to render_file(file.name).with_content(%r{vgs #{volume_group_value} > /dev/null 2>&1}) - end - - it 'calls vgcreate with the volume name and volume file attributes' do - node.set['openstack']['block-storage']['volume']['state_path'] = 'state_path_value' - volume_file = "state_path_value/#{volume_group_value}.img" - expect(chef_run).to render_file(file.name).with_content(/vgcreate #{volume_group_value} \$\(losetup --show -f #{volume_file}\)/) - end - - it 'has ubuntu settings' do - expect(chef_run).to render_file(file.name).with_content(/^\s*echo "SUCCESS"/) - expect(chef_run).not_to render_file(file.name).with_content(/^\s*success$/) - end - end - end - - describe 'create vg on block devices' do - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.lvm.LVMVolumeDriver' - node.set['openstack']['block-storage']['volume']['create_volume_group'] = true - node.set['openstack']['block-storage']['volume']['create_volume_group_type'] = 'block_devices' - node.set['openstack']['block-storage']['volume']['block_devices'] = '/dev/sdx /dev/sdx1' - stub_command('vgs cinder-volumes').and_return(false) - end - - it 'create volume group on block devices' do - cmd = 'pvcreate /dev/sdx /dev/sdx1; vgcreate cinder-volumes /dev/sdx /dev/sdx1' - expect(chef_run).to run_execute('Create Cinder volume group with block devices').with(command: cmd) - end - end - - describe 'cinder_emc_config.xml' do - let(:file) { chef_run.template('/etc/cinder/cinder_emc_config.xml') } - before do - node.set['openstack']['block-storage']['volume']['driver'] = 'cinder.volume.drivers.emc.emc_smis_iscsi.EMCSMISISCSIDriver' - end - - it 'creates cinder emc config file' do - expect(chef_run).to create_template(file.name).with( - mode: 0644 - ) - end - - describe 'template contents' do - before do - allow_any_instance_of(Chef::Recipe).to receive(:get_password) - .with('user', anything) - .and_return('emc_test_pass') - end - - %w(StorageType EcomServerPort EcomUserName).each do |attr| - it "has an emc #{attr} setting" do - node.set['openstack']['block-storage']['emc'][attr] = "emc_#{attr}_value" - expect(chef_run).to render_file(file.name).with_content(%r{^<#{attr}>emc_#{attr}_value$}) - end - end - - it 'has a EcomServerIP' do - node.set['openstack']['block-storage']['emc']['EcomServerIP'] = 'emc_EcomServerIP_value' - expect(chef_run).to render_file(file.name).with_content(%r{^emc_EcomServerIP_value$}) - end - - it 'has EcomPassword' do - node.set['openstack']['block-storage']['emc']['EcomUserName'] = 'emc_username' - expect(chef_run).to render_file(file.name).with_content(%r{^emc_test_pass$}) - end - - it 'does not have MaskingView when not specified' do - expect(chef_run).not_to render_file(file.name).with_content(/^/) - end - - it 'has MaskingView when specified' do - node.set['openstack']['block-storage']['emc']['MaskingView'] = 'testMaskingView' - expect(chef_run).to render_file(file.name).with_content(%r{^testMaskingView$}) - end - end - end end end diff --git a/templates/default/cinder.conf.erb b/templates/default/cinder.conf.erb index 7401f47..eeb2e32 100644 --- a/templates/default/cinder.conf.erb +++ b/templates/default/cinder.conf.erb @@ -1,1381 +1,12 @@ <%= node["openstack"]["block-storage"]["custom_template_banner"] %> - -[DEFAULT] - -######## defined in cinder.openstack.common.cfg:CommonConfigOpts ######## - -debug=<%= node["openstack"]["block-storage"]["debug"] %> -#### (BoolOpt) Print debugging output - -verbose=<%= node["openstack"]["block-storage"]["verbose"] %> -#### (BoolOpt) Print more verbose output - -notification_driver=<%= node["openstack"]["block-storage"]["notification_driver"] %> - -# log_config= -#### (StrOpt) If this option is specified, the logging configuration file -#### specified is used and overrides any other logging options -#### specified. Please see the Python logging module -#### documentation for details on logging configuration files. - -# log_format=%(asctime)s %(levelname)8s [%(name)s] %(message)s -#### (StrOpt) A logging.Formatter log message format string which may use -#### any of the available logging.LogRecord attributes. Default: -#### %default - -# log_date_format=%Y-%m-%d %H:%M:%S -#### (StrOpt) Format string for %(asctime)s in log records. Default: -#### %default - -# log_file= -#### (StrOpt) (Optional) Name of log file to output to. If not set, -#### logging will go to stdout. - -# log_dir= -#### (StrOpt) (Optional) The directory to keep log files in (will be -#### prepended to --logfile) - -# ================= Syslog Options ============================ - -<% if node["openstack"]["block-storage"]["syslog"]["use"] %> -log_config = /etc/openstack/logging.conf -<% else %> -log_file = /var/log/cinder/cinder.log -<% end %> - -######## defined in cinder.flags ######## - -# connection_type= -#### (StrOpt) Virtualization api connection type : libvirt, xenapi, or -#### fake - -# api_paste_config=api-paste.ini -#### (StrOpt) File name for the paste.deploy config for cinder-api - -# DEPRECATED: Deploy v1 of the Cinder API. (boolean value) -enable_v1_api=<%= node["openstack"]["block-storage"]["enable_v1_api"] %> - -# Deploy v2 of the Cinder API. (boolean value) -enable_v2_api=<%= node["openstack"]["block-storage"]["enable_v2_api"] %> - -# pybasedir=/usr/lib/python/site-packages -#### (StrOpt) Directory where the cinder python module is installed - -# bindir=$pybasedir/bin -#### (StrOpt) Directory where cinder binaries are installed - -state_path=<%= node["openstack"]["block-storage"]["volume"]["state_path"] %> -#### (StrOpt) Top-level directory for maintaining cinder's state - -my_ip=<%= node["ipaddress"] %> -#### (StrOpt) ip address of this host - -glance_host=<%= @glance_host %> -#### (StrOpt) default glance hostname or ip - -glance_port=<%= @glance_port %> -#### (IntOpt) default glance port - -glance_api_servers=<%= @glance_scheme %>://<%= @glance_host %>:<%= @glance_port %> -#### (ListOpt) A list of the glance api servers available to cinder -#### ([http|https]://[hostname|ip]:port) - -glance_api_insecure=<%= node['openstack']['block-storage']['image']['glance_api_insecure'] %> -#### (BoolOpt) Allow to perform insecure SSL (https) requests to 'glance' - -glance_ca_certificates_file=<%= node['openstack']['block-storage']['image']['glance_ca_certificates_file'] %> -#### (StrOpt) Location of ca certificates file to use for glance client requests - -# glance_num_retries=0 -#### (IntOpt) Number retries when downloading an image from glance - -glance_api_version=<%= node['openstack']['block-storage']['image']['glance_api_version'] %> -#### (IntOpt) Version of the glance API to use - -# scheduler_topic=cinder-scheduler -#### (StrOpt) the topic scheduler nodes listen on - -# volume_topic=cinder-volume -#### (StrOpt) the topic volume nodes listen on - -api_rate_limit=<%= node["openstack"]["block-storage"]["api"]["ratelimit"] %> -#### (BoolOpt) whether to rate limit the api - -# osapi_volume_ext_list= -#### (ListOpt) Specify list of extensions to load when using -#### osapi_volume_extension option with -#### cinder.api.openstack.volume.contrib.select_extensions - -# osapi_volume_extension=cinder.api.openstack.volume.contrib.standard_extensions -#### (MultiStrOpt) osapi volume extension to load - -# osapi_compute_link_prefix= -#### (StrOpt) Base URL that will be presented to users in links to the -#### OpenStack Compute API - -# osapi_max_limit=1000 -#### (IntOpt) the maximum number of items returned in a single response -#### from a collection resource - -# sqlite_db=cinder.sqlite -#### (StrOpt) the filename to use with sqlite - -# sqlite_synchronous=true -#### (BoolOpt) If passed, use synchronous mode for sqlite - -# sql_idle_timeout=3600 -#### (IntOpt) timeout before idle sql connections are reaped - -# sql_max_retries=10 -#### (IntOpt) maximum db connection retries during startup. (setting -1 -#### implies an infinite retry count) - -# sql_retry_interval=10 -#### (IntOpt) interval between retries of opening a sql connection - -# volume_manager=cinder.volume.manager.VolumeManager -#### (StrOpt) full class name for the Manager for volume - -# scheduler_manager=cinder.scheduler.manager.SchedulerManager -#### (StrOpt) full class name for the Manager for scheduler - -<% if node['openstack']['block-storage']['host'] -%> -host=<%= node['openstack']['block-storage']['host'] %> -<% end -%> -#### (StrOpt) Name of this node. This can be an opaque identifier. It is -#### not necessarily a hostname, FQDN, or IP address. - -storage_availability_zone=<%= node["openstack"]["block-storage"]["storage_availability_zone"] %> -#### (StrOpt) availability zone of this node - -# memcached_servers= -#### (ListOpt) Memcached servers or None for in process cache. - -# volume_usage_audit_period=month -#### (StrOpt) time period to generate volume usages for. Time period must -#### be hour, day, month or year - -# root_helper=cinder-rootwrap -#### (StrOpt) Deprecated: command to use for running commands as root - -rootwrap_config=/etc/cinder/rootwrap.conf -#### (StrOpt) Path to the rootwrap configuration file to use for running -#### commands as root - -# monkey_patch=false -#### (BoolOpt) Whether to log monkey patching - -# monkey_patch_modules= -#### (ListOpt) List of modules/decorators to monkey patch - -# service_down_time=60 -#### (IntOpt) maximum time since last check-in for up service - -# volume_api_class=cinder.volume.api.API -#### (StrOpt) The full class name of the volume API class to use - -auth_strategy=keystone -#### (StrOpt) The strategy to use for auth. Supports noauth, keystone, and -#### deprecated. - -######## defined in cinder.policy ######## - -# policy_file=policy.json -#### (StrOpt) JSON file representing policy - -# policy_default_rule=default -#### (StrOpt) Rule checked when requested rule is not found - - -######## defined in cinder.quota ######## - -quota_volumes=<%= node["openstack"]["block-storage"]["quota_volumes"] %> -#### (IntOpt) number of volumes allowed per project - -quota_gigabytes=<%= node["openstack"]["block-storage"]["quota_gigabytes"] %> -#### (IntOpt) number of volume gigabytes allowed per project - -# reservation_expire=86400 -#### (IntOpt) number of seconds until a reservation expires - -# until_refresh=0 -#### (IntOpt) count of reservations until usage is refreshed - -# max_age=0 -#### (IntOpt) number of seconds between subsequent usage refreshes - -quota_driver=<%= node["openstack"]["block-storage"]["quota_driver"] %> -#### (StrOpt) default driver to use for quota checks - -# Number of volume snapshots allowed per project (integer -# value) -quota_snapshots=<%= node["openstack"]["block-storage"]["quota_snapshots"] %> - -# Whether snapshots count against GigaByte quota (boolean -# value) -no_snapshot_gb_quota=<%= node["openstack"]["block-storage"]["no_snapshot_gb_quota"] %> - -# Enables or disables use of default quota class with default -# quota. (boolean value) -use_default_quota_class=<%= node["openstack"]["block-storage"]["use_default_quota_class"] %> - -######## defined in cinder.service ######## - -# report_interval=10 -#### (IntOpt) seconds between nodes reporting state to datastore - -# periodic_interval=60 -#### (IntOpt) seconds between running periodic tasks - -# periodic_fuzzy_delay=60 -#### (IntOpt) range of seconds to randomly delay when starting the -#### periodic task scheduler to reduce stampeding. (Disable by -#### setting to 0) - -osapi_volume_listen=<%= @volume_api_bind_address %> -#### (StrOpt) IP address for OpenStack Volume API to listen - -#### (IntOpt) port for os volume api to listen -osapi_volume_listen_port=<%= @volume_api_bind_port %> - -# Number of workers for OpenStack Volume API service. The -# default is equal to the number of CPUs available. (integer -# value) -osapi_volume_workers=<%= node["openstack"]["block-storage"]["osapi_volume_workers"] %> - -######## defined in cinder.test ######## - -# sqlite_clean_db=clean.sqlite -#### (StrOpt) File name of clean sqlite db - -# fake_tests=true -#### (BoolOpt) should we use everything for testing - - -######## defined in cinder.api.auth ######## - -# use_forwarded_for=false -#### (BoolOpt) Treat X-Forwarded-For as the canonical remote address. Only -#### enable this if you have a sanitizing proxy. - - -######## defined in cinder.api.sizelimit ######## - -# osapi_max_request_body_size=114688 -#### (IntOpt) Max size for body of a request - - -######## defined in cinder.common.deprecated ######## - -# fatal_deprecations=false -#### (BoolOpt) make deprecations fatal - - -######## defined in cinder.backup.manager ######## -<% if node['openstack']['block-storage']['backup']['enabled'] %> -backup_driver=<%= node['openstack']['block-storage']['backup']['driver'] %> -<% if node['openstack']['block-storage']['backup']['driver'] == 'cinder.backup.drivers.swift' %> -######## defined in cinder.backup.driver.swift ######## -# The URL of the Swift endpoint (string value) -<% if node['openstack']['block-storage']['backup']['swift']['url'] %> -backup_swift_url=<%= node['openstack']['block-storage']['backup']['swift']['url'] %> -<% else %> -# backup_swift_url= -<% end %> - -# Info to match when looking for swift in the service catalog. -# Format is: separated values of the form: -# :: - Only used if -# backup_swift_url is unset (string value) -swift_catalog_info=<%= node['openstack']['block-storage']['backup']['swift']['catalog_info'] %> - -# Swift authentication mechanism (string value) -backup_swift_auth=<%= node['openstack']['block-storage']['backup']['swift']['auth'] %> - -# Swift authentication version. Specify "1" for auth 1.0, or -# "2" for auth 2.0 (string value) -backup_swift_auth_version=<%= node['openstack']['block-storage']['backup']['swift']['auth_version'] %> - -# Swift tenant/account name. Required when connecting to an -# auth 2.0 system (string value) -<% if node['openstack']['block-storage']['backup']['swift']['tenant'] %> -backup_swift_tenant=<%= node['openstack']['block-storage']['backup']['swift']['tenant'] %> -<% else %> -# backup_swift_tenant= -<% end %> - -# Swift user name (string value) -<% if node['openstack']['block-storage']['backup']['swift']['user'] %> -backup_swift_user=<%= node['openstack']['block-storage']['backup']['swift']['user'] %> -<% else %> -# backup_swift_user= -<% end %> - -# Swift key for authentication (string value) -<% if node['openstack']['block-storage']['backup']['swift']['key'] %> -backup_swift_key=<%= node['openstack']['block-storage']['backup']['swift']['key'] %> -<% else %> -# backup_swift_key= -<% end %> - -# The default Swift container to use (string value) -backup_swift_container=<%= node['openstack']['block-storage']['backup']['swift']['container'] %> - -# The size in bytes of Swift backup objects (integer value) -backup_swift_object_size=<%= node['openstack']['block-storage']['backup']['swift']['object_size'] %> - -# The size in bytes that changes are tracked for incremental -# backups. backup_swift_object_size has to be multiple of -# backup_swift_block_size. (integer value) -backup_swift_block_size=<%= node['openstack']['block-storage']['backup']['swift']['block_size'] %> - -# The number of retries to make for Swift operations (integer -# value) -backup_swift_retry_attempts=<%= node['openstack']['block-storage']['backup']['swift']['retry_attempts'] %> - -# The backoff time in seconds between Swift retries (integer -# value) -backup_swift_retry_backoff=<%= node['openstack']['block-storage']['backup']['swift']['retry_backoff'] %> - -# Enable or Disable the timer to send the periodic progress -# notifications to Ceilometer when backing up the volume to -# the Swift backend storage. The default value is True to -# enable the timer. (boolean value) -backup_swift_enable_progress_timer=<%= node['openstack']['block-storage']['backup']['swift']['enable_progress_timer'] %> - -<% end %> -<% end %> - -######## defined in cinder.db.api ######## - -# enable_new_services=true -#### (BoolOpt) Services to be added to the available pool on create - -volume_name_template=<%= node["openstack"]["block-storage"]["volume_name_template"] %> -#### (StrOpt) Template string to be used to generate volume names - -snapshot_name_template=<%= node["openstack"]["block-storage"]["snapshot_name_template"] %> -#### (StrOpt) Template string to be used to generate snapshot names - - -######## defined in cinder.db.base ######## - -# db_driver=cinder.db -#### (StrOpt) driver to use for database access - - -######## defined in cinder.openstack.common.log ######## - -# logdir= -### (StrOpt) Log output to a per-service log file in named directory - -# logfile= -#### (StrOpt) Log output to a named file - -# use_stderr=true -#### (BoolOpt) Log output to standard error - -# logfile_mode=0644 -#### (StrOpt) Default file mode used when creating log files - -# logging_context_format_string=%(asctime)s %(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s] %(instance)s%(message)s -#### (StrOpt) format string to use for log messages with context - -# logging_default_format_string=%(asctime)s %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s -#### (StrOpt) format string to use for log messages without context - -# logging_debug_format_suffix=%(funcName)s %(pathname)s:%(lineno)d -#### (StrOpt) data to append to log format when level is DEBUG - -# logging_exception_prefix=%(asctime)s %(process)d TRACE %(name)s %(instance)s -#### (StrOpt) prefix each line of exception output with this format - -# default_log_levels=amqplib=WARN,sqlalchemy=WARN,boto=WARN,suds=INFO,keystone=INFO,eventlet.wsgi.server=WARN -#### (ListOpt) list of logger=LEVEL pairs - -# publish_errors=false -#### (BoolOpt) publish error events - -# instance_format="[instance: %(uuid)s] " -#### (StrOpt) If an instance is passed with the log message, format it -#### like this - -# instance_uuid_format="[instance: %(uuid)s] " -#### (StrOpt) If an instance UUID is passed with the log message, format -#### it like this - - -######## defined in cinder.openstack.common.notifier.api ######## - -#### (MultiStrOpt) Driver or drivers to handle sending notifications - -# default_notification_level=INFO -#### (StrOpt) Default notification level for outgoing notifications - -# default_publisher_id=$host -#### (StrOpt) Default publisher_id for outgoing notifications - -######## defined in cinder.openstack.common.rpc ######## - -rpc_backend=<%= node["openstack"]["block_storage"]["rpc_backend"] %> -#### (StrOpt) The messaging module to use, defaults to kombu. - -control_exchange=<%=node['openstack']['block-storage']['control_exchange']%> -#### (StrOpt) AMQP exchange to connect to if using RabbitMQ or Qpid - -rpc_thread_pool_size=<%= node["openstack"]["block-storage"]["rpc_thread_pool_size"] %> -#### (IntOpt) Size of RPC thread pool - -rpc_response_timeout=<%= node["openstack"]["block-storage"]["rpc_response_timeout"] %> -#### (IntOpt) Seconds to wait for a response from call or multicall - -# rpc_cast_timeout=30 -#### (IntOpt) Seconds to wait before a cast expires (TTL). Only supported -#### by impl_zmq. - -# allowed_rpc_exception_modules=cinder.openstack.common.exception,nova.exception,cinder.exception -#### (ListOpt) Modules of exceptions that are permitted to be recreatedupon -#### receiving exception data from an rpc call. - - -######## defined in cinder.openstack.common.rpc.impl_zmq ######## - -# rpc_zmq_bind_address=* -#### (StrOpt) ZeroMQ bind address. Should be a wildcard (*), an ethernet -#### interface, or IP. The "host" option should point or resolve -#### to this address. - -# rpc_zmq_matchmaker=cinder.openstack.common.rpc.matchmaker.MatchMakerLocalhost -#### (StrOpt) MatchMaker driver - -# rpc_zmq_port=9501 -#### (IntOpt) ZeroMQ receiver listening port - -# rpc_zmq_port_pub=9502 -#### (IntOpt) ZeroMQ fanout publisher port - -# rpc_zmq_contexts=1 -#### (IntOpt) Number of ZeroMQ contexts, defaults to 1 - -# rpc_zmq_ipc_dir=/var/run/openstack -#### (StrOpt) Directory for holding IPC sockets - -# rpc_zmq_host=cinder -#### (StrOpt) Name of this node. Must be a valid hostname, FQDN, or IP -#### address. Must match "host" option, if running Nova. - - -######## defined in cinder.openstack.common.rpc.matchmaker ######## - -# matchmaker_ringfile=/etc/nova/matchmaker_ring.json -#### (StrOpt) Matchmaker ring file (JSON) - - -######## defined in cinder.scheduler.driver ######## - -# scheduler_host_manager=cinder.scheduler.host_manager.HostManager -#### (StrOpt) The scheduler host manager class to use - - -######## defined in cinder.scheduler.manager ######## - -# scheduler_driver=cinder.scheduler.simple.SimpleScheduler -#### (StrOpt) Default driver to use for the scheduler - - -######## defined in cinder.scheduler.simple ######## - -max_gigabytes=<%= node["openstack"]["block-storage"]["max_gigabytes"] %> -#### (IntOpt) maximum number of volume gigabytes to allow per host - - -######## defined in cinder.volume.api ######## - -# snapshot_same_host=true -#### (BoolOpt) Create volume from snapshot at the host where snapshot -#### resides - - -######## defined in cinder.volume.driver ######## -<% if @enabled_drivers.include?("cinder.volume.drivers.lvm.LVMVolumeDriver") %> -volume_group=<%= node["openstack"]["block-storage"]["volume"]["volume_group"] %> -#### (StrOpt) Name for the VG that will contain exported volumes -volume_clear=<%= node["openstack"]["block-storage"]["volume"]["volume_clear"] %> -volume_clear_size=<%= node["openstack"]["block-storage"]["volume"]["volume_clear_size"] %> - -<% end %> -# num_shell_tries=3 -#### (IntOpt) number of times to attempt to run flakey shell commands - -# num_iscsi_scan_tries=3 -#### (IntOpt) number of times to rescan iSCSI target to find volume - -# iscsi_num_targets=100 -#### (IntOpt) Number of iscsi target ids per host - -# iscsi_target_prefix=iqn.2010-10.org.openstack: -#### (StrOpt) prefix for iscsi volumes - -iscsi_ip_address=<%= node["openstack"]["block-storage"]["volume"]["iscsi_ip_address"] %> -#### (StrOpt) The IP address where the iSCSI daemon is listening on - -iscsi_port=<%= node["openstack"]["block-storage"]["volume"]["iscsi_port"] %> -#### (IntOpt) The port that the iSCSI daemon is listening on - -<% if @enabled_drivers.include?("cinder.volume.drivers.rbd.RBDDriver") %> - -# -# Options defined in cinder.volume.drivers.rbd -# - -# The RADOS pool where rbd volumes are stored (string value) -rbd_pool=<%= node["openstack"]["block-storage"]["rbd"]["cinder"]["pool"] %> - -# The RADOS client name for accessing rbd volumes - only set -# when using cephx authentication (string value) -rbd_user=<%= node["openstack"]["block-storage"]["rbd"]["user"] %> - -# Path to the ceph configuration file (string value) -rbd_ceph_conf=<%= node["openstack"]["block-storage"]["rbd"]["conf_dir"] %> - -# Flatten volumes created from snapshots to remove dependency -# from volume to snapshot (boolean value) -rbd_flatten_volume_from_snapshot=<%= node["openstack"]["block-storage"]["rbd"]["flatten_volume"] %> - -# The libvirt uuid of the secret for the rbd_user volumes -# (string value) -rbd_secret_uuid=<%= node["openstack"]["block-storage"]["rbd"]["secret_uuid"] %> - -# Maximum number of nested volume clones that are taken before -# a flatten occurs. Set to 0 to disable cloning. (integer -# value) -rbd_max_clone_depth=<%= node["openstack"]["block-storage"]["rbd"]["max_clone_depth"] %> - -# Volumes will be chunked into objects of this size (in -# megabytes). (integer value) -rbd_store_chunk_size=<%= node["openstack"]["block-storage"]["rbd"]["chunk_size"] %> - -# Timeout value (in seconds) used when connecting to ceph -# cluster. If value < 0, no timeout is set and default -# librados value is used. (integer value) -rados_connect_timeout=<%= node["openstack"]["block-storage"]["rbd"]["rados_timeout"] %> - -<% end %> -# volume_tmp_dir= -#### (StrOpt) where to store temporary image files if the volume driver -#### does not write them directly to the volume - - -######## defined in cinder.volume.iscsi ######## - -iscsi_helper=<%= node["openstack"]["block-storage"]["volume"]["iscsi_helper"] %> -#### (StrOpt) iscsi target user-land tool to use - -volumes_dir=<%= node['openstack']['block-storage']['volume']['volumes_dir'] %> -#### (StrOpt) Volume configuration file storage directory - - -######## defined in cinder.volume.manager ######## - -volume_driver=<%= node["openstack"]["block-storage"]["volume"]["driver"] %> -#### (StrOpt) Driver to use for volume creation - -# use_local_volumes=true -#### (BoolOpt) if True, will not discover local volumes - -# volume_force_update_capabilities=false -#### (BoolOpt) if True will force update capabilities on each check - -<% if node["openstack"]["block-storage"]["volume"]["default_volume_type"] %> -# Default volume type to use (string value) -default_volume_type=<%= node["openstack"]["block-storage"]["volume"]["default_volume_type"] %> -<% end %> - -######## defined in cinder.volume.netapp ######## - -<% if @enabled_drivers.include?("cinder.volume.drivers.netapp.NetAppISCSIDriver") %> -netapp_wsdl_url=<%= node["openstack"]["block-storage"]["netapp"]["protocol"] %>://<%= node["openstack"]["block-storage"]["netapp"]["dfm_hostname"] %>:<%= node["openstack"]["block-storage"]["netapp"]["dfm_web_port"] %>/dfm.wsdl -#### (StrOpt) URL of the WSDL file for the DFM server - -netapp_login=<%= node["openstack"]["block-storage"]["netapp"]["dfm_login"] %> -#### (StrOpt) User name for the DFM server - -netapp_password=<%= node["openstack"]["block-storage"]["netapp"]["dfm_password"] %> -#### (StrOpt) Password for the DFM server - -netapp_server_hostname=<%= node["openstack"]["block-storage"]["netapp"]["dfm_hostname"] %> -#### (StrOpt) Hostname for the DFM server - -netapp_server_port=<%= node["openstack"]["block-storage"]["netapp"]["dfm_port"] %> -#### (IntOpt) Port number for the DFM server - -netapp_storage_service=<%= node["openstack"]["block-storage"]["netapp"]["storage_service"] %> -#### (StrOpt) Storage service to use for provisioning (when -#### volume_type=None) - -# netapp_storage_service_prefix= -#### (StrOpt) Prefix of storage service name to use for provisioning -#### (volume_type name will be appended) - -# netapp_vfiler= -#### (StrOpt) Vfiler to use for provisioning -<% end %> - -######## defined in cinder.volume.netapp_nfs ######## -<% if @enabled_drivers.include?("cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver") %> - -nfs_mount_point_base=<%= node["openstack"]["block-storage"]["nfs"]["mount_point_base"] %> -<% node["openstack"]["block-storage"]["netapp"]["netapp_server_hostname"].each do |h| %> -netapp_server_hostname=<%= h %> -<% end %> -netapp_server_port=<%= node["openstack"]["block-storage"]["netapp"]["netapp_server_port"] %> -netapp_login=<%= node["openstack"]["block-storage"]["netapp"]["netapp_server_login"] %> -netapp_password=<%= node["openstack"]["block-storage"]["netapp"]["netapp_server_password"] %> -nfs_shares_config=<%= node["openstack"]["block-storage"]["nfs"]["shares_config"] %> -nfs_disk_util=<%= node["openstack"]["block-storage"]["nfs"]["nfs_disk_util"] %> -nfs_sparsed_volumes=<%= node["openstack"]["block-storage"]["nfs"]["nfs_sparsed_volumes"] %> - -<% end %> - -######## defined in cinder.volume.nexenta.volume ######## - -# nexenta_host= -#### (StrOpt) IP address of Nexenta SA - -# nexenta_rest_port=2000 -#### (IntOpt) HTTP port to connect to Nexenta REST API server - -# nexenta_rest_protocol=auto -#### (StrOpt) Use http or https for REST connection (default auto) - -# nexenta_user=admin -#### (StrOpt) User name to connect to Nexenta SA - -# nexenta_password=nexenta -#### (StrOpt) Password to connect to Nexenta SA - -# nexenta_iscsi_target_portal_port=3260 -#### (IntOpt) Nexenta target portal port - -# nexenta_volume=cinder -#### (StrOpt) pool on SA that will hold all volumes - -# nexenta_target_prefix=iqn.1986-03.com.sun:02:cinder- -#### (StrOpt) IQN prefix for iSCSI targets - -# nexenta_target_group_prefix=cinder/ -#### (StrOpt) prefix for iSCSI target groups on SA - -# nexenta_blocksize= -#### (StrOpt) block size for volumes (blank=default,8KB) - -# nexenta_sparse=false -#### (BoolOpt) flag to create sparse volumes - - -######## defined in cinder.volume.nfs ######## - -<% if @enabled_drivers.include?("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= -#### (StrOpt) File with the list of available nfs shares - -# nfs_mount_point_base=$state_path/mnt -#### (StrOpt) Base dir where nfs expected to be mounted - -# nfs_disk_util=df -#### (StrOpt) Use du or df for free space calculation - -# nfs_sparsed_volumes=true -#### (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 ######## - -<% if @enabled_drivers.include?("cinder.volume.drivers.ibm.storwize_svc.StorwizeSVCDriver") %> -san_ip=<%= node["openstack"]["block-storage"]["storwize"]["san_ip"] %> -#### (StrOpt) IP address of SAN controller - -<% if node['openstack']['block-storage']['storwize']['san_private_key'].to_s.empty? %> -san_login=<%= node["openstack"]["block-storage"]["storwize"]["san_login"] %> -#### (StrOpt) Username for SAN controller - -san_password=<%= @storwize_pass %> -#### (StrOpt) Password for SAN controller -<% end %> - -san_private_key=<%= node["openstack"]["block-storage"]["storwize"]["san_private_key"] %> -#### (StrOpt) Filename of private key to use for SSH authentication -<% end %> - -<% if @enabled_drivers.include?("cinder.volume.drivers.solidfire.SolidFire") %> -######## defined in cinder.volume.solidfire ######## -sf_emulate_512=<%= node["openstack"]["block-storage"]["solidfire"]["sf_emulate"] %> -#### (BoolOpt) Set 512 byte emulation on volume creation; - -san_ip=<%= node["openstack"]["block-storage"]["solidfire"]["san_ip"] %> -# #### (StrOpt) IP address of SolidFire MVIP - -san_login=<%= node["openstack"]["block-storage"]["solidfire"]["san_login"] %> -#### (StrOpt) Username for SF Cluster Admin - -san_password=<%= @solidfire_pass %> -#### (StrOpt) Password for SF Cluster Admin - -<% unless node["openstack"]["block-storage"]["solidfire"]['iscsi_ip_prefix'].nil? %> -iscsi_ip_prefix=<%= node["openstack"]["block-storage"]["solidfire"]["iscsi_ip_prefix"] %> -<% end %> -<% end %> - -<% if @enabled_drivers.include?("cinder.volume.drivers.ibm.flashsystem.FlashSystemDriver") -%> -######## defined in cinder.volume.drivers.ibm.flashsystem.FlashSystemDriver ######## - -san_ip=<%= node["openstack"]["block-storage"]["flashsystem"]["san_ip"] %> -#### (StrOpt) IP address of FlashSystem Cluster Node - -san_login=<%= node["openstack"]["block-storage"]["flashsystem"]["san_login"] %> -#### (StrOpt) Username for FlashSystem Cluster Admin - -san_password=<%= @flashsystem_pass %> -#### (StrOpt) Password for FlashSystem Cluster Admin - -flashsystem_connection_protocol=<%= node["openstack"]["block-storage"]["flashsystem"]["flashsystem_connection_protocol"] %> -#### (StrOpt) Connection protocol (FC only) - -flashsystem_multipath_enabled=<%= node["openstack"]["block-storage"]["flashsystem"]["flashsystem_multipath_enabled"] %> -#### (BoolOpt) Multipath flag (FC only) - -flashsystem_multihostmap_enabled=<%= node["openstack"]["block-storage"]["flashsystem"]["flashsystem_multihostmap_enabled"] %> -#### (BoolOpt) Multi host mapping flag -<% end -%> - -#### (BoolOpt) Allow tenants to specify QOS on create -<% if @enabled_drivers.include?("cinder.volume.drivers.ibm.storwize_svc.StorwizeSVCDriver") %> -######## defined in cinder.volume.storwize_svc ######## - -storwize_svc_volpool_name=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_volpool_name"] %> -#### (StrOpt) Storage system storage pool for volumes - -storwize_svc_vol_rsize=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_vol_rsize"] %> -#### (StrOpt) Storage system space-efficiency parameter for volumes - -storwize_svc_vol_warning=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_vol_warning"] %> -#### (StrOpt) Storage system threshold for volume capacity warnings - -storwize_svc_vol_autoexpand=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_vol_autoexpand"] %> -#### (BoolOpt) Storage system autoexpand parameter for volumes (True/False) - -storwize_svc_vol_grainsize=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_vol_grainsize"] %> -#### (StrOpt) Storage system grain size parameter for volumes -#### (32/64/128/256) - -storwize_svc_vol_compression=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_vol_compression"] %> -#### (BoolOpt) Storage system compression option for volumes - -storwize_svc_vol_easytier=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_vol_easytier"] %> -#### (BoolOpt) Enable Easy Tier for volumes - -# The I/O group in which to allocate volumes (integer value) -storwize_svc_vol_iogrp=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_vol_iogrp"] %> - -storwize_svc_flashcopy_timeout=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_flashcopy_timeout"] %> -#### (StrOpt) Maximum number of seconds to wait for FlashCopy to be -#### prepared. Maximum value is 600 seconds (10 minutes). - -# Connection protocol (iSCSI/FC) (string value) -storwize_svc_connection_protocol=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_connection_protocol"] %> - -<% if node["openstack"]["block-storage"]["storwize"]["storwize_svc_connection_protocol"] == "iSCSI" %> -# Configure CHAP authentication for iSCSI connections -# (Default: Enabled) (boolean value) -storwize_svc_iscsi_chap_enabled=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_iscsi_chap_enabled"] %> - -<% else %> - -# Connect with multipath (FC only; iSCSI multipath is -# controlled by Nova) (boolean value) -storwize_svc_multipath_enabled=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_multipath_enabled"] %> - -<% end %> -# Allows vdisk to multi host mapping (boolean value) -storwize_svc_multihostmap_enabled=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_multihostmap_enabled"] %> - -# Allow tenants to specify QOS on create (boolean value) -storwize_svc_allow_tenant_qos=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_allow_tenant_qos"] %> - -<% unless node["openstack"]["block-storage"]["storwize"]["storwize_svc_stretched_cluster_partner"].nil? %> -# If operating in stretched cluster mode, specify the name of -# # the pool in which mirrored copies are stored. -# (Default: Null) (string value) -storwize_svc_stretched_cluster_partner=<%= node["openstack"]["block-storage"]["storwize"]["storwize_svc_stretched_cluster_partner"] %> - -<% end %> -<% end %> - -<% if @enabled_drivers.include?("cinder.volume.drivers.emc.emc_smis_iscsi.EMCSMISISCSIDriver") %> - -iscsi_target_prefix=<%= node["openstack"]["block-storage"]["emc"]["iscsi_target_prefix"] %> -cinder_emc_config_file=<%= node["openstack"]["block-storage"]["emc"]["cinder_emc_config_file"] %> - -<% end %> - -<% if @enabled_drivers.include?("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 - -ibmnas_platform_type=<%= node["openstack"]["block-storage"]["ibmnas"]["ibmnas_platform_type"] %> -#### (StrOpt) IBMNAS platform type to be used as backend storage - -<% end %> - -######## defined in cinder.volume.xiv ######## - -# xiv_proxy=xiv_openstack.nova_proxy.XIVNovaProxy -#### (StrOpt) Proxy driver - - -######## defined in cinder.volume.zadara ######## - -# zadara_vpsa_ip= -#### (StrOpt) Management IP of Zadara VPSA - -# zadara_vpsa_port= -#### (StrOpt) Zadara VPSA port number - -# zadara_vpsa_use_ssl=false -#### (BoolOpt) Use SSL connection - -# zadara_user= -#### (StrOpt) User name for the VPSA - -# zadara_password= -#### (StrOpt) Password for the VPSA - -# zadara_vpsa_poolname= -#### (StrOpt) Name of VPSA storage pool for volumes - -# zadara_default_cache_policy=write-through -#### (StrOpt) Default cache policy for volumes - -# zadara_default_encryption=NO -#### (StrOpt) Default encryption policy for volumes - -# zadara_default_striping_mode=simple -#### (StrOpt) Default striping mode for volumes - -# zadara_default_stripesize=64 -#### (StrOpt) Default stripe size for volumes - -# zadara_vol_name_template=OS_%s -#### (StrOpt) Default template for VPSA volume names - -# zadara_vpsa_auto_detach_on_delete=true -#### (BoolOpt) Automatically detach from servers on volume delete - -# zadara_vpsa_allow_nonexistent_delete=true -#### (BoolOpt) Don't halt on deletion of non-existing volumes - -<% if @enabled_drivers.include?('cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver') %> -# -# Options defined in cinder.volume.drivers.vmware.vmdk -# - -# IP address for connecting to VMware ESX/VC server. (string -# value) -vmware_host_ip = <%= node['openstack']['block-storage']['vmware']['vmware_host_ip'] %> - -# Username for authenticating with VMware ESX/VC server. -# (string value) -vmware_host_username = <%= node['openstack']['block-storage']['vmware']['vmware_host_username'] %> - -# Password for authenticating with VMware ESX/VC server. -# (string value) -vmware_host_password = <%= @vmware_host_pass %> - -<% if node['openstack']['block-storage']['vmware']['vmware_wsdl_location'] -%> -# Optional VIM service WSDL Location e.g -# http:///vimService.wsdl. Optional over-ride to -# default location for bug work-arounds. (string value) -vmware_wsdl_location = <%= node['openstack']['block-storage']['vmware']['vmware_wsdl_location'] %> -<% end %> - -# Number of times VMware ESX/VC server API must be retried -# upon connection related issues. (integer value) -vmware_api_retry_count = <%= node['openstack']['block-storage']['vmware']['vmware_api_retry_count'] %> - -# The interval (in seconds) for polling remote tasks invoked -# on VMware ESX/VC server. (integer value) -vmware_task_poll_interval = <%= node['openstack']['block-storage']['vmware']['vmware_task_poll_interval'] %> - -# Name for the folder in the VC datacenter that will contain -# cinder volumes. (string value) -vmware_volume_folder = <%= node['openstack']['block-storage']['vmware']['vmware_volume_folder'] %> - -# Timeout in seconds for VMDK volume transfer between Cinder -# and Glance. (integer value) -vmware_image_transfer_timeout_secs = <%= node['openstack']['block-storage']['vmware']['vmware_image_transfer_timeout_secs'] %> - -# Max number of objects to be retrieved per batch. Query -# results will be obtained in batches from the server and not -# in one shot. Server may still limit the count to something -# less than the configured value. (integer value) -vmware_max_objects_retrieval = <%= node['openstack']['block-storage']['vmware']['vmware_max_objects_retrieval'] %> -<% end %> - -<% if @enabled_drivers.include?('cinder.volume.drivers.ibm.gpfs.GPFSDriver') %> -######## defined in cinder.openstack.volume.drivers.ibm.gpfs ######## - -# Specifies the path of the GPFS directory where Block Storage -# volume and snapshot files are stored. (string value) -gpfs_mount_point_base = <%= node["openstack"]["block-storage"]["gpfs"]["gpfs_mount_point_base"] %> - -<% if node['openstack']['block-storage']['gpfs']['gpfs_images_dir'] %> -# Specifies the path of the Image service repository in GPFS. -# Leave undefined if not storing images in GPFS. (string -# value) -gpfs_images_dir = <%= node['openstack']['block-storage']['gpfs']['gpfs_images_dir'] %> - -# Specifies the type of image copy to be used. Set this when -# the Image service repository also uses GPFS so that image -# files can be transferred efficiently from the Image service -# to the Block Storage service. There are two valid values: -# "copy" specifies that a full copy of the image is made; -# "copy_on_write" specifies that copy-on-write optimization -# strategy is used and unmodified blocks of the image file are -# shared efficiently. (string value) -gpfs_images_share_mode = <%= node['openstack']['block-storage']['gpfs']['gpfs_images_share_mode'] %> -<% end %> - -# Specifies an upper limit on the number of indirections -# required to reach a specific block due to snapshots or -# clones. A lengthy chain of copy-on-write snapshots or -# clones can have a negative impact on performance, but -# improves space utilization. 0 indicates unlimited clone -# depth. (integer value) -gpfs_max_clone_depth = <%= node['openstack']['block-storage']['gpfs']['gpfs_max_clone_depth'] %> - -# Specifies that volumes are created as sparse files which -# initially consume no space. If set to False, the volume is -# created as a fully allocated file, in which case, creation -# may take a significantly longer time. (boolean value) -gpfs_sparse_volumes = <%= node['openstack']['block-storage']['gpfs']['gpfs_sparse_volumes'] %> - -# Specifies the storage pool that volumes are assigned to. By -# default, the system storage pool is used. (string value) -gpfs_storage_pool = <%= node['openstack']['block-storage']['gpfs']['gpfs_storage_pool'] %> -<% end %> - -<% unless @multi_backend_sections.empty? %> -enabled_backends = <%= @multi_backend_sections.keys.join(',') %> -<% end %> - -# Misc options -<% if node["openstack"]["block-storage"]["misc_cinder"] %> -<% node["openstack"]["block-storage"]["misc_cinder"].each do |m| %> -<%= m %> -<% end %> -<% end %> - -# Multi-backend support, add new sections here -# Make sure these sections are at the bottom of conf file -<% unless @multi_backend_sections.empty? %> -<% @multi_backend_sections.each do |sec, opts| %> -[<%= sec %>] -<% opts.each do |optline| %> -<%= optline %> -<% end %> - -<% end %> -<% end %> - -[database] - -# -# Options defined in oslo.db -# - -backend=sqlalchemy -#### (StrOpt) The backend to use for db - -connection=<%= @sql_connection %> -# sql_connection=sqlite:///$state_path/$sqlite_db -#### (StrOpt) The SQLAlchemy connection string used to connect to the -#### database - -# sql_connection_debug=0 -#### (IntOpt) Verbosity of SQL debugging information. 0=None, -#### 100=Everything -<% if node['openstack']['endpoints']['db']['enabled_slave'] %> -slave_connection=<%= @slave_connection %> -<% end %> - - -[keymgr] - -# -# Options defined in cinder.keymgr -# - -# The full class name of the key manager API class (string value) -api_class=<%= node['openstack']['block-storage']['keymgr']['api_class'] %> - -# -# Options defined in cinder.keymgr.conf_key_mgr -# - -# Fixed key returned by key manager, specified in hex (string value) -<% if node["openstack"]["block-storage"]["keymgr"]["fixed_key"] -%> -fixed_key=<%= node["openstack"]["block-storage"]["keymgr"]["fixed_key"] %> -<% end -%> - -[keystone_authtoken] - -# -# Options defined in keystonemiddleware.auth_token -# - -# Complete public Identity API endpoint (string value) -auth_uri = <%= @auth_uri %> - -# Complete admin Identity API endpoint. This should specify -# the unversioned root endpoint e.g. https://localhost:35357/ -# (string value) -identity_uri = <%= @identity_uri %> - -# API version of the admin Identity API endpoint (string -# value) -<% if node['openstack']['block-storage']['api']['auth']['version'] != 'v2.0' %> -auth_version = <%= node['openstack']['block-storage']['api']['auth']['version'] %> -<% end %> - -# Do not handle authorization requests within the middleware, -# but delegate the authorization decision to downstream WSGI -# components (boolean value) -#delay_auth_decision=false - -# Request timeout value for communicating with Identity API -# server. (boolean value) -#http_connect_timeout= - -# How many times are we trying to reconnect when communicating -# with Identity API Server. (integer value) -#http_request_max_retries=3 - -# This option is deprecated and may be removed in a future -# release. Single shared secret with the Keystone -# configuration used for bootstrapping a Keystone -# installation, or otherwise bypassing the normal -# authentication process. This option should not be used, use -# `admin_user` and `admin_password` instead. (string value) -#admin_token= - -# Keystone account username (string value) -admin_user = <%= node["openstack"]["block-storage"]["service_user"] %> - -# Keystone account password (string value) -admin_password = <%= @service_pass %> - -# Keystone service account tenant name to validate user tokens -# (string value) -admin_tenant_name = <%= node["openstack"]["block-storage"]["service_tenant_name"] %> - -# Env key for the swift cache (string value) -#cache= - -# Required if Keystone server requires client certificate -# (string value) -#certfile= - -# Required if Keystone server requires client certificate -# (string value) -#keyfile= - -# A PEM encoded Certificate Authority to use when verifying -# HTTPs connections. Defaults to system CAs. (string value) -#cafile= -<% if node['openstack']['block-storage']['api']['auth']['cafile'] %> -cafile = <%= node['openstack']['block-storage']['api']['auth']['cafile'] %> -<% end %> - -# Verify HTTPS connections. (boolean value) -#insecure=false -insecure = <%= node['openstack']['block-storage']['api']['auth']['insecure'] %> - -# Directory used to cache files related to PKI tokens (string -# value) -signing_dir = <%= node["openstack"]["block-storage"]["api"]["auth"]["cache_dir"] %> - -# Optionally specify a list of memcached server(s) to use for -# caching. If left undefined, tokens will instead be cached -# in-process. (list value) -# Deprecated group/name - [DEFAULT]/memcache_servers -#memcached_servers= -<% if node['openstack']['block-storage']['api']['auth']['memcached_servers'] %> -memcached_servers = <%= node['openstack']['block-storage']['api']['auth']['memcached_servers'] %> -<% end %> - -# In order to prevent excessive effort spent validating -# tokens, the middleware caches previously-seen tokens for a -# configurable duration (in seconds). Set to -1 to disable -# caching completely. (integer value) -#token_cache_time=300 - -# Determines the frequency at which the list of revoked tokens -# is retrieved from the Identity service (in seconds). A high -# number of revocation events combined with a low cache -# duration may significantly reduce performance. (integer -# value) -#revocation_cache_time=10 - -# (optional) if defined, indicate whether token data should be -# authenticated or authenticated and encrypted. Acceptable -# values are MAC or ENCRYPT. If MAC, token data is -# authenticated (with HMAC) in the cache. If ENCRYPT, token -# data is encrypted and authenticated in the cache. If the -# value is not one of these options or empty, auth_token will -# raise an exception on initialization. (string value) -#memcache_security_strategy= -<% if node['openstack']['block-storage']['api']['auth']['memcache_security_strategy'] %> -memcache_security_strategy = <%= node['openstack']['block-storage']['api']['auth']['memcache_security_strategy'] %> -<% end %> - -# (optional, mandatory if memcache_security_strategy is -# defined) this string is used for key derivation. (string -# value) -#memcache_secret_key= -<% if node['openstack']['block-storage']['api']['auth']['memcache_secret_key'] %> -memcache_secret_key = <%= node['openstack']['block-storage']['api']['auth']['memcache_secret_key'] %> -<% end %> - -# (optional) indicate whether to set the X-Service-Catalog -# header. If False, middleware will not ask for service -# catalog on token validation and will not set the X-Service- -# Catalog header. (boolean value) -#include_service_catalog=true - -# Used to control the use and type of token binding. Can be -# set to: "disabled" to not check token binding. "permissive" -# (default) to validate binding information if the bind type -# is of a form known to the server and ignore it if not. -# "strict" like "permissive" but if the bind type is unknown -# the token will be rejected. "required" any form of token -# binding is needed to be allowed. Finally the name of a -# binding method that must be present in tokens. (string -# value) -#enforce_token_bind=permissive - -# If true, the revocation list will be checked for cached -# tokens. This requires that PKI tokens are configured on the -# Keystone server. (boolean value) -#check_revocations_for_cached=false - -# Hash algorithms to use for hashing PKI tokens. This may be a -# single algorithm or multiple. The algorithms are those -# supported by Python standard hashlib.new(). The hashes will -# be tried in the order given, so put the preferred one first -# for performance. The result of the first hash will be stored -# in the cache. This will typically be set to multiple values -# only while migrating from a less secure algorithm to a more -# secure one. Once all the old tokens are expired this option -# should be set to a single value for better performance. -# (list value) -#hash_algorithms=md5 -hash_algorithms = <%= node['openstack']['block-storage']['api']['auth']['hash_algorithms'] %> - - -[oslo_concurrency] - -# lock_path -lock_path=<%= node["openstack"]["block-storage"]["lock_path"] %> - - -<% if @mq_service_type == "qpid" %> -[oslo_messaging_qpid] - -# -# From oslo.messaging -# - -# from oslo/messaging/_drivers/amqp.py -amqp_durable_queues=<%= node['openstack']['mq']['block-storage']['durable_queues'] %> -amqp_auto_delete=<%= node['openstack']['mq']['block-storage']['auto_delete'] %> - -rpc_conn_pool_size=<%= node["openstack"]["block-storage"]["rpc_conn_pool_size"] %> - -#### (IntOpt) Size of RPC connection pool - -##### QPID ##### -######## defined in cinder.openstack.common.rpc.impl_qpid ######## -qpid_hostname=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["host"] %> -#### (StrOpt) Qpid broker hostname - -qpid_port=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["port"] %> -#### (StrOpt) Qpid broker port - -qpid_username=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["username"] %> -#### (StrOpt) Username for qpid connection - -qpid_password=<%= @mq_password %> -#### (StrOpt) Password for qpid connection - -qpid_sasl_mechanisms=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["sasl_mechanisms"] %> -#### (StrOpt) Space separated list of SASL mechanisms to use for auth - -qpid_reconnect=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["reconnect"] %> -#### (BoolOpt) Automatically reconnect - -qpid_reconnect_timeout=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["reconnect_timeout"] %> -#### (IntOpt) Reconnection timeout in seconds - -qpid_reconnect_limit=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["reconnect_limit"] %> -#### (IntOpt) Max reconnections before giving up - -qpid_reconnect_interval_min=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["reconnect_interval_min"] %> -#### (IntOpt) Minimum seconds between reconnection attempts - -qpid_reconnect_interval_max=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["reconnect_interval_max"] %> -#### (IntOpt) Maximum seconds between reconnection attempts - -qpid_reconnect_interval=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["reconnect_interval"] %> -#### (IntOpt) Equivalent to setting max and min to the same value - -qpid_heartbeat=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["heartbeat"] %> -#### (IntOpt) Seconds between connection keepalive heartbeats - -qpid_protocol=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["protocol"] %> -#### (StrOpt) Transport to use, either 'tcp' or 'ssl' - -qpid_tcp_nodelay=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["tcp_nodelay"] %> -#### (BoolOpt) Disable Nagle algorithm - -qpid_topology_version=<%= node['openstack']['mq']['block-storage']['qpid']['topology_version'] %> -#### (IntOpt) See oslo/messaging/_drivers/impl_qpid.py for details - -notification_topics=<%= node["openstack"]["mq"]["block-storage"]["qpid"]["notification_topic"] %> -#### (ListOpt) AMQP topic used for openstack notifications -<% end %> - -<% if @mq_service_type == "rabbitmq" %> -[oslo_messaging_rabbit] - -# -# From oslo.messaging -# - -# Number of seconds after which the Rabbit broker is considered down if heartbeat's keep-alive fails (0 disable the heartbeat) -heartbeat_timeout_threshold=<%= node['openstack']['mq']['block-storage']['rabbit']['heartbeat_timeout_threshold'] %> - -# How often times during the heartbeat_timeout_threshold we check the heartbeat -heartbeat_rate=<%= node['openstack']['mq']['block-storage']['rabbit']['heartbeat_rate'] %> - -# from oslo/messaging/_drivers/amqp.py -amqp_durable_queues=<%= node['openstack']['mq']['block-storage']['durable_queues'] %> -amqp_auto_delete=<%= node['openstack']['mq']['block-storage']['auto_delete'] %> - -rpc_conn_pool_size=<%= node["openstack"]["block-storage"]["rpc_conn_pool_size"] %> - -#### (IntOpt) Size of RPC connection pool - -# fake_rabbit=false -#### (BoolOpt) If passed, use a fake RabbitMQ provider - -######## defined in cinder.openstack.common.rpc.impl_kombu ######## - -<% if node['openstack']['mq']['block-storage']['rabbit']['use_ssl'] -%> - -# Connect over SSL for RabbitMQ. (boolean value) -rabbit_use_ssl=true - -<% if node['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_version'] -%> -# SSL version to use (valid only if SSL enabled). valid values -# are TLSv1 and SSLv23. SSLv2 and SSLv3 may be available on -# some distributions. (string value) -kombu_ssl_version=<%= node['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_version'] %> -<% end -%> -<% if node['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_keyfile'] -%> -# SSL key file (valid only if SSL enabled) -kombu_ssl_keyfile=<%= node['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_keyfile'] %> -<% end -%> -<% if node['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_certfile'] -%> -# SSL cert file (valid only if SSL enabled) -kombu_ssl_certfile=<%= node['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_certfile'] %> -<% end -%> -<% if node['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_ca_certs'] -%> -# SSL certification authority file (valid only if SSL enabled) -kombu_ssl_ca_certs=<%= node['openstack']['mq']['block-storage']['rabbit']['kombu_ssl_ca_certs'] %> -<% end -%> -# How long to wait before reconnecting in response to an AMQP consumer cancel notification -kombu_reconnect_delay=<%= node['openstack']['mq']['block-storage']['rabbit']['kombu_reconnect_delay'] %> -# How long to wait before considering a reconnect attempt to have failed. -# This value should not be longer than rpc_response_timeout -kombu_reconnect_timeout=<%= node['openstack']['mq']['block-storage']['rabbit']['kombu_reconnect_timeout'] %> -<% end -%> - -<% if node["openstack"]["mq"]["block-storage"]["rabbit"]["ha"] -%> -rabbit_hosts=<%= @rabbit_hosts %> -#### (ListOpt) RabbitMQ HA cluster host:port pairs - -# rabbit_durable_queues=false -#### (BoolOpt) use durable queues in RabbitMQ - -rabbit_ha_queues=True -#### (BoolOpt) use H/A queues in RabbitMQ (x-ha-policy: all).You need to -#### wipe RabbitMQ database when changing this option. -<% else -%> -rabbit_host=<%= node["openstack"]["mq"]["block-storage"]["rabbit"]["host"] %> -#### (StrOpt) The RabbitMQ broker address where a single node is used - -rabbit_port=<%= node["openstack"]["mq"]["block-storage"]["rabbit"]["port"] %> -#### (IntOpt) The RabbitMQ broker port where a single node is used -<% end -%> - -rabbit_userid=<%= node["openstack"]["mq"]["block-storage"]["rabbit"]["userid"] %> -#### (StrOpt) the RabbitMQ userid - -rabbit_password=<%= @mq_password %> -#### (StrOpt) the RabbitMQ password - -rabbit_virtual_host=<%= node["openstack"]["mq"]["block-storage"]["rabbit"]["vhost"] %> -#### (StrOpt) the RabbitMQ virtual host - -notification_topics=<%= node["openstack"]["mq"]["block-storage"]["rabbit"]["notification_topic"] %> -#### (ListOpt) AMQP topic used for openstack notifications - -rabbit_retry_interval=<%= node["openstack"]["mq"]["block-storage"]["rabbit"]["rabbit_retry_interval"] %> -#### (IntOpt) how frequently to retry connecting with RabbitMQ - -# rabbit_retry_backoff=2 -#### (IntOpt) how long to backoff for between retries when connecting to -#### RabbitMQ - -rabbit_max_retries=<%= node["openstack"]["mq"]["block-storage"]["rabbit"]["rabbit_max_retries"] %> -#### (IntOpt) maximum retries with trying to connect to RabbitMQ (the -#### default of 0 implies an infinite retry count) - -<% end %> +<% @service_config.each do |section, values| -%> +[<%= section %>] + <% values.each do |key, value| -%> + <% if value.class == Hash -%> +<%= "# #{value['comment']}" -%> +<%= key %> = <%= value['set_to'] %> + <% else -%> +<%= key %> = <%= value %> + <% end -%> + <% end -%> +<% end -%> \ No newline at end of file diff --git a/templates/default/cinder_emc_config.xml.erb b/templates/default/cinder_emc_config.xml.erb deleted file mode 100644 index 9e722f7..0000000 --- a/templates/default/cinder_emc_config.xml.erb +++ /dev/null @@ -1,10 +0,0 @@ - -<%= node["openstack"]["block-storage"]["emc"]["StorageType"] %> -<%= node["openstack"]["block-storage"]["emc"]["EcomServerIP"] %> -<%= node["openstack"]["block-storage"]["emc"]["EcomServerPort"] %> -<%= node["openstack"]["block-storage"]["emc"]["EcomUserName"] %> -<%= @ecom_password %> -<% unless node["openstack"]["block-storage"]["emc"]["MaskingView"].nil? %> -<%= node["openstack"]["block-storage"]["emc"]["MaskingView"] %> -<% end %> - diff --git a/templates/default/nfs_shares.conf.erb b/templates/default/nfs_shares.conf.erb deleted file mode 100644 index e03edb7..0000000 --- a/templates/default/nfs_shares.conf.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= node["openstack"]["block-storage"]["custom_template_banner"] %> - -<%= @host %>:<%= @export %> diff --git a/templates/default/rootwrap.conf.erb b/templates/default/rootwrap.conf.erb deleted file mode 100644 index 86e34b6..0000000 --- a/templates/default/rootwrap.conf.erb +++ /dev/null @@ -1,29 +0,0 @@ -<%= node['openstack']['block-storage']['custom_template_banner'] %> - -# Configuration for cinder-rootwrap -# This file should be owned by (and only-writeable by) the root user - -[DEFAULT] -# List of directories to load filter definitions from (separated by ','). -# These directories MUST all be only writeable by root ! -filters_path=/etc/cinder/rootwrap.d,/usr/share/cinder/rootwrap - -# List of directories to search executables in, in case filters do not -# explicitely specify a full path (separated by ',') -# If not specified, defaults to system PATH environment variable. -# These directories MUST all be only writeable by root ! -exec_dirs=/sbin,/usr/sbin,/bin,/usr/bin - -# Enable logging to syslog -# Default value is False -use_syslog=False - -# Which syslog facility to use. -# Valid values include auth, authpriv, syslog, local0, local1... -# Default value is 'syslog' -syslog_log_facility=syslog - -# Which messages to log. -# INFO means log all usage -# ERROR means only log unsuccessful attempts -syslog_log_level=ERROR diff --git a/templates/default/shares.conf.erb b/templates/default/shares.conf.erb deleted file mode 100644 index 1c46112..0000000 --- a/templates/default/shares.conf.erb +++ /dev/null @@ -1,5 +0,0 @@ -<%= node["openstack"]["block-storage"]["custom_template_banner"] %> - -<% node["openstack"]["block-storage"]["netapp"]["netapp_server_hostname"].each do |h| %> -<%= h %>:<%= @export %> -<% end %> diff --git a/templates/default/targets.conf.erb b/templates/default/targets.conf.erb index bc4a01a..ff029e1 100644 --- a/templates/default/targets.conf.erb +++ b/templates/default/targets.conf.erb @@ -1,9 +1,9 @@ <%= node["openstack"]["block-storage"]["custom_template_banner"] %> -<% if %w{rhel fedora suse}.include?(node["platform_family"]) %> -include <%= node['openstack']['block-storage']['volume']['volumes_dir'] %>/* +<% if %w(rhel).include?(node["platform_family"]) %> +include <%= node['openstack']['block-storage']['conf']['DEFAULT']['volumes_dir'] %>/* <% end %> -<% if %w{debian}.include?(node["platform_family"]) %> +<% if %w(debian).include?(node["platform_family"]) %> include /etc/tgt/conf.d/*.conf <% end %> default-driver iscsi