This cookbook manages installations of the NetApp Docker Volume Plug-in (nDVP) including the creation of configuration files, plug-in installation and dependencies. The included resources also installs and configures NFS and iSCS services.
For full details on the NetApp Docker Volume Plugin visit the official documentation
Table of Contents generated with DocToc
- Requirements
- Attributes
- Custom Resource
- Usage
- Upload to Chef Server
- Matchers/Helpers
- Cookbook Testing
- Copyright:: 2017, Exosphere Data, LLC, All Rights Reserved.
- Debian
- Ubuntu, 14.04+ if not using iSCSI multipathing, 15.10+ with iSCSI multipathing.
- CentOS, 7.0+
- RHEL, 7.0+
- ONTAP: 8.3 or greater
- SolidFire: ElementOS 7 or greater
- E-Series: Santricity
- 12.5+
- docker, >= 2.15.6
- N/A
A list of available node attributes. Required attributes marked in bold. All other attributes can be excluded.
Attribute | Type | Description | Default |
---|---|---|---|
node['docker']['members'] |
String,Array | Adds users to the local docker group to provide access to docker commands without requiring sudo access. |
nil |
Attribute | Type | Description | Default |
---|---|---|---|
node['netapp_docker']['config']['ndvp_config'] |
String | Defines the configuration file name with .json extension for the Plugin installation and the name to which the plugin will be registered. |
'netapp' |
node['netapp_docker']['config']['config_type'] |
String | Determines the type of plug=in configuration. Supported values are 'ontap-nas' or 'ontap-san' | 'ontap-nas' |
node['netapp_docker']['config']['plugin_version'] |
String | Determines the specific version of the plugin to install. Defaults to "latest" | 'latest' |
Attribute | Type | Description | Default |
---|---|---|---|
node['netapp_docker']['config']['ontap_mgmt_ip'] |
String | IP or Hostname for the NetApp Storage Virtual Machine Manaegment (SVM) LIF | nil |
node['netapp_docker']['config']['ontap_data_ip'] |
String | IP or Hostname for the NetApp Storage Virtual Machine NFS or iSCSI LIF | nil |
node['netapp_docker']['config']['svm'] |
String | NetApp Storage Virtual Machine name | nil |
node['netapp_docker']['config']['aggregate'] |
String | Assigned NetApp Aggregate to use for provisioning. Requires that the aggregate be listed in the SVM aggr_list | nil |
node['netapp_docker']['config']['username'] |
String | Storage Virtual Machine username | nil |
node['netapp_docker']['config']['password'] |
String | Storage Virtual Machine user password | nil |
node['netapp_docker']['config']['prefix'] |
String | Sets the NetApp volume name prefix. Defaults to the plug-in name | nil |
Attribute | Type | Description | Default |
---|---|---|---|
node['netapp_docker']['config']['defaults']['size'] |
String | Sets the default volume size for each docker volume | nil |
node['netapp_docker']['config']['defaults']['space_reserve'] |
String | Space reservation mode; "none" (thin provisioned) or "volume" (thick) | nil |
node['netapp_docker']['config']['defaults']['snapshot_policy'] |
String | Snapshot policy to use, default is "none" | nil |
node['netapp_docker']['config']['defaults']['split_on_clone'] |
Boolean | Split a clone from its parent upon creation, defaults to "false" | nil |
Attribute | Type | Description | Default |
---|---|---|---|
node['netapp_docker']['config']['nfs_mount_options'] |
String | Fine grained control of NFS mount options; defaults to "-o nfsvers=3" | nil |
node['netapp_docker']['config']['defaults']['export'] |
String | NAS option for the NFS export policy to use, defaults to "default" | nil |
node['netapp_docker']['config']['defaults']['unix_permissions'] |
String | NAS option for provisioned NFS volumes, defaults to "777" | nil |
node['netapp_docker']['config']['defaults']['snapshot_dir'] |
String | NAS option for access to the .snapshot directory, defaults to "false" | nil |
node['netapp_docker']['config']['defaults']['security_style'] |
String | NAS option for access to the provisioned NFS volume, defaults to "unix" | nil |
Manages the configuration and installation of a NetApp Docker Volume Plugin configuration for a host.
default_action :config
Generates a configuration file based on supplied attributes
NOTE: properties in bold are required
These options will be set for every Docker Volume created by the plugin and are not tuneable
Property | Type | Description |
---|---|---|
config_name |
String | Name Attribute. Sets the Plugin installation name. Defaults to 'netapp' |
ndvp_config |
String | Sets the configuration file name with .json extension. All files will be created in the /etc/netappdvp/ directory. Defaults to 'config.json' |
config_type |
String | Determines the type of plug=in configuration. Supported values are 'ontap-nas' or 'ontap-san'. Default value is 'ontap-nas'. |
ontap_mgmt_ip |
String | IP or Hostname for the NetApp Storage Virtual Machine Manaegment (SVM) LIF |
ontap_data_ip |
String | IP or Hostname for the NetApp Storage Virtual Machine NFS or iSCSI LIF |
svm |
String | NetApp Storage Virtual Machine name |
username |
String | Assigned NetApp Aggregate to use for provisioning. Requires that the aggregate be listed in the SVM aggr_list |
password |
String | Storage Virtual Machine username |
aggregate |
String | Storage Virtual Machine user password |
prefix |
String, nil | Sets the NetApp volume name prefix. Defaults to the plug-in name |
nfs_mount_options |
String, nil | Fine grained control of NFS mount options; defaults to "-o nfsvers=3" |
If not configured, these settings will not be added to the configuration file and the plugin will use the version defaults
Property | Type | Description |
---|---|---|
default_size |
String, nil | Sets the default volume size for each docker volume |
default_space_reserve |
String, nil | Space reservation mode; "none" (thin provisioned) or "volume" (thick) |
default_snapshot_policy |
String, nil | Snapshot policy to use, default is "none" |
default_split_on_clone |
String, nil | Split a clone from its parent upon creation, defaults to "false" |
default_export |
String, nil | NAS option for the NFS export policy to use, defaults to "default" |
default_unix_permissions |
String, nil | NAS option for provisioned NFS volumes, defaults to "777" |
default_snapshot_dir |
TrueClass,FalseClass | NAS option for access to the .snapshot directory, defaults to "false" |
default_security_style |
String, nil | NAS option for access to the provisioned NFS volume, defaults to "unix" |
NetApp Docker Volume Plugin configuration using the ontap-nas plugin
netapp_docker_ontap_plugin 'netapp' do
ontap_mgmt_ip '192.168.100.184'
ontap_data_ip '192.168.100.185' # nfs lif
svm 'svm_docker'
username 'vsadmin'
password 'netapp123'
aggregate 'aggr1'
action :config
end
NetApp Docker Volume Plugin configuration using the ontap-san plugin with a default size of 100g for each new volume
netapp_docker_ontap_plugin 'netapp' do
ontap_mgmt_ip '192.168.100.184'
ontap_data_ip '192.168.100.186' # iscsi lif
svm 'svm_docker'
username 'vsadmin'
password 'netapp123'
aggregate 'aggr1'
default_size '100g'
action :config
end
Downloads and installs the specified NetApp Docker Volume Plugin (nDVP) based on the suppied configuration file. Installs prerequisites for the nDVP configuration.
NOTE: This action requires that the configuration file supplied exist on the local node's file system in the /etc/netappdvp/ directory
NOTE: When installing, the cookbook will determine the config_type
. If 'ontap-nas', then the solution will verify and install NFS client services on the host. If 'ontap-san', then the solution will veriify and install iSCSI and Multi-path services on the host. More details about what is added can be found here: official documentation
NOTE: properties in bold are required
These options will be set for every Docker Volume created by the plugin and are not tuneable
Property | Type | Description |
---|---|---|
config_name |
String | Name Attribute. Sets the Plugin installation name. Defaults to 'netapp' |
ndvp_config |
String | Sets the configuration file name with .json extension. All files will be created in the /etc/netappdvp/ directory. Defaults to 'config.json' |
config_type |
String | Determines the type of plug=in configuration. Supported values are 'ontap-nas' or 'ontap-san'. Default value is 'ontap-nas'. |
plugin_version |
String | Determines the version of the plugin to download and install. Default is "latest" |
installation and configuration of NetApp Docker Volume Plugin using the ontap-nas plugin
netapp_docker_ontap_plugin 'netapp' do
ontap_mgmt_ip '192.168.100.184'
ontap_data_ip '192.168.100.185' # nfs lif
svm 'svm_docker'
username 'vsadmin'
password 'netapp123'
aggregate 'aggr1'
action [:config, :install]
end
installation and configuration of NetApp Docker Volume Plugin using the ontap-nas plugin
netapp_docker_ontap_plugin 'netapp' do
action :install
end
installs the specified version of NetApp Docker Volume Plugin as a custom name
netapp_docker_ontap_plugin 'mynetapp01' do
ndvp_config 'mynetapp01_ndvp.json'
plugin_version 'v17.04.0'
action [:config, :install]
end
Enables a registered and installed NetApp Docker Volume Plugin instance
Note: The action :install will automatically enable the newly installed plugin. It will also ensure that on each run, that the plugin is installed and enabled
NOTE: properties in bold are required
These options will be set for every Docker Volume created by the plugin and are not tuneable
Property | Type | Description |
---|---|---|
config_name |
String | Name Attribute. Sets the Plugin installation name. Defaults to 'netapp' |
netapp_docker_ontap_plugin 'netapp' do
action [:enable]
end
Disables a registered and installed NetApp Docker Volume Plugin instance
Note: The plugin can only be disabled if not in use.
NOTE: properties in bold are required
These options will be set for every Docker Volume created by the plugin and are not tuneable
Property | Type | Description |
---|---|---|
config_name |
String | Name Attribute. Sets the Plugin installation name. Defaults to 'netapp' |
netapp_docker_ontap_plugin 'netapp' do
action [:disable]
end
Disable and delete an existing installation of NetApp Docker Volume Plugin.
Note: This action will be implemented in a future release
Note: This action will be implemented in a future release
Note: This action will be implemented in a future release
This is an empty recipe and should not be used
This recipe will create a new configuration for the NetApp Docker Volume Plug-in and install the plugin into a docker configuration. If docker has not been installed, the recipe will perform the installation automatically. All pre-requisite features and services for NFS and iSCSI will be installed depending on the config_type
selected - 'ontap-nas' or 'ontap-san'
This cookbook should be included in each organization of your CHEF environment. When importing, leverage Berkshelf:
berks upload
NOTE: use the --no-ssl-verify switch if the CHEF server in question has a self-signed SSL certificate.
NOTE: the --except test
switch will prevent Berkshelf from uploading the included test cookbook
berks upload --no-ssl-verify --except test
Note: Matchers should always be created in libraries/matchers.rb
and used for validating calls to LWRP
- install_netapp_docker_ontap_plugin(resource_name)
- config_netapp_docker_ontap_plugin(resource_name)
There are no included helpers at this time
Setup your testing and ensure all dependencies are installed. Open a terminal windows and execute:
gem install bundler
bundle install
berks install
This cookbook requires the use of a data_bag for setting certain values. Local JSON version need to be stored in the directory structure as indicated below:
├── chef-repo/
│ ├── cookbooks
│ │ ├── netapp_docker
│ │ │ ├── .kitchen.yml
│ ├── data_bags
│ │ ├── data_bag_name
│ │ │ ├── data_bag_item.json
Note: Storing local testing versions of the data_bags at the root of your repo is considered best practice. This ensures that you only need to maintain a single copy while protecting the cookbook from being accientally committed with the data_bag. However, if you must change this location, then update the following key in the .kitchen.yml file.
data_bags_path: "../../data_bags/"
This repo includes a Rakefile for common tasks
Task Command | Description |
---|---|
rake | Run Style, Foodcritic, Maintainers, and Unit Tests |
rake style | Run all style checks |
rake style:chef | Run Chef style checks |
rake style:ruby | Run Ruby style checks |
rake style:ruby:auto_correct | Auto-correct RuboCop offenses |
rake unit | Run ChefSpec examples |
rake integration | Run all kitchen suites |
rake integration:kitchen:demo-centos-72 | Run demo-centos-72 test instance |
rake integration:kitchen:demo-ubuntu-1604 | Run demo-ubuntu-1604 test instance |
rake maintainers:generate | Generate MarkDown version of MAINTAINERS file |
NOTE: Execution of Test-Kitchen requires that you first make a copy of .kitchen.yml and save in the root of the repo as .kitchen.local.yml. Within this file, you will need to edit the attributes to match your actual environment. The installation and configuration of NetApp Docker Volume Plugin will fail if the system is unable to log into a valid storage controller.
-
bundle install
: Installs and pulls all ruby gems dependencies from the Gemfile. -
berks install
: Installs all cookbook dependencies based on the Berksfile and the metadata.rb -
rake
: This will run all of the local tests - syntax, lint, unit, and maintainers file. -
rake integration
: This will run all of the kitchen tests
a test cookbook for the available LWRPs
For the purposes of testing and validating this code, we have included a test cookbook with pre-configured recipes. The LWRP unit tests leverage these recipes to verify configuration.
Name | Description |
---|---|
Default | Roll-up recipe to test all of the functionality of the LWRP-specific recipes |
ontap_nas | Test the ontap_plugin provider for ontap-nas configurations. |
ontap_san | Test the ontap_plugin provider for ontap-san configurations. |
Attribute | Type | Description | Default |
---|---|---|---|
node['netapp_docker_test']['config']['netapp']['ontap_mgmt_ip'] |
String | IP or Hostname for the NetApp Storage Virtual Machine Manaegment (SVM) LIF | nil |
node['netapp_docker_test']['config']['netapp']['ontap_data_ip'] |
String | IP or Hostname for the NetApp Storage Virtual Machine NFS or iSCSI LIF | nil |
node['netapp_docker_test']['config']['netapp']['svm'] |
String | NetApp Storage Virtual Machine name | nil |
node['netapp_docker_test']['config']['netapp']['username'] |
String | Assigned NetApp Aggregate to use for provisioning. Requires that the aggregate be listed in the SVM aggr_list | nil |
node['netapp_docker_test']['config']['netapp']['password'] |
String | Storage Virtual Machine username | nil |
node['netapp_docker_test']['config']['netapp']['aggregate'] |
String | Storage Virtual Machine user password | nil |
node['netapp_docker_test']['config']['netapp']['prefix'] |
String | Sets the NetApp volume name prefix. Defaults to the plug-in name | nil |
Attribute | Type | Description | Default |
---|---|---|---|
node['netapp_docker_test']['config']['ontap_iscsi']['ontap_mgmt_ip'] |
String | IP or Hostname for the NetApp Storage Virtual Machine Manaegment (SVM) LIF | nil |
node['netapp_docker_test']['config']['ontap_iscsi']['ontap_data_ip'] |
String | IP or Hostname for the NetApp Storage Virtual Machine NFS or iSCSI LIF | nil |
node['netapp_docker_test']['config']['ontap_iscsi']['svm'] |
String | NetApp Storage Virtual Machine name | nil |
node['netapp_docker_test']['config']['ontap_iscsi']['username'] |
String | Assigned NetApp Aggregate to use for provisioning. Requires that the aggregate be listed in the SVM aggr_list | nil |
node['netapp_docker_test']['config']['ontap_iscsi']['password'] |
String | Storage Virtual Machine username | nil |
node['netapp_docker_test']['config']['ontap_iscsi']['aggregate'] |
String | Storage Virtual Machine user password | nil |
node['netapp_docker_test']['config']['ontap_iscsi']['prefix'] |
String | Sets the NetApp volume name prefix. Defaults to the plug-in name | nil |
Included in this cookbook is a set of Inspec profile tests used for supported platforms in Test-Kitchen when run against the Test Cookbook. The Control files are located at test/smoke/suite_name
Author: Jeremy Goodrum ([email protected])
Copyright: 2017 Exosphere Data, LLC
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.