Add glance caching options for soldifire
This allows the user to set the options for solidfire to cache glance images for subsequent glance calls to the same image Change-Id: I53697d58b58d33657a0ca2bb0eaf0ba7a770897d
This commit is contained in:
		@@ -34,6 +34,17 @@
 | 
			
		||||
#   (optional) Prefix to use when creating tenant accounts on SolidFire Cluster.
 | 
			
		||||
#   Defaults to None, so account name is simply the tenant-uuid
 | 
			
		||||
#
 | 
			
		||||
# [*sf_template_account_name*]
 | 
			
		||||
#   (optional) Account name on the SolidFire Cluster to use as owner of
 | 
			
		||||
#   template/cache volumes (created if does not exist)
 | 
			
		||||
#   Defaults to openstack-vtemplate
 | 
			
		||||
#
 | 
			
		||||
# [*sf_allow_template_caching*]
 | 
			
		||||
#   (optional) Create an internal cache of copy of images when a bootable
 | 
			
		||||
#   volume is created to eliminate fetch from glance and qemu-
 | 
			
		||||
#   conversion on subsequent calls.
 | 
			
		||||
#   Defaults to false
 | 
			
		||||
#
 | 
			
		||||
# [*sf_api_port*]
 | 
			
		||||
#   (optional) Port ID to use to connect to SolidFire API.
 | 
			
		||||
#   Defaults to 443
 | 
			
		||||
@@ -48,25 +59,29 @@ define cinder::backend::solidfire(
 | 
			
		||||
  $san_ip,
 | 
			
		||||
  $san_login,
 | 
			
		||||
  $san_password,
 | 
			
		||||
  $volume_backend_name = $name,
 | 
			
		||||
  $volume_driver       = 'cinder.volume.drivers.solidfire.SolidFireDriver',
 | 
			
		||||
  $sf_emulate_512      = true,
 | 
			
		||||
  $sf_allow_tenant_qos = false,
 | 
			
		||||
  $sf_account_prefix   = '',
 | 
			
		||||
  $sf_api_port         = '443',
 | 
			
		||||
  $extra_options       = {},
 | 
			
		||||
  $volume_backend_name       = $name,
 | 
			
		||||
  $volume_driver             = 'cinder.volume.drivers.solidfire.SolidFireDriver',
 | 
			
		||||
  $sf_emulate_512            = true,
 | 
			
		||||
  $sf_allow_tenant_qos       = false,
 | 
			
		||||
  $sf_account_prefix         = '',
 | 
			
		||||
  $sf_template_account_name  = 'openstack-vtemplate',
 | 
			
		||||
  $sf_allow_template_caching = false,
 | 
			
		||||
  $sf_api_port               = '443',
 | 
			
		||||
  $extra_options             = {},
 | 
			
		||||
) {
 | 
			
		||||
 | 
			
		||||
  cinder_config {
 | 
			
		||||
    "${name}/volume_backend_name": value => $volume_backend_name;
 | 
			
		||||
    "${name}/volume_driver":       value => $volume_driver;
 | 
			
		||||
    "${name}/san_ip":              value => $san_ip;
 | 
			
		||||
    "${name}/san_login":           value => $san_login;
 | 
			
		||||
    "${name}/san_password":        value => $san_password, secret => true;
 | 
			
		||||
    "${name}/sf_emulate_512":      value => $sf_emulate_512;
 | 
			
		||||
    "${name}/sf_allow_tenant_qos": value => $sf_allow_tenant_qos;
 | 
			
		||||
    "${name}/sf_account_prefix":   value => $sf_account_prefix;
 | 
			
		||||
    "${name}/sf_api_port":         value => $sf_api_port;
 | 
			
		||||
    "${name}/volume_backend_name":        value => $volume_backend_name;
 | 
			
		||||
    "${name}/volume_driver":              value => $volume_driver;
 | 
			
		||||
    "${name}/san_ip":                     value => $san_ip;
 | 
			
		||||
    "${name}/san_login":                  value => $san_login;
 | 
			
		||||
    "${name}/san_password":               value => $san_password, secret => true;
 | 
			
		||||
    "${name}/sf_emulate_512":             value => $sf_emulate_512;
 | 
			
		||||
    "${name}/sf_allow_tenant_qos":        value => $sf_allow_tenant_qos;
 | 
			
		||||
    "${name}/sf_account_prefix":          value => $sf_account_prefix;
 | 
			
		||||
    "${name}/sf_template_account_name":   value => $sf_template_account_name;
 | 
			
		||||
    "${name}/sf_allow_template_caching":  value => $sf_allow_template_caching;
 | 
			
		||||
    "${name}/sf_api_port":                value => $sf_api_port;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  create_resources('cinder_config', $extra_options)
 | 
			
		||||
 
 | 
			
		||||
@@ -30,6 +30,17 @@
 | 
			
		||||
#   (optional) Prefix to use when creating tenant accounts on SolidFire Cluster.
 | 
			
		||||
#   Defaults to None, so account name is simply the tenant-uuid
 | 
			
		||||
#
 | 
			
		||||
# [*sf_template_account_name*]
 | 
			
		||||
#   (optional) Account name on the SolidFire Cluster to use as owner of
 | 
			
		||||
#   template/cache volumes (created if does not exist)
 | 
			
		||||
#   Defaults to openstack-vtemplate
 | 
			
		||||
#
 | 
			
		||||
# [*sf_allow_template_caching*]
 | 
			
		||||
#   (optional) Create an internal cache of copy of images when a bootable
 | 
			
		||||
#   volume is created to eliminate fetch from glance and qemu-
 | 
			
		||||
#   conversion on subsequent calls.
 | 
			
		||||
#   Defaults to false
 | 
			
		||||
#
 | 
			
		||||
# [*sf_api_port*]
 | 
			
		||||
#   (optional) Port ID to use to connect to SolidFire API.
 | 
			
		||||
#   Defaults to 443
 | 
			
		||||
@@ -44,23 +55,27 @@ class cinder::volume::solidfire(
 | 
			
		||||
  $san_ip,
 | 
			
		||||
  $san_login,
 | 
			
		||||
  $san_password,
 | 
			
		||||
  $volume_driver       = 'cinder.volume.drivers.solidfire.SolidFireDriver',
 | 
			
		||||
  $sf_emulate_512      = true,
 | 
			
		||||
  $sf_allow_tenant_qos = false,
 | 
			
		||||
  $sf_account_prefix   = '',
 | 
			
		||||
  $sf_api_port         = '443',
 | 
			
		||||
  $extra_options       = {},
 | 
			
		||||
  $volume_driver             = 'cinder.volume.drivers.solidfire.SolidFireDriver',
 | 
			
		||||
  $sf_emulate_512            = true,
 | 
			
		||||
  $sf_allow_tenant_qos       = false,
 | 
			
		||||
  $sf_account_prefix         = '',
 | 
			
		||||
  $sf_template_account_name  = 'openstack-vtemplate',
 | 
			
		||||
  $sf_allow_template_caching = false,
 | 
			
		||||
  $sf_api_port               = '443',
 | 
			
		||||
  $extra_options             = {},
 | 
			
		||||
) {
 | 
			
		||||
 | 
			
		||||
  cinder::backend::solidfire { 'DEFAULT':
 | 
			
		||||
    san_ip              => $san_ip,
 | 
			
		||||
    san_login           => $san_login,
 | 
			
		||||
    san_password        => $san_password,
 | 
			
		||||
    volume_driver       => $volume_driver,
 | 
			
		||||
    sf_emulate_512      => $sf_emulate_512,
 | 
			
		||||
    sf_allow_tenant_qos => $sf_allow_tenant_qos,
 | 
			
		||||
    sf_account_prefix   => $sf_account_prefix,
 | 
			
		||||
    sf_api_port         => $sf_api_port,
 | 
			
		||||
    extra_options       => $extra_options,
 | 
			
		||||
    san_ip                    => $san_ip,
 | 
			
		||||
    san_login                 => $san_login,
 | 
			
		||||
    san_password              => $san_password,
 | 
			
		||||
    volume_driver             => $volume_driver,
 | 
			
		||||
    sf_emulate_512            => $sf_emulate_512,
 | 
			
		||||
    sf_allow_tenant_qos       => $sf_allow_tenant_qos,
 | 
			
		||||
    sf_account_prefix         => $sf_account_prefix,
 | 
			
		||||
    sf_template_account_name  => $sf_template_account_name,
 | 
			
		||||
    sf_allow_template_caching => $sf_allow_template_caching,
 | 
			
		||||
    sf_api_port               => $sf_api_port,
 | 
			
		||||
    extra_options             => $extra_options,
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -19,6 +19,8 @@ describe 'cinder::volume::solidfire' do
 | 
			
		||||
      is_expected.to contain_cinder_config('DEFAULT/san_ip').with_value('127.0.0.2')
 | 
			
		||||
      is_expected.to contain_cinder_config('DEFAULT/san_login').with_value('solidfire')
 | 
			
		||||
      is_expected.to contain_cinder_config('DEFAULT/san_password').with_value('password')
 | 
			
		||||
      is_expected.to contain_cinder_config('DEFAULT/sf_template_account_name').with_value('openstack-vtemplate')
 | 
			
		||||
      is_expected.to contain_cinder_config('DEFAULT/sf_allow_template_caching').with_value('false')
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it 'marks san_password as secret' do
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,10 @@ describe 'cinder::backend::solidfire' do
 | 
			
		||||
        'solidfire')
 | 
			
		||||
      is_expected.to contain_cinder_config('solidfire/san_password').with_value(
 | 
			
		||||
        'password')
 | 
			
		||||
      is_expected.to contain_cinder_config('solidfire/sf_template_account_name').with_value(
 | 
			
		||||
        'openstack-vtemplate')
 | 
			
		||||
      is_expected.to contain_cinder_config('solidfire/sf_allow_template_caching').with_value(
 | 
			
		||||
        'false')
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user