memcached (openstack) is no longer in use
[mirror/dsa-puppet.git] / 3rdparty / modules / cinder / manifests / backend / netapp.pp
1 # == define: cinder::backend::netapp
2 #
3 # Configures Cinder to use the NetApp unified volume driver
4 # Compatible for multiple backends
5 #
6 # === Parameters
7 #
8 # [*netapp_login*]
9 #   (required) Administrative user account name used to access the storage
10 #   system or proxy server.
11 #
12 # [*netapp_password*]
13 #   (required) Password for the administrative user account specified in the
14 #   netapp_login parameter.
15 #
16 # [*netapp_server_hostname*]
17 #   (required) The hostname (or IP address) for the storage system or proxy
18 #   server.
19 #
20 # [*netapp_server_port*]
21 #   (optional) The TCP port to use for communication with ONTAPI on the
22 #   storage system. Traditionally, port 80 is used for HTTP and port 443 is
23 #   used for HTTPS; however, this value should be changed if an alternate
24 #   port has been configured on the storage system or proxy server.
25 #   Defaults to 80
26 #
27 # [*netapp_size_multiplier*]
28 #   (optional) The quantity to be multiplied by the requested volume size to
29 #   ensure enough space is available on the virtual storage server (Vserver) to
30 #   fulfill the volume creation request.
31 #   Defaults to 1.2
32 #
33 # [*netapp_storage_family*]
34 #   (optional) The storage family type used on the storage system; valid values
35 #   are ontap_7mode for using Data ONTAP operating in 7-Mode or ontap_cluster
36 #   for using clustered Data ONTAP, or eseries for NetApp E-Series.
37 #   Defaults to ontap_cluster
38 #
39 # [*netapp_storage_protocol*]
40 #   (optional) The storage protocol to be used on the data path with the storage
41 #   system; valid values are iscsi or nfs.
42 #   Defaults to nfs
43 #
44 # [*netapp_transport_type*]
45 #   (optional) The transport protocol used when communicating with ONTAPI on the
46 #   storage system or proxy server. Valid values are http or https.
47 #   Defaults to http
48 #
49 # [*netapp_vfiler*]
50 #   (optional) The vFiler unit on which provisioning of block storage volumes
51 #   will be done. This parameter is only used by the driver when connecting to
52 #   an instance with a storage family of Data ONTAP operating in 7-Mode and the
53 #   storage protocol selected is iSCSI. Only use this parameter when utilizing
54 #   the MultiStore feature on the NetApp storage system.
55 #   Defaults to ''
56 #
57 # [*netapp_volume_list*]
58 #   (optional) This parameter is only utilized when the storage protocol is
59 #   configured to use iSCSI. This parameter is used to restrict provisioning to
60 #   the specified controller volumes. Specify the value of this parameter to be
61 #   a comma separated list of NetApp controller volume names to be used for
62 #   provisioning.
63 #   Defaults to ''
64 #
65 # [*netapp_vserver*]
66 #   (optional) This parameter specifies the virtual storage server (Vserver)
67 #   name on the storage cluster on which provisioning of block storage volumes
68 #   should occur. If using the NFS storage protocol, this parameter is mandatory
69 #   for storage service catalog support (utilized by Cinder volume type
70 #   extra_specs support). If this parameter is specified, the exports belonging
71 #   to the Vserver will only be used for provisioning in the future. Block
72 #   storage volumes on exports not belonging to the Vserver specified by
73 #   this parameter will continue to function normally.
74 #   Defaults to ''
75 #
76 # [*expiry_thres_minutes*]
77 #   (optional) This parameter specifies the threshold for last access time for
78 #   images in the NFS image cache. When a cache cleaning cycle begins, images
79 #   in the cache that have not been accessed in the last M minutes, where M is
80 #   the value of this parameter, will be deleted from the cache to create free
81 #   space on the NFS share.
82 #   Defaults to 720
83 #
84 # [*thres_avl_size_perc_start*]
85 #   (optional) If the percentage of available space for an NFS share has
86 #   dropped below the value specified by this parameter, the NFS image cache
87 #   will be cleaned.
88 #   Defaults to 20
89 #
90 # [*thres_avl_size_perc_stop*]
91 #   (optional) When the percentage of available space on an NFS share has
92 #   reached the percentage specified by this parameter, the driver will stop
93 #   clearing files from the NFS image cache that have not been accessed in the
94 #   last M minutes, where M is the value of the expiry_thres_minutes parameter.
95 #   Defaults to 60
96 #
97 # [*nfs_shares*]
98 #   (optional) Array of NFS exports in the form of host:/share; will be written into
99 #    file specified in nfs_shares_config
100 #    Defaults to undef
101 #
102 # [*nfs_shares_config*]
103 #   (optional) File with the list of available NFS shares
104 #   Defaults to '/etc/cinder/shares.conf'
105 #
106 # [*nfs_mount_options*]
107 #   (optional) Mount options passed to the nfs client. See section
108 #   of the nfs man page for details.
109 #   Defaults to undef
110 #
111 # [*netapp_copyoffload_tool_path*]
112 #   (optional) This option specifies the path of the NetApp Copy Offload tool
113 #   binary. Ensure that the binary has execute permissions set which allow the
114 #   effective user of the cinder-volume process to execute the file.
115 #   Defaults to ''
116 #
117 # [*netapp_controller_ips*]
118 #   (optional) This option is only utilized when the storage family is
119 #   configured to eseries. This option is used to restrict provisioning to the
120 #   specified controllers. Specify the value of this option to be a comma
121 #   separated list of controller hostnames or IP addresses to be used for
122 #   provisioning.
123 #   Defaults to ''
124 #
125 # [*netapp_sa_password*]
126 #   (optional) Password for the NetApp E-Series storage array.
127 #   Defaults to ''
128 #
129 # [*netapp_storage_pools*]
130 #   (optional) This option is used to restrict provisioning to the specified
131 #   storage pools. Only dynamic disk pools are currently supported. Specify the
132 #   value of this option to be a comma separated list of disk pool names to be
133 #   used for provisioning.
134 #   Defaults to ''
135 #
136 # [*netapp_webservice_path*]
137 #   (optional) This option is used to specify the path to the E-Series proxy
138 #   application on a proxy server. The value is combined with the value of the
139 #   netapp_transport_type, netapp_server_hostname, and netapp_server_port
140 #   options to create the URL used by the driver to connect to the proxy
141 #   application.
142 #   Defaults to '/devmgr/v2'
143 #
144 # === Examples
145 #
146 #  cinder::backend::netapp { 'myBackend':
147 #    netapp_login           => 'clusterAdmin',
148 #    netapp_password        => 'password',
149 #    netapp_server_hostname => 'netapp.mycorp.com',
150 #    netapp_server_port     => '443',
151 #    netapp_transport_type  => 'https',
152 #    netapp_vserver         => 'openstack-vserver',
153 #  }
154 #
155 # === Authors
156 #
157 # Bob Callaway <bob.callaway@netapp.com>
158 #
159 # === Copyright
160 #
161 # Copyright 2014 NetApp, Inc.
162 #
163 define cinder::backend::netapp (
164   $netapp_login,
165   $netapp_password,
166   $netapp_server_hostname,
167   $volume_backend_name          = $name,
168   $netapp_server_port           = '80',
169   $netapp_size_multiplier       = '1.2',
170   $netapp_storage_family        = 'ontap_cluster',
171   $netapp_storage_protocol      = 'nfs',
172   $netapp_transport_type        = 'http',
173   $netapp_vfiler                = '',
174   $netapp_volume_list           = '',
175   $netapp_vserver               = '',
176   $expiry_thres_minutes         = '720',
177   $thres_avl_size_perc_start    = '20',
178   $thres_avl_size_perc_stop     = '60',
179   $nfs_shares                   = undef,
180   $nfs_shares_config            = '/etc/cinder/shares.conf',
181   $netapp_copyoffload_tool_path = '',
182   $netapp_controller_ips        = '',
183   $netapp_sa_password           = '',
184   $netapp_storage_pools         = '',
185   $nfs_mount_options            = undef,
186   $netapp_webservice_path       = '/devmgr/v2',
187 ) {
188
189   if $nfs_shares {
190     validate_array($nfs_shares)
191     file {$nfs_shares_config:
192       content => join($nfs_shares, "\n"),
193       require => Package['cinder'],
194       notify  => Service['cinder-volume']
195     }
196   }
197
198   if $nfs_mount_options {
199     cinder_config {
200       "${volume_backend_name}/nfs_mount_options": value => $nfs_mount_options;
201     }
202   } else {
203     cinder_config {
204       "${volume_backend_name}/nfs_mount_options": ensure => absent;
205     }
206   }
207
208   cinder_config {
209     "${volume_backend_name}/volume_backend_name":          value => $volume_backend_name;
210     "${volume_backend_name}/volume_driver":                value => 'cinder.volume.drivers.netapp.common.NetAppDriver';
211     "${volume_backend_name}/netapp_login":                 value => $netapp_login;
212     "${volume_backend_name}/netapp_password":              value => $netapp_password, secret => true;
213     "${volume_backend_name}/netapp_server_hostname":       value => $netapp_server_hostname;
214     "${volume_backend_name}/netapp_server_port":           value => $netapp_server_port;
215     "${volume_backend_name}/netapp_size_multiplier":       value => $netapp_size_multiplier;
216     "${volume_backend_name}/netapp_storage_family":        value => $netapp_storage_family;
217     "${volume_backend_name}/netapp_storage_protocol":      value => $netapp_storage_protocol;
218     "${volume_backend_name}/netapp_transport_type":        value => $netapp_transport_type;
219     "${volume_backend_name}/netapp_vfiler":                value => $netapp_vfiler;
220     "${volume_backend_name}/netapp_volume_list":           value => $netapp_volume_list;
221     "${volume_backend_name}/netapp_vserver":               value => $netapp_vserver;
222     "${volume_backend_name}/expiry_thres_minutes":         value => $expiry_thres_minutes;
223     "${volume_backend_name}/thres_avl_size_perc_start":    value => $thres_avl_size_perc_start;
224     "${volume_backend_name}/thres_avl_size_perc_stop":     value => $thres_avl_size_perc_stop;
225     "${volume_backend_name}/nfs_shares_config":            value => $nfs_shares_config;
226     "${volume_backend_name}/netapp_copyoffload_tool_path": value => $netapp_copyoffload_tool_path;
227     "${volume_backend_name}/netapp_controller_ips":        value => $netapp_controller_ips;
228     "${volume_backend_name}/netapp_sa_password":           value => $netapp_sa_password, secret => true;
229     "${volume_backend_name}/netapp_storage_pools":         value => $netapp_storage_pools;
230     "${volume_backend_name}/netapp_webservice_path":       value => $netapp_webservice_path;
231   }
232
233   if $netapp_storage_family == 'eseries' {
234     cinder_config {
235       "${volume_backend_name}/use_multipath_for_image_xfer": value => true;
236     }
237   }
238 }