From ab4d95ad102a81e7d9587e4c7a93607f53fda2a2 Mon Sep 17 00:00:00 2001 From: Ryan Hefner Date: Tue, 13 Jan 2015 16:29:03 -0500 Subject: [PATCH] Add support for new nfs_shares parameter A new nfs_shares parameter was added in puppet-cinder that allows a user to optionally specify an array of shares and that will be written into the file listed at nfs_shares_config. Change-Id: I2f697caed3804af21b793f6d6949bbe815983849 --- docs/packstack.rst | 6 +++++- packstack/plugins/cinder_250.py | 23 +++++++++++++++++---- packstack/puppet/templates/cinder_netapp.pp | 2 ++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/docs/packstack.rst b/docs/packstack.rst index cdf0dfda2..ba0f3e552 100644 --- a/docs/packstack.rst +++ b/docs/packstack.rst @@ -500,8 +500,12 @@ Cinder NetApp NFS configuration **CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_STOP** (optional) When the percentage of available space on an NFS share has reached the percentage specified by this parameter, the driver will stop clearing files from the NFS image cache that have not been accessed in the last M minutes, where M is the value of the expiry_thres_minutes parameter. Defaults to 60. [''] +**CONFIG_CINDER_NETAPP_NFS_SHARES** + (optional) Single or comma-separated list of NetApp NFS shares for Cinder to use. Format: ip-address:/export-name. Defaults to ''. [''] + **CONFIG_CINDER_NETAPP_NFS_SHARES_CONFIG** - (optional) File with the list of available NFS shares. Defaults to ''. [''] + (optional) File with the list of available NFS shares. Defaults to '/etc/cinder/shares.conf'. [''] + Cinder NetApp iSCSI & 7-mode configuration ------------------------------------------ diff --git a/packstack/plugins/cinder_250.py b/packstack/plugins/cinder_250.py index 0f0263c3e..294223c62 100644 --- a/packstack/plugins/cinder_250.py +++ b/packstack/plugins/cinder_250.py @@ -348,16 +348,31 @@ def initConfig(controller): "USE_DEFAULT": True, "NEED_CONFIRM": False, "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-nfs-shares-config", - "USAGE": ("(optional) File with the list of available NFS shares." + {"CMD_OPTION": "cinder-netapp-nfs-shares", + "USAGE": ("(optional) Single or comma-separated list of NetApp NFS shares " + "for Cinder to use. Format: ip-address:/export-name" " Defaults to ''."), - "PROMPT": ("Enter a NetApp NFS share config file"), + "PROMPT": ("Enter a single or comma-separated list of NetApp NFS shares"), "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_file], + "VALIDATORS": [], "PROCESSORS": [], "DEFAULT_VALUE": "", "MASK_INPUT": False, "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_NFS_SHARES", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-nfs-shares-config", + "USAGE": ("(optional) File with the list of available NFS shares." + " Defaults to '/etc/cinder/shares.conf'."), + "PROMPT": ("Enter a NetApp NFS share config file"), + "OPTION_LIST": [""], + "VALIDATORS": [], + "PROCESSORS": [], + "DEFAULT_VALUE": "/etc/cinder/shares.conf", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, "CONF_NAME": "CONFIG_CINDER_NETAPP_NFS_SHARES_CONFIG", "USE_DEFAULT": True, "NEED_CONFIRM": False, diff --git a/packstack/puppet/templates/cinder_netapp.pp b/packstack/puppet/templates/cinder_netapp.pp index 40fbea4de..5a40f8fb3 100644 --- a/packstack/puppet/templates/cinder_netapp.pp +++ b/packstack/puppet/templates/cinder_netapp.pp @@ -18,6 +18,7 @@ if $netapp_storage_family == 'ontap_cluster' { expiry_thres_minutes => hiera('CONFIG_CINDER_NETAPP_EXPIRY_THRES_MINUTES'), thres_avl_size_perc_start => hiera('CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_START'), thres_avl_size_perc_stop => hiera('CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_STOP'), + nfs_shares => hiera_array('CONFIG_CINDER_NETAPP_NFS_SHARES'), nfs_shares_config => hiera('CONFIG_CINDER_NETAPP_NFS_SHARES_CONFIG'), } @@ -52,6 +53,7 @@ elsif $netapp_storage_family == 'ontap_7mode' { expiry_thres_minutes => hiera('CONFIG_CINDER_NETAPP_EXPIRY_THRES_MINUTES'), thres_avl_size_perc_start => hiera('CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_START'), thres_avl_size_perc_stop => hiera('CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_STOP'), + nfs_shares => hiera_array('CONFIG_CINDER_NETAPP_NFS_SHARES'), nfs_shares_config => hiera('CONFIG_CINDER_NETAPP_NFS_SHARES_CONFIG'), }