From 770d5da9317b6997bdab3b396b513a502df9aa9c Mon Sep 17 00:00:00 2001 From: Lukas Bezdicka Date: Wed, 3 Sep 2014 09:39:35 -0400 Subject: [PATCH] Refactor cinder plugin and extend it with multiple backends support Closes-Bug: rhbz#1139246 Change-Id: I9803939d45e9bafea9b21274a4c64248a037cd33 --- docs/packstack.rst | 3 +- packstack/plugins/cinder_250.py | 1311 ++++++++--------- packstack/plugins/nova_300.py | 4 +- packstack/puppet/templates/cinder.pp | 26 +- packstack/puppet/templates/cinder_backup.pp | 6 +- packstack/puppet/templates/cinder_gluster.pp | 13 +- packstack/puppet/templates/cinder_lvm.pp | 80 +- .../templates/cinder_netapp_7mode_iscsi.pp | 15 +- .../templates/cinder_netapp_7mode_nfs.pp | 15 +- .../templates/cinder_netapp_cdot_iscsi.pp | 15 +- .../templates/cinder_netapp_cdot_nfs.pp | 15 +- .../puppet/templates/cinder_netapp_eseries.pp | 15 +- packstack/puppet/templates/cinder_nfs.pp | 13 +- packstack/puppet/templates/cinder_vmdk.pp | 8 +- 14 files changed, 786 insertions(+), 753 deletions(-) diff --git a/docs/packstack.rst b/docs/packstack.rst index 715c6d8e7..c3a23cec2 100644 --- a/docs/packstack.rst +++ b/docs/packstack.rst @@ -163,8 +163,7 @@ Cinder Config parameters The password to use for the Cinder to authenticate with Keystone. **CONFIG_CINDER_BACKEND** - The Cinder backend to use ['lvm', 'gluster', 'nfs', 'vmdk', 'netapp']. - + A comma separated ordered list of the Cinder backends to use, valid options are: lvm, gluster, nfs, vmdk. Cinder volume create Config parameters -------------------------------------- diff --git a/packstack/plugins/cinder_250.py b/packstack/plugins/cinder_250.py index 3bf87de3d..fb31bdcc0 100644 --- a/packstack/plugins/cinder_250.py +++ b/packstack/plugins/cinder_250.py @@ -36,612 +36,564 @@ NETAPP_DEFAULT_STORAGE_PROTOCOL = "nfs" def initConfig(controller): - params = [ - {"CMD_OPTION": "cinder-db-passwd", - "USAGE": "The password to use for the Cinder to access DB", - "PROMPT": "Enter the password for the Cinder DB access", - "OPTION_LIST": [], - "VALIDATORS": [validators.validate_not_empty], - "DEFAULT_VALUE": uuid.uuid4().hex[:16], - "MASK_INPUT": True, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_DB_PW", - "USE_DEFAULT": True, - "NEED_CONFIRM": True, - "CONDITION": False}, + conf_params = { + "CINDER": [ + {"CMD_OPTION": "cinder-db-passwd", + "USAGE": "The password to use for the Cinder to access DB", + "PROMPT": "Enter the password for the Cinder DB access", + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": uuid.uuid4().hex[:16], + "MASK_INPUT": True, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_DB_PW", + "USE_DEFAULT": True, + "NEED_CONFIRM": True, + "CONDITION": False}, - {"CMD_OPTION": "cinder-ks-passwd", - "USAGE": ("The password to use for the Cinder to authenticate with " - "Keystone"), - "PROMPT": "Enter the password for the Cinder Keystone access", - "OPTION_LIST": [], - "VALIDATORS": [validators.validate_not_empty], - "DEFAULT_VALUE": uuid.uuid4().hex[:16], - "MASK_INPUT": True, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_KS_PW", - "USE_DEFAULT": True, - "NEED_CONFIRM": True, - "CONDITION": False}, + {"CMD_OPTION": "cinder-ks-passwd", + "USAGE": ("The password to use for the Cinder to authenticate " + "with Keystone"), + "PROMPT": "Enter the password for the Cinder Keystone access", + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": uuid.uuid4().hex[:16], + "MASK_INPUT": True, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_KS_PW", + "USE_DEFAULT": True, + "NEED_CONFIRM": True, + "CONDITION": False}, - {"CMD_OPTION": "cinder-backend", - "USAGE": ("The Cinder backend to use, valid options are: lvm, " - "gluster, nfs, netapp"), - "PROMPT": "Enter the Cinder backend to be configured", - "OPTION_LIST": ["lvm", "gluster", "nfs", "vmdk", "netapp"], - "VALIDATORS": [validators.validate_options], - "DEFAULT_VALUE": "lvm", - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_BACKEND", - "USE_DEFAULT": False, - "NEED_CONFIRM": False, - "CONDITION": False}, + {"CMD_OPTION": "cinder-backend", + "USAGE": ("The Cinder backend to use, valid options are: lvm, " + "gluster, nfs, netapp"), + "PROMPT": "Enter the Cinder backend to be configured", + "OPTION_LIST": ["lvm", "gluster", "nfs", "vmdk", "netapp"], + "VALIDATORS": [validators.validate_options], + "DEFAULT_VALUE": "lvm", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_BACKEND", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "CINDERVOLUMECREATE": [ + {"CMD_OPTION": "cinder-volumes-create", + "USAGE": ("Create Cinder's volumes group. This should only be " + "done for testing on a proof-of-concept installation " + "of Cinder. This will create a file-backed volume group" + " and is not suitable for production usage."), + "PROMPT": ("Should Cinder's volumes group be created (for " + "proof-of-concept installation)?"), + "OPTION_LIST": ["y", "n"], + "VALIDATORS": [validators.validate_options], + "DEFAULT_VALUE": "y", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_VOLUMES_CREATE", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "CINDERVOLUMESIZE": [ + {"CMD_OPTION": "cinder-volumes-size", + "USAGE": ("Cinder's volumes group size. Note that actual volume " + "size will be extended with 3% more space for VG " + "metadata."), + "PROMPT": "Enter Cinder's volumes group usable size", + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "20G", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_VOLUMES_SIZE", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "CINDERGLUSTERMOUNTS": [ + {"CMD_OPTION": "cinder-gluster-mounts", + "USAGE": ("A single or comma separated list of gluster volume " + "shares to mount, eg: ip-address:/vol-name, " + "domain:/vol-name "), + "PROMPT": ("Enter a single or comma separated list of gluster " + "volume shares to use with Cinder"), + "OPTION_LIST": ["^'([\d]{1,3}\.){3}[\d]{1,3}:/.*'", + "^'[a-zA-Z0-9][\-\.\w]*:/.*'"], + "VALIDATORS": [validators.validate_multi_regexp], + "PROCESSORS": [processors.process_add_quotes_around_values], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": True, + "CONF_NAME": "CONFIG_CINDER_GLUSTER_MOUNTS", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "CINDERNFSMOUNTS": [ + {"CMD_OPTION": "cinder-nfs-mounts", + "USAGE": ("A single or comma seprated list of NFS exports to " + "mount, eg: ip-address:/export-name "), + "PROMPT": ("Enter a single or comma seprated list of NFS exports " + "to use with Cinder"), + "OPTION_LIST": ["^'([\d]{1,3}\.){3}[\d]{1,3}:/.*'"], + "VALIDATORS": [validators.validate_multi_regexp], + "PROCESSORS": [processors.process_add_quotes_around_values], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": True, + "CONF_NAME": "CONFIG_CINDER_NFS_MOUNTS", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "CINDERNETAPPMAIN": [ + {"CMD_OPTION": "cinder-netapp-login", + "USAGE": ("(required) Administrative user account name used to " + "access the storage system or proxy server. "), + "PROMPT": ("Enter a NetApp login"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_not_empty], + "PROCESSORS": [], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_LOGIN", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-password", + "USAGE": ("(required) Password for the administrative user " + "account specified in the netapp_login parameter."), + "PROMPT": ("Enter a NetApp password"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_not_empty], + "PROCESSORS": [], + "DEFAULT_VALUE": "", + "MASK_INPUT": True, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_PASSWORD", + "USE_DEFAULT": False, + "NEED_CONFIRM": True, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-hostname", + "USAGE": ("(required) The hostname (or IP address) for the " + "storage system or proxy server."), + "PROMPT": ("Enter a NetApp hostname"), + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "PROCESSORS": [processors.process_add_quotes_around_values], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_HOSTNAME", + "USE_DEFAULT": False, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-server-port", + "USAGE": ("(optional) The TCP port to use for communication with " + "ONTAPI on the storage system. Traditionally, port 80 " + "is used for HTTP and port 443 is used for HTTPS; " + "however, this value should be changed if an alternate " + "port has been configured on the storage system or " + "proxy server. Defaults to 80."), + "PROMPT": ("Enter a NetApp server port"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_port], + "PROCESSORS": [], + "DEFAULT_VALUE": 80, + "MASK_INPUT": False, + "LOOSE_VALIDATION": True, + "CONF_NAME": "CONFIG_CINDER_NETAPP_SERVER_PORT", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-storage-family", + "USAGE": ("(optional) The storage family type used on the storage" + " system; valid values are ontap_7mode for using Data " + "ONTAP operating in 7-Mode or ontap_cluster for using " + "clustered Data ONTAP, or eseries for NetApp E-Series. " + "Defaults to %s." % NETAPP_DEFAULT_STORAGE_FAMILY), + "PROMPT": ("Enter a NetApp storage family"), + "OPTION_LIST": ["ontap_7mode", "ontap_cluster", "eseries"], + "VALIDATORS": [validators.validate_options], + "PROCESSORS": [], + "DEFAULT_VALUE": NETAPP_DEFAULT_STORAGE_FAMILY, + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_STORAGE_FAMILY", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-transport-type", + "USAGE": ("(optional) The transport protocol used when " + "communicating with ONTAPI on the storage system or " + "proxy server. Valid values are http or https. " + "Defaults to http."), + "PROMPT": ("Enter a NetApp transport type"), + "OPTION_LIST": ["http", "https"], + "VALIDATORS": [validators.validate_options], + "PROCESSORS": [], + "DEFAULT_VALUE": "http", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_TRANSPORT_TYPE", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-storage-protocol", + "USAGE": ("(optional) The storage protocol to be used on the data" + " path with the storage system; valid values are iscsi " + "or nfs. " + "Defaults to %s." % NETAPP_DEFAULT_STORAGE_PROTOCOL), + "PROMPT": ("Enter a NetApp storage protocol"), + "OPTION_LIST": ["iscsi", "nfs"], + "VALIDATORS": [validators.validate_options], + "PROCESSORS": [], + "DEFAULT_VALUE": NETAPP_DEFAULT_STORAGE_PROTOCOL, + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "CINDERNETAPPONTAPISCSI": [ + {"CMD_OPTION": "cinder-netapp-size-multiplier", + "USAGE": ("(optional) The quantity to be multiplied by the " + "requested volume size to ensure enough space is " + "available on the virtual storage server (Vserver)" + " to fulfill the volume creation request. " + "Defaults to 1.0."), + "PROMPT": ("Enter a NetApp size multiplier"), + "OPTION_LIST": [""], + "VALIDATORS": [], + "PROCESSORS": [], + "DEFAULT_VALUE": "1.0", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_SIZE_MULTIPLIER", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "CINDERNETAPPNFS": [ + {"CMD_OPTION": "cinder-netapp-expiry-thres-minutes", + "USAGE": ("(optional) This parameter specifies the threshold for " + "last access time for images in the NFS image cache. " + "When a cache cleaning cycle begins, images in the " + "cache that have not been accessed in the last M " + "minutes, where M is the value of this parameter, will " + "be deleted from the cache to create free space on the " + "NFS share. Defaults to 720."), + "PROMPT": ("Enter a threshold"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_integer], + "PROCESSORS": [], + "DEFAULT_VALUE": 720, + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_EXPIRY_THRES_MINUTES", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-thres-avl-size-perc-start", + "USAGE": ("(optional) If the percentage of available space for an" + " NFS share has dropped below the value specified by " + "this parameter, the NFS image cache will be cleaned. " + "Defaults to 20"), + "PROMPT": ("Enter a value"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_integer], + "PROCESSORS": [], + "DEFAULT_VALUE": 20, + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_START", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-thres-avl-size-perc-stop", + "USAGE": ("(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."), + "PROMPT": ("Enter a value"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_integer], + "PROCESSORS": [], + "DEFAULT_VALUE": 60, + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_STOP", + "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 ''."), + "PROMPT": ("Enter a NetApp NFS share config file"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_file], + "PROCESSORS": [], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_NFS_SHARES_CONFIG", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "CINDERNETAPPISCSI7MODE": [ + {"CMD_OPTION": "cinder-netapp-volume-list", + "USAGE": ("(optional) This parameter is only utilized when the " + "storage protocol is configured to use iSCSI. This " + "parameter is used to restrict provisioning to the " + "specified controller volumes. Specify the value of " + "this parameter to be a comma separated list of NetApp " + "controller volume names to be used for provisioning. " + "Defaults to ''."), + "PROMPT": ("Enter a NetApp volume list"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_not_empty], + "PROCESSORS": [], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": True, + "CONF_NAME": "CONFIG_CINDER_NETAPP_VOLUME_LIST", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-vfiler", + "USAGE": ("(optional) The vFiler unit on which provisioning of " + "block storage volumes will be done. This parameter is " + "only used by the driver when connecting to an instance" + " with a storage family of Data ONTAP operating in " + "7-Mode and the storage protocol selected is iSCSI. " + "Only use this parameter when utilizing the MultiStore " + "feature on the NetApp storage system. " + "Defaults to ''."), + "PROMPT": ("Enter a NetApp vFiler"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_not_empty], + "PROCESSORS": [], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": True, + "CONF_NAME": "CONFIG_CINDER_NETAPP_VFILER", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "CINDERNETAPPVSERVER": [ + {"CMD_OPTION": "cinder-netapp-vserver", + "USAGE": ("(optional) This parameter specifies the virtual " + "storage server (Vserver) name on the storage cluster " + "on which provisioning of block storage volumes should " + "occur. If using the NFS storage protocol, this " + "parameter is mandatory for storage service catalog " + "support (utilized by Cinder volume type extra_specs " + "support). If this parameter is specified, the exports " + "belonging to the Vserver will only be used for " + "provisioning in the future. Block storage volumes on " + "exports not belonging to the Vserver specified by this" + " parameter will " + "continue to function normally. " + "Defaults to ''."), + "PROMPT": ("Enter a NetApp Vserver"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_not_empty], + "PROCESSORS": [], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_VSERVER", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + ], + + "CINDERNETAPPESERIES": [ + {"CMD_OPTION": "cinder-netapp-controller-ips", + "USAGE": ("(optional) This option is only utilized when the " + "storage family is configured to eseries. This option " + "is used to restrict provisioning to the specified " + "controllers. Specify the value of this option to be a " + "comma separated list of controller hostnames or IP " + "addresses to be used for provisioning. " + "Defaults to ''."), + "PROMPT": ("Enter a value"), + "OPTION_LIST": [""], + "VALIDATORS": [validators.validate_multi_ping], + "PROCESSORS": [], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_CONTROLLER_IPS", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-sa-password", + "USAGE": ("(optional) Password for the NetApp E-Series storage " + "array. " + "Defaults to ''."), + "PROMPT": ("Enter a password"), + "OPTION_LIST": [""], + "VALIDATORS": [], + "PROCESSORS": [], + "DEFAULT_VALUE": "", + "MASK_INPUT": True, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_CINDER_NETAPP_SA_PASSWORD", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-webservice-path", + "USAGE": ("(optional) This option is used to specify the path to " + "the E-Series proxy application on a proxy server. The " + "value is combined with the value of the " + "netapp_transport_type, netapp_server_hostname, and " + "netapp_server_port options to create the URL used by " + "the driver to connect to the proxy application. " + "Defaults to '/devmgr/v2'."), + "PROMPT": ("Enter a path"), + "OPTION_LIST": ["^[/].*$"], + "VALIDATORS": [validators.validate_regexp], + "PROCESSORS": [], + "DEFAULT_VALUE": "/devmgr/v2", + "MASK_INPUT": False, + "LOOSE_VALIDATION": True, + "CONF_NAME": "CONFIG_CINDER_NETAPP_WEBSERVICE_PATH", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "cinder-netapp-storage-pools", + "USAGE": ("(optional) This option is used to restrict " + "provisioning to the specified storage pools. Only " + "dynamic disk pools are currently supported. Specify " + "the value of this option to be a comma separated list " + "of disk pool names to be used for provisioning. " + "Defaults to ''."), + "PROMPT": ("Enter a value"), + "OPTION_LIST": [""], + "VALIDATORS": [], + "PROCESSORS": [], + "DEFAULT_VALUE": "", + "MASK_INPUT": False, + "LOOSE_VALIDATION": True, + "CONF_NAME": "CONFIG_CINDER_NETAPP_STORAGE_POOLS", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + ] + } + + conf_groups = [ + {"GROUP_NAME": "CINDER", + "DESCRIPTION": "Cinder Config parameters", + "PRE_CONDITION": "CONFIG_CINDER_INSTALL", + "PRE_CONDITION_MATCH": "y", + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "CINDERVOLUMECREATE", + "DESCRIPTION": "Cinder volume create Config parameters", + "PRE_CONDITION": check_lvm_options, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "CINDERVOLUMESIZE", + "DESCRIPTION": "Cinder volume size Config parameters", + "PRE_CONDITION": check_lvm_vg_options, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "CINDERGLUSTERMOUNTS", + "DESCRIPTION": "Cinder gluster Config parameters", + "PRE_CONDITION": check_gluster_options, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "CINDERNFSMOUNTS", + "DESCRIPTION": "Cinder NFS Config parameters", + "PRE_CONDITION": check_nfs_options, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "CINDERNETAPPMAIN", + "DESCRIPTION": "Cinder NetApp main configuration", + "PRE_CONDITION": check_netapp_options, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "CINDERNETAPPONTAPISCSI", + "DESCRIPTION": "Cinder NetApp ONTAP-iSCSI configuration", + "PRE_CONDITION": check_netapp_ontap_iscsi_options, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "CINDERNETAPPNFS", + "DESCRIPTION": "Cinder NetApp NFS configuration", + "PRE_CONDITION": check_netapp_nfs_settings, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "CINDERNETAPPISCSI7MODE", + "DESCRIPTION": "Cinder NetApp iSCSI & 7-mode configuration", + "PRE_CONDITION": check_netapp_7modeiscsi_options, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "CINDERNETAPPVSERVER", + "DESCRIPTION": "Cinder NetApp vServer configuration", + "PRE_CONDITION": check_netapp_vserver_options, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, + + {"GROUP_NAME": "CINDERNETAPPESERIES", + "DESCRIPTION": "Cinder NetApp E-Series configuration", + "PRE_CONDITION": check_netapp_eseries_options, + "PRE_CONDITION_MATCH": True, + "POST_CONDITION": False, + "POST_CONDITION_MATCH": True}, ] - group = {"GROUP_NAME": "CINDER", - "DESCRIPTION": "Cinder Config parameters", - "PRE_CONDITION": "CONFIG_CINDER_INSTALL", - "PRE_CONDITION_MATCH": "y", - "POST_CONDITION": False, - "POST_CONDITION_MATCH": True} - controller.addGroup(group, params) - - def check_lvm_options(config): - return (config.get('CONFIG_CINDER_INSTALL', 'n') == 'y' and - config.get('CONFIG_CINDER_BACKEND', 'lvm') == 'lvm') - - params = [ - {"CMD_OPTION": "cinder-volumes-create", - "USAGE": ("Create Cinder's volumes group. This should only be done " - "for testing on a proof-of-concept installation of Cinder. " - "This will create a file-backed volume group and is not " - "suitable for production usage."), - "PROMPT": ("Should Cinder's volumes group be created (for " - "proof-of-concept installation)?"), - "OPTION_LIST": ["y", "n"], - "VALIDATORS": [validators.validate_options], - "DEFAULT_VALUE": "y", - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_VOLUMES_CREATE", - "USE_DEFAULT": False, - "NEED_CONFIRM": False, - "CONDITION": False}, - ] - group = {"GROUP_NAME": "CINDERVOLUMECREATE", - "DESCRIPTION": "Cinder volume create Config parameters", - "PRE_CONDITION": check_lvm_options, - "PRE_CONDITION_MATCH": True, - "POST_CONDITION": False, - "POST_CONDITION_MATCH": True} - controller.addGroup(group, params) - - def check_lvm_vg_options(config): - return (config.get('CONFIG_CINDER_INSTALL', 'n') == 'y' and - config.get('CONFIG_CINDER_BACKEND', 'lvm') == 'lvm' and - config.get('CONFIG_CINDER_VOLUMES_CREATE', 'y') == 'y') - - params = [ - {"CMD_OPTION": "cinder-volumes-size", - "USAGE": ("Cinder's volumes group size. Note that actual volume size " - "will be extended with 3% more space for VG metadata."), - "PROMPT": "Enter Cinder's volumes group usable size", - "OPTION_LIST": [], - "VALIDATORS": [validators.validate_not_empty], - "DEFAULT_VALUE": "20G", - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_VOLUMES_SIZE", - "USE_DEFAULT": False, - "NEED_CONFIRM": False, - "CONDITION": False}, - ] - group = {"GROUP_NAME": "CINDERVOLUMESIZE", - "DESCRIPTION": "Cinder volume size Config parameters", - "PRE_CONDITION": check_lvm_vg_options, - "PRE_CONDITION_MATCH": True, - "POST_CONDITION": False, - "POST_CONDITION_MATCH": True} - controller.addGroup(group, params) - - def check_gluster_options(config): - return (config.get('CONFIG_CINDER_INSTALL', 'n') == 'y' and - config.get('CONFIG_CINDER_BACKEND', 'lvm') == 'gluster') - - params = [ - {"CMD_OPTION": "cinder-gluster-mounts", - "USAGE": ("A single or comma separated list of gluster volume shares " - "to mount, eg: ip-address:/vol-name, domain:/vol-name "), - "PROMPT": ("Enter a single or comma separated list of gluster volume " - "shares to use with Cinder"), - "OPTION_LIST": ["^'([\d]{1,3}\.){3}[\d]{1,3}:/.*'", - "^'[a-zA-Z0-9][\-\.\w]*:/.*'"], - "VALIDATORS": [validators.validate_multi_regexp], - "PROCESSORS": [processors.process_add_quotes_around_values], - "DEFAULT_VALUE": "", - "MASK_INPUT": False, - "LOOSE_VALIDATION": True, - "CONF_NAME": "CONFIG_CINDER_GLUSTER_MOUNTS", - "USE_DEFAULT": False, - "NEED_CONFIRM": False, - "CONDITION": False}, - ] - group = {"GROUP_NAME": "CINDERGLUSTERMOUNTS", - "DESCRIPTION": "Cinder gluster Config parameters", - "PRE_CONDITION": check_gluster_options, - "PRE_CONDITION_MATCH": True, - "POST_CONDITION": False, - "POST_CONDITION_MATCH": True} - controller.addGroup(group, params) - - def check_nfs_options(config): - return (config.get('CONFIG_CINDER_INSTALL', 'n') == 'y' and - config.get('CONFIG_CINDER_BACKEND', 'lvm') == 'nfs') - - params = [ - {"CMD_OPTION": "cinder-nfs-mounts", - "USAGE": ("A single or comma seprated list of NFS exports to mount, " - "eg: ip-address:/export-name "), - "PROMPT": ("Enter a single or comma seprated list of NFS exports to " - "use with Cinder"), - "OPTION_LIST": ["^'([\d]{1,3}\.){3}[\d]{1,3}:/.*'"], - "VALIDATORS": [validators.validate_multi_regexp], - "PROCESSORS": [processors.process_add_quotes_around_values], - "DEFAULT_VALUE": "", - "MASK_INPUT": False, - "LOOSE_VALIDATION": True, - "CONF_NAME": "CONFIG_CINDER_NFS_MOUNTS", - "USE_DEFAULT": False, - "NEED_CONFIRM": False, - "CONDITION": False}, - ] - group = {"GROUP_NAME": "CINDERNFSMOUNTS", - "DESCRIPTION": "Cinder NFS Config parameters", - "PRE_CONDITION": check_nfs_options, - "PRE_CONDITION_MATCH": True, - "POST_CONDITION": False, - "POST_CONDITION_MATCH": True} - controller.addGroup(group, params) - - def check_netapp_options(config): - return (config.get('CONFIG_CINDER_INSTALL', 'n') == 'y' and - config.get('CONFIG_CINDER_BACKEND', 'lvm') == 'netapp') - - params = [ - {"CMD_OPTION": "cinder-netapp-login", - "USAGE": ("(required) Administrative user account name used to " - "access the storage system or proxy server. "), - "PROMPT": ("Enter a NetApp login"), - "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_not_empty], - "PROCESSORS": [], - "DEFAULT_VALUE": "", - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_LOGIN", - "USE_DEFAULT": False, - "NEED_CONFIRM": False, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-password", - "USAGE": ("(required) Password for the administrative user account " - "specified in the netapp_login parameter."), - "PROMPT": ("Enter a NetApp password"), - "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_not_empty], - "PROCESSORS": [], - "DEFAULT_VALUE": "", - "MASK_INPUT": True, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_PASSWORD", - "USE_DEFAULT": False, - "NEED_CONFIRM": True, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-hostname", - "USAGE": ("(required) The hostname (or IP address) for the storage " - "system or proxy server."), - "PROMPT": ("Enter a NetApp hostname"), - "OPTION_LIST": [], - "VALIDATORS": [validators.validate_not_empty], - "PROCESSORS": [processors.process_add_quotes_around_values], - "DEFAULT_VALUE": "", - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_HOSTNAME", - "USE_DEFAULT": False, - "NEED_CONFIRM": False, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-server-port", - "USAGE": ("(optional) The TCP port to use for communication with " - "ONTAPI on the storage system. Traditionally, port 80 is " - "used for HTTP and port 443 is used for HTTPS; however, " - "this value should be changed if an alternate port has " - "been configured on the storage system or proxy server. " - "Defaults to 80."), - "PROMPT": ("Enter a NetApp server port"), - "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_port], - "PROCESSORS": [], - "DEFAULT_VALUE": 80, - "MASK_INPUT": False, - "LOOSE_VALIDATION": True, - "CONF_NAME": "CONFIG_CINDER_NETAPP_SERVER_PORT", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-storage-family", - "USAGE": ("(optional) The storage family type used on the storage " - "system; valid values are ontap_7mode for using Data ONTAP " - "operating in 7-Mode or ontap_cluster for using clustered " - "Data ONTAP, or eseries for NetApp E-Series. " - "Defaults to %s." % NETAPP_DEFAULT_STORAGE_FAMILY), - "PROMPT": ("Enter a NetApp storage family"), - "OPTION_LIST": ["ontap_7mode", "ontap_cluster", "eseries"], - "VALIDATORS": [validators.validate_options], - "PROCESSORS": [], - "DEFAULT_VALUE": NETAPP_DEFAULT_STORAGE_FAMILY, - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_STORAGE_FAMILY", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-transport-type", - "USAGE": ("(optional) The transport protocol used when communicating " - "with ONTAPI on the storage system or proxy server. Valid " - "values are http or https. " - "Defaults to http."), - "PROMPT": ("Enter a NetApp transport type"), - "OPTION_LIST": ["http", "https"], - "VALIDATORS": [validators.validate_options], - "PROCESSORS": [], - "DEFAULT_VALUE": "http", - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_TRANSPORT_TYPE", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-storage-protocol", - "USAGE": ("(optional) The storage protocol to be used on the data " - "path with the storage system; valid values are iscsi " - "or nfs. " - "Defaults to %s." % NETAPP_DEFAULT_STORAGE_PROTOCOL), - "PROMPT": ("Enter a NetApp storage protocol"), - "OPTION_LIST": ["iscsi", "nfs"], - "VALIDATORS": [validators.validate_options], - "PROCESSORS": [], - "DEFAULT_VALUE": NETAPP_DEFAULT_STORAGE_PROTOCOL, - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - ] - - group = {"GROUP_NAME": "CINDERNETAPPMAIN", - "DESCRIPTION": "Cinder NetApp main configuration", - "PRE_CONDITION": check_netapp_options, - "PRE_CONDITION_MATCH": True, - "POST_CONDITION": False, - "POST_CONDITION_MATCH": True} - - controller.addGroup(group, params) - - def check_netapp_ontap_iscsi_options(config): - storage_family = config.get('CONFIG_CINDER_NETAPP_STORAGE_FAMILY', - NETAPP_DEFAULT_STORAGE_FAMILY) - storage_protocol = config.get('CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL', - NETAPP_DEFAULT_STORAGE_PROTOCOL) - return (check_netapp_options(config) and - storage_family in ['ontap_cluster', 'ontap_7mode'] and - storage_protocol == "iscsi") - - params = [ - {"CMD_OPTION": "cinder-netapp-size-multiplier", - "USAGE": ("(optional) The quantity to be multiplied by the requested " - "volume size to ensure enough space is available on the " - "virtual storage server (Vserver) to fulfill the volume " - "creation request. " - "Defaults to 1.0."), - "PROMPT": ("Enter a NetApp size multiplier"), - "OPTION_LIST": [""], - "VALIDATORS": [], - "PROCESSORS": [], - "DEFAULT_VALUE": "1.0", - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_SIZE_MULTIPLIER", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - ] - group = {"GROUP_NAME": "CINDERNETAPPONTAPISCSI ", - "DESCRIPTION": "Cinder NetApp ONTAP-iSCSI configuration", - "PRE_CONDITION": check_netapp_ontap_iscsi_options, - "PRE_CONDITION_MATCH": True, - "POST_CONDITION": False, - "POST_CONDITION_MATCH": True} - controller.addGroup(group, params) - - def check_netapp_nfs_settings(config): - storage_protocol = config.get('CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL', - NETAPP_DEFAULT_STORAGE_PROTOCOL) - return (check_netapp_options(config) and - storage_protocol == "nfs") - - params = [ - {"CMD_OPTION": "cinder-netapp-expiry-thres-minutes", - "USAGE": ("(optional) This parameter specifies the threshold for " - "last access time for images in the NFS image cache. When " - "a cache cleaning cycle begins, images in the cache that " - "have not been accessed in the last M minutes, where M is " - "the value of this parameter, will be deleted from the " - "cache to create free space on the NFS share. " - "Defaults to 720."), - "PROMPT": ("Enter a threshold"), - "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_integer], - "PROCESSORS": [], - "DEFAULT_VALUE": 720, - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_EXPIRY_THRES_MINUTES", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-thres-avl-size-perc-start", - "USAGE": ("(optional) If the percentage of available space for an " - "NFS share has dropped below the value specified by this " - "parameter, the NFS image cache will be cleaned. " - "Defaults to 20"), - "PROMPT": ("Enter a value"), - "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_integer], - "PROCESSORS": [], - "DEFAULT_VALUE": 20, - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_START", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-thres-avl-size-perc-stop", - "USAGE": ("(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."), - "PROMPT": ("Enter a value"), - "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_integer], - "PROCESSORS": [], - "DEFAULT_VALUE": 60, - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_STOP", - "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 ''."), - "PROMPT": ("Enter a NetApp NFS share config file"), - "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_file], - "PROCESSORS": [], - "DEFAULT_VALUE": "", - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_NFS_SHARES_CONFIG", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - ] - group = {"GROUP_NAME": "CINDERNETAPPNFS", - "DESCRIPTION": "Cinder NetApp NFS configuration", - "PRE_CONDITION": check_netapp_nfs_settings, - "PRE_CONDITION_MATCH": True, - "POST_CONDITION": False, - "POST_CONDITION_MATCH": True} - controller.addGroup(group, params) - - def check_netapp_7modeiscsi_options(config): - storage_family = config.get('CONFIG_CINDER_NETAPP_STORAGE_FAMILY', - NETAPP_DEFAULT_STORAGE_FAMILY) - storage_protocol = config.get('CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL', - NETAPP_DEFAULT_STORAGE_PROTOCOL) - return (check_netapp_options(config) and - storage_family == 'ontap_7mode' and - storage_protocol == 'iscsi') - - params = [ - {"CMD_OPTION": "cinder-netapp-volume-list", - "USAGE": ("(optional) This parameter is only utilized when the " - "storage protocol is configured to use iSCSI. This " - "parameter is used to restrict provisioning to the " - "specified controller volumes. Specify the value of this " - "parameter to be a comma separated list of NetApp " - "controller volume names to be used for provisioning. " - "Defaults to ''."), - "PROMPT": ("Enter a NetApp volume list"), - "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_not_empty], - "PROCESSORS": [], - "DEFAULT_VALUE": "", - "MASK_INPUT": False, - "LOOSE_VALIDATION": True, - "CONF_NAME": "CONFIG_CINDER_NETAPP_VOLUME_LIST", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-vfiler", - "USAGE": ("(optional) The vFiler unit on which provisioning of block " - "storage volumes will be done. This parameter is only used " - "by the driver when connecting to an instance with a " - "storage family of Data ONTAP operating in 7-Mode and the " - "storage protocol selected is iSCSI. Only use this " - "parameter when utilizing the MultiStore feature on the " - "NetApp storage system. " - "Defaults to ''."), - "PROMPT": ("Enter a NetApp vFiler"), - "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_not_empty], - "PROCESSORS": [], - "DEFAULT_VALUE": "", - "MASK_INPUT": False, - "LOOSE_VALIDATION": True, - "CONF_NAME": "CONFIG_CINDER_NETAPP_VFILER", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - ] - group = {"GROUP_NAME": "CINDERNETAPPISCSI7MODE", - "DESCRIPTION": "Cinder NetApp iSCSI & 7-mode configuration", - "PRE_CONDITION": check_netapp_7modeiscsi_options, - "PRE_CONDITION_MATCH": True, - "POST_CONDITION": False, - "POST_CONDITION_MATCH": True} - controller.addGroup(group, params) - - def check_netapp_vserver_options(config): - storage_family = config.get('CONFIG_CINDER_NETAPP_STORAGE_FAMILY', - NETAPP_DEFAULT_STORAGE_FAMILY) - storage_protocol = config.get('CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL', - NETAPP_DEFAULT_STORAGE_PROTOCOL) - - return (check_netapp_options(config) and - storage_family == "ontap_cluster" and - storage_protocol in ['nfs', 'iscsi']) - - params = [ - {"CMD_OPTION": "cinder-netapp-vserver", - "USAGE": ("(optional) This parameter specifies the virtual storage " - "server (Vserver) name on the storage cluster on which " - "provisioning of block storage volumes should occur. If " - "using the NFS storage protocol, this parameter is " - "mandatory for storage service catalog support (utilized " - "by Cinder volume type extra_specs support). If this " - "parameter is specified, the exports belonging to the " - "Vserver will only be used for provisioning in the future. " - "Block storage volumes on exports not belonging to the " - "Vserver specified by this parameter will continue to " - "function normally. " - "Defaults to ''."), - "PROMPT": ("Enter a NetApp Vserver"), - "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_not_empty], - "PROCESSORS": [], - "DEFAULT_VALUE": "", - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_VSERVER", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - ] - group = {"GROUP_NAME": "CINDERNETAPPVSERVER", - "DESCRIPTION": "Cinder NetApp vServer configuration", - "PRE_CONDITION": check_netapp_vserver_options, - "PRE_CONDITION_MATCH": True, - "POST_CONDITION": False, - "POST_CONDITION_MATCH": True} - controller.addGroup(group, params) - - def check_netapp_eseries_options(config): - storage_family = config.get('CONFIG_CINDER_NETAPP_STORAGE_FAMILY', - NETAPP_DEFAULT_STORAGE_FAMILY) - return (check_netapp_options(config) and - storage_family == "eseries") - - params = [ - {"CMD_OPTION": "cinder-netapp-controller-ips", - "USAGE": ("(optional) This option is only utilized when the storage " - "family is configured to eseries. This option is used to " - "restrict provisioning to the specified controllers. " - "Specify the value of this option to be a comma separated " - "list of controller hostnames or IP addresses to be used " - "for provisioning. " - "Defaults to ''."), - "PROMPT": ("Enter a value"), - "OPTION_LIST": [""], - "VALIDATORS": [validators.validate_multi_ping], - "PROCESSORS": [], - "DEFAULT_VALUE": "", - "MASK_INPUT": False, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_CONTROLLER_IPS", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-sa-password", - "USAGE": ("(optional) Password for the NetApp E-Series storage " - "array. " - "Defaults to ''."), - "PROMPT": ("Enter a password"), - "OPTION_LIST": [""], - "VALIDATORS": [], - "PROCESSORS": [], - "DEFAULT_VALUE": "", - "MASK_INPUT": True, - "LOOSE_VALIDATION": False, - "CONF_NAME": "CONFIG_CINDER_NETAPP_SA_PASSWORD", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-webservice-path", - "USAGE": ("(optional) This option is used to specify the path to the " - "E-Series proxy application on a proxy server. The value " - "is combined with the value of the netapp_transport_type, " - "netapp_server_hostname, and netapp_server_port options to " - "create the URL used by the driver to connect to the proxy " - "application. " - "Defaults to '/devmgr/v2'."), - "PROMPT": ("Enter a path"), - "OPTION_LIST": ["^[/].*$"], - "VALIDATORS": [validators.validate_regexp], - "PROCESSORS": [], - "DEFAULT_VALUE": "/devmgr/v2", - "MASK_INPUT": False, - "LOOSE_VALIDATION": True, - "CONF_NAME": "CONFIG_CINDER_NETAPP_WEBSERVICE_PATH", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - {"CMD_OPTION": "cinder-netapp-storage-pools", - "USAGE": ("(optional) This option is used to restrict provisioning " - "to the specified storage pools. Only dynamic disk pools " - "are currently supported. Specify the value of this option " - "to be a comma separated list of disk pool names to be " - "used for provisioning. " - "Defaults to ''."), - "PROMPT": ("Enter a value"), - "OPTION_LIST": [""], - "VALIDATORS": [], - "PROCESSORS": [], - "DEFAULT_VALUE": "", - "MASK_INPUT": False, - "LOOSE_VALIDATION": True, - "CONF_NAME": "CONFIG_CINDER_NETAPP_STORAGE_POOLS", - "USE_DEFAULT": True, - "NEED_CONFIRM": False, - "CONDITION": False}, - ] - group = {"GROUP_NAME": "CINDERNETAPPESERIES", - "DESCRIPTION": "Cinder NetApp E-Series configuration", - "PRE_CONDITION": check_netapp_eseries_options, - "PRE_CONDITION_MATCH": True, - "POST_CONDITION": False, - "POST_CONDITION_MATCH": True} - controller.addGroup(group, params) + for group in conf_groups: + params = conf_params[group["GROUP_NAME"]] + controller.addGroup(group, params) def initSequences(controller): - if controller.CONF['CONFIG_CINDER_INSTALL'] != 'y': + config = controller.CONF + if config['CONFIG_CINDER_INSTALL'] != 'y': return + config['CONFIG_CINDER_BACKEND'] = str( + [i.strip() for i in config['CONFIG_CINDER_BACKEND'].split(',') if i] + ) + cinder_steps = [ {'title': 'Adding Cinder Keystone manifest entries', 'functions': [create_keystone_manifest]}, @@ -649,13 +601,71 @@ def initSequences(controller): 'functions': [create_manifest]} ] - if controller.CONF['CONFIG_CINDER_BACKEND'] == 'lvm': + if 'lvm' in config['CONFIG_CINDER_BACKEND']: cinder_steps.append( {'title': 'Checking if the Cinder server has a cinder-volumes vg', 'functions': [check_cinder_vg]}) controller.addSequence("Installing OpenStack Cinder", [], [], cinder_steps) +#------------------------- helper functions ------------------------- + +def check_lvm_options(config): + return (config['CONFIG_CINDER_INSTALL'] == 'y' and + 'lvm' in config['CONFIG_CINDER_BACKEND']) + + +def check_lvm_vg_options(config): + return (config['CONFIG_CINDER_INSTALL'] == 'y' and + 'lvm' in config['CONFIG_CINDER_BACKEND'] and + config['CONFIG_CINDER_VOLUMES_CREATE'] == 'y') + + +def check_gluster_options(config): + return (config['CONFIG_CINDER_INSTALL'] == 'y' and + 'gluster' in config['CONFIG_CINDER_BACKEND']) + + +def check_nfs_options(config): + return (config['CONFIG_CINDER_INSTALL'] == 'y' and + 'nfs' in config['CONFIG_CINDER_BACKEND']) + + +def check_netapp_options(config): + return (config['CONFIG_CINDER_INSTALL'] == 'y' and + 'netapp' in config['CONFIG_CINDER_BACKEND']) + + +def check_netapp_ontap_iscsi_options(config): + return (check_netapp_options(config) and + config['CONFIG_CINDER_NETAPP_STORAGE_FAMILY'] in + ['ontap_cluster', 'ontap_7mode'] and + config['CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL'] == "iscsi") + + +def check_netapp_nfs_settings(config): + return (check_netapp_options(config) and + config['CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL'] == "nfs") + + +def check_netapp_7modeiscsi_options(config): + return (check_netapp_options(config) and + config['CONFIG_CINDER_NETAPP_STORAGE_FAMILY'] == 'ontap_7mode' and + config['CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL'] == 'iscsi') + + +def check_netapp_vserver_options(config): + return (check_netapp_options(config) and + config['CONFIG_CINDER_NETAPP_STORAGE_FAMILY'] == "ontap_cluster" + and config['CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL'] in + ['nfs', 'iscsi']) + + +def check_netapp_eseries_options(config): + return (check_netapp_options(config) and + config['CONFIG_CINDER_NETAPP_STORAGE_FAMILY'] == "eseries") + + #-------------------------- step functions -------------------------- def check_cinder_vg(config, messages): @@ -663,57 +673,11 @@ def check_cinder_vg(config, messages): if config['CONFIG_UNSUPPORTED'] != 'y': config['CONFIG_STORAGE_HOST'] = config['CONFIG_CONTROLLER_HOST'] - # Do we have a cinder-volumes vg? - have_cinders_volume = False - server = utils.ScriptRunner(config['CONFIG_STORAGE_HOST']) - server.append('vgdisplay %s' % cinders_volume) - try: - server.execute() - have_cinders_volume = True - except exceptions.ScriptRuntimeError: - pass - - # Configure system LVM settings (snapshot_autoextend) - server = utils.ScriptRunner(config['CONFIG_STORAGE_HOST']) - server.append('sed -i -r "s/^ *snapshot_autoextend_threshold +=.*/' - ' snapshot_autoextend_threshold = 80/" ' - '/etc/lvm/lvm.conf') - server.append('sed -i -r "s/^ *snapshot_autoextend_percent +=.*/' - ' snapshot_autoextend_percent = 20/" ' - '/etc/lvm/lvm.conf') - try: - server.execute() - except exceptions.ScriptRuntimeError: - logging.info("Warning: Unable to set system LVM settings.") - if config["CONFIG_CINDER_VOLUMES_CREATE"] != "y": if not have_cinders_volume: raise exceptions.MissingRequirements("The cinder server should " "contain a cinder-volumes " "volume group") - else: - if have_cinders_volume: - messages.append( - output_messages.INFO_CINDER_VOLUMES_EXISTS) - return - - # TO-DO: This is implemented in cinder::setup_test_volume class. - # We should use it instead of this Python code - server = utils.ScriptRunner(config['CONFIG_STORAGE_HOST']) - server.append('systemctl') - try: - server.execute() - rst_cmd = 'systemctl restart openstack-cinder-volume.service' - except exceptions.ScriptRuntimeError: - rst_cmd = 'service openstack-cinder-volume restart' - - server.clear() - logging.info("A new cinder volumes group will be created") - server.append('yum install -y lvm2') - - cinders_volume_path = '/var/lib/cinder' - server.append('mkdir -p %s' % cinders_volume_path) - logging.debug("Volume's path: %s" % cinders_volume_path) match = re.match('^(?P\d+)G$', config['CONFIG_CINDER_VOLUMES_SIZE'].strip()) @@ -725,45 +689,7 @@ def check_cinder_vg(config, messages): cinders_reserve = int(cinders_volume_size * 0.03) cinders_volume_size = cinders_volume_size + cinders_reserve - cinders_volume_path = os.path.join(cinders_volume_path, cinders_volume) - server.append('dd if=/dev/zero of=%s bs=1 count=0 seek=%sM' - % (cinders_volume_path, cinders_volume_size)) - server.append('LOFI=$(losetup --show -f %s)' % cinders_volume_path) - server.append('pvcreate $LOFI') - server.append('vgcreate %s $LOFI' % cinders_volume) - - # Add the loop device on boot - server.append('grep %(volume)s /etc/rc.d/rc.local || ' - 'echo "losetup -f %(path)s && ' - 'vgchange -a y %(volume)s && ' - '%(restart_cmd)s" ' - '>> /etc/rc.d/rc.local' % - {'volume': cinders_volume, 'restart_cmd': rst_cmd, - 'path': cinders_volume_path}) - server.append('grep "#!" /etc/rc.d/rc.local || ' - 'sed -i \'1i#!/bin/sh\' /etc/rc.d/rc.local') - server.append('chmod +x /etc/rc.d/rc.local') - - # Let's make sure it exists - server.append('vgdisplay %s' % cinders_volume) - - try: - server.execute() - except exceptions.ScriptRuntimeError: - # Release loop device if cinder's volume creation - # fails. - try: - logging.debug("Release loop device, volume creation failed") - server = utils.ScriptRunner(config['CONFIG_STORAGE_HOST']) - server.append('losetup -d $(losetup -j %s | cut -d : -f 1)' - % cinders_volume_path) - server.execute() - except: - pass - - raise exceptions.MissingRequirements("Cinder's volume group '%s' " - "could not be created" - % cinders_volume) + config['CONFIG_CINDER_VOLUMES_SIZE'] = 'sM' % cinders_volume_size def create_keystone_manifest(config, messages): @@ -783,21 +709,15 @@ def create_manifest(config, messages): manifestfile = "%s_cinder.pp" % config['CONFIG_STORAGE_HOST'] manifestdata += getManifestTemplate("cinder.pp") - if config['CONFIG_CINDER_BACKEND'] == "lvm": - manifestdata += getManifestTemplate("cinder_lvm.pp") - elif config['CONFIG_CINDER_BACKEND'] == "gluster": - manifestdata += getManifestTemplate("cinder_gluster.pp") - elif config['CONFIG_CINDER_BACKEND'] == "nfs": - manifestdata += getManifestTemplate("cinder_nfs.pp") - elif config['CONFIG_CINDER_BACKEND'] == "vmdk": - manifestdata += getManifestTemplate("cinder_vmdk.pp") - if config['CONFIG_CINDER_BACKEND'] == "netapp": + backends = config['CONFIG_CINDER_BACKEND'].strip('[]') + backends = [i.strip('\' ') for i in backends.split(',')] + if 'netapp' in backends: + backends.remove('netapp') puppet_cdot_iscsi = "cinder_netapp_cdot_iscsi.pp" puppet_cdot_nfs = "cinder_netapp_cdot_nfs.pp" puppet_7mode_iscsi = "cinder_netapp_7mode_iscsi.pp" puppet_7mode_nfs = "cinder_netapp_7mode_nfs.pp" puppet_eseries = "cinder_netapp_eseries.pp" - if config['CONFIG_CINDER_NETAPP_STORAGE_FAMILY'] == "ontap_cluster": if config['CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL'] == "iscsi": manifestdata += getManifestTemplate(puppet_cdot_iscsi) @@ -810,6 +730,9 @@ def create_manifest(config, messages): manifestdata += getManifestTemplate(puppet_7mode_nfs) elif config['CONFIG_CINDER_NETAPP_STORAGE_FAMILY'] == "eseries": manifestdata += getManifestTemplate(puppet_eseries) + for backend in backends: + manifestdata += getManifestTemplate('cinder_%s.pp' % backend) + if config['CONFIG_CEILOMETER_INSTALL'] == 'y': manifestdata += getManifestTemplate('cinder_ceilometer.pp') if config['CONFIG_SWIFT_INSTALL'] == 'y': diff --git a/packstack/plugins/nova_300.py b/packstack/plugins/nova_300.py index 42e39765c..9093285a7 100644 --- a/packstack/plugins/nova_300.py +++ b/packstack/plugins/nova_300.py @@ -511,11 +511,11 @@ def create_compute_manifest(config, messages): manifestdata += getManifestTemplate("nova_compute_libvirt.pp") if (config['CONFIG_VMWARE_BACKEND'] != 'y' and config['CONFIG_CINDER_INSTALL'] == 'y' and - config['CONFIG_CINDER_BACKEND'] == 'gluster'): + 'gluster' in config['CONFIG_CINDER_BACKEND']): manifestdata += getManifestTemplate("nova_gluster.pp") if (config['CONFIG_VMWARE_BACKEND'] != 'y' and config['CONFIG_CINDER_INSTALL'] == 'y' and - config['CONFIG_CINDER_BACKEND'] == 'nfs'): + 'nfs' in config['CONFIG_CINDER_BACKEND']): manifestdata += getManifestTemplate("nova_nfs.pp") manifestfile = "%s_nova.pp" % host diff --git a/packstack/puppet/templates/cinder.pp b/packstack/puppet/templates/cinder.pp index 3b8c9fbb3..247f289ef 100644 --- a/packstack/puppet/templates/cinder.pp +++ b/packstack/puppet/templates/cinder.pp @@ -1,16 +1,16 @@ cinder_config { - "DEFAULT/glance_host": value => "%(CONFIG_STORAGE_HOST)s"; + "DEFAULT/glance_host": value => "%(CONFIG_STORAGE_HOST)s"; } package {'python-keystone': - notify => Class['cinder::api'], + notify => Class['cinder::api'], } class {'cinder::api': - keystone_password => '%(CONFIG_CINDER_KS_PW)s', - keystone_tenant => "services", - keystone_user => "cinder", - keystone_auth_host => "%(CONFIG_CONTROLLER_HOST)s", + keystone_password => '%(CONFIG_CINDER_KS_PW)s', + keystone_tenant => "services", + keystone_user => "cinder", + keystone_auth_host => "%(CONFIG_CONTROLLER_HOST)s", } class {'cinder::scheduler': @@ -19,3 +19,17 @@ class {'cinder::scheduler': class {'cinder::volume': } +class {'cinder::client': +} + +# Cinder::Type requires keystone credentials +Cinder::Type { + os_password => '%(CONFIG_CINDER_KS_PW)s', + os_tenant_name => "services", + os_username => "cinder", + os_auth_url => "http://%(CONFIG_CONTROLLER_HOST)s:5000/v2.0/", +} + +class { 'cinder::backends': + enabled_backends => %(CONFIG_CINDER_BACKEND)s, +} diff --git a/packstack/puppet/templates/cinder_backup.pp b/packstack/puppet/templates/cinder_backup.pp index b6e93088f..1b5f41c22 100644 --- a/packstack/puppet/templates/cinder_backup.pp +++ b/packstack/puppet/templates/cinder_backup.pp @@ -1,8 +1,8 @@ -class {'cinder::backup': +class { 'cinder::backup': } -class {'cinder::backup::swift': - backup_swift_url => 'http://%(CONFIG_CONTROLLER_HOST)s:8080/v1/AUTH_' +class { 'cinder::backup::swift': + backup_swift_url => 'http://%(CONFIG_CONTROLLER_HOST)s:8080/v1/AUTH_' } Class['cinder::api'] ~> Service['cinder-backup'] diff --git a/packstack/puppet/templates/cinder_gluster.pp b/packstack/puppet/templates/cinder_gluster.pp index e3621f789..6b2e292cc 100644 --- a/packstack/puppet/templates/cinder_gluster.pp +++ b/packstack/puppet/templates/cinder_gluster.pp @@ -1,6 +1,13 @@ package { 'glusterfs-fuse': ensure => present } -class { 'cinder::volume::glusterfs': - glusterfs_shares => [%(CONFIG_CINDER_GLUSTER_MOUNTS)s], - require => Package['glusterfs-fuse'], +cinder::backend::glusterfs { 'gluster': + glusterfs_shares => [%(CONFIG_CINDER_GLUSTER_MOUNTS)s], + require => Package['glusterfs-fuse'], + glusterfs_shares_config => '/etc/cinder/glusterfs_shares.conf', +} + +cinder::type { 'glusterfs': + set_key => 'volume_backend_name', + set_value => 'gluster', + require => Class['cinder::api'], } diff --git a/packstack/puppet/templates/cinder_lvm.pp b/packstack/puppet/templates/cinder_lvm.pp index 4a7a437f6..4cce3ac0a 100644 --- a/packstack/puppet/templates/cinder_lvm.pp +++ b/packstack/puppet/templates/cinder_lvm.pp @@ -1,9 +1,81 @@ - -package { 'lvm2': - ensure => installed, +class { 'cinder::setup_test_volume': + size => '%(CONFIG_CINDER_VOLUMES_SIZE)s', + loopback_device => '/dev/loop2', + volume_path => '/var/lib/cinder', + volume_name => 'cinder-volumes', } -class {'cinder::volume::iscsi': +# Add loop device on boot +$el_releases = ["RedHat", "CentOS", "Scientific"] +if $::operatingsystem in $el_releases and $::operatingsystemmajrelease < 7 { + + file_line{ 'rc.local_losetup_cinder_volume': + path => '/etc/rc.d/rc.local', + match => '^.*/var/lib/cinder/cinder-volumes.*$', + line => 'losetup -f /var/lib/cinder/cinder-volumes && service openstack-cinder-volume restart', + } + + file { '/etc/rc.d/rc.local': + mode => '0755', + } + +} else { + + file { 'openstack-losetup': + path => '/usr/lib/systemd/system/openstack-losetup.service', + before => Service['openstack-losetup'], + notify => Exec['/usr/bin/systemctl daemon-reload'], + content => '[Unit] +Description=Setup cinder-volume loop device +DefaultDependencies=false +Before=openstack-cinder-volume.service +After=local-fs.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/sh -c \'/usr/sbin/losetup -j /var/lib/cinder/cinder-volumes | /usr/bin/grep /var/lib/cinder/cinder-volumes || /usr/sbin/losetup -f /var/lib/cinder/cinder-volumes\' +ExecStop=/usr/bin/sh -c \'/usr/sbin/losetup -j /var/lib/cinder/cinder-volumes | /usr/bin/cut -d : -f 1 | /usr/bin/xargs /usr/sbin/losetup -d\' +TimeoutSec=60 +RemainAfterExit=yes + +[Install] +RequiredBy=openstack-cinder-volume.service', + } + + exec { '/usr/bin/systemctl daemon-reload': + refreshonly => true, + before => Service['openstack-losetup'], + } + + service { 'openstack-losetup': + ensure => running, + enable => true, + require => Class['cinder::setup_test_volume'], + } + +} + +file_line { 'snapshot_autoextend_threshold': + path => '/etc/lvm/lvm.conf', + match => '^ *snapshot_autoextend_threshold +=.*', + line => ' snapshot_autoextend_threshold = 80', + require => Package['lvm2'], +} + +file_line { 'snapshot_autoextend_percent': + path => '/etc/lvm/lvm.conf', + match => '^ *snapshot_autoextend_percent +=.*', + line => ' snapshot_autoextend_percent = 20', + require => Package['lvm2'], +} + +cinder::backend::iscsi { 'lvm': iscsi_ip_address => '%(CONFIG_STORAGE_HOST)s', require => Package['lvm2'], } + +cinder::type { 'iscsi': + set_key => 'volume_backend_name', + set_value => 'lvm', + require => Class['cinder::api'], +} diff --git a/packstack/puppet/templates/cinder_netapp_7mode_iscsi.pp b/packstack/puppet/templates/cinder_netapp_7mode_iscsi.pp index 5773d2aa8..79f74a1bd 100644 --- a/packstack/puppet/templates/cinder_netapp_7mode_iscsi.pp +++ b/packstack/puppet/templates/cinder_netapp_7mode_iscsi.pp @@ -2,11 +2,7 @@ package { 'iscsi-initiator-utils': ensure => present } -cinder_config { - "DEFAULT/enabled_backends": value => "myBackend"; -} - -cinder::backend::netapp{ 'myBackend': +cinder::backend::netapp { 'netapp': netapp_login => "%(CONFIG_CINDER_NETAPP_LOGIN)s", netapp_password => "%(CONFIG_CINDER_NETAPP_PASSWORD)s", netapp_server_hostname => "%(CONFIG_CINDER_NETAPP_HOSTNAME)s", @@ -17,6 +13,11 @@ cinder::backend::netapp{ 'myBackend': netapp_transport_type => "%(CONFIG_CINDER_NETAPP_TRANSPORT_TYPE)s", netapp_vfiler => "%(CONFIG_CINDER_NETAPP_VFILER)s", netapp_volume_list => ["%(CONFIG_CINDER_NETAPP_VOLUME_LIST)s"], - - require => Package['iscsi-initiator-utils'], + require => Package['iscsi-initiator-utils'], +} + +cinder::type { 'cinder_netapp_7mode_iscsi': + set_key => 'volume_backend_name', + set_value => 'netapp', + require => Class['cinder::api'], } diff --git a/packstack/puppet/templates/cinder_netapp_7mode_nfs.pp b/packstack/puppet/templates/cinder_netapp_7mode_nfs.pp index 9b8e90eb3..960badaa9 100644 --- a/packstack/puppet/templates/cinder_netapp_7mode_nfs.pp +++ b/packstack/puppet/templates/cinder_netapp_7mode_nfs.pp @@ -2,11 +2,7 @@ package { 'nfs-utils': ensure => present } -cinder_config { - "DEFAULT/enabled_backends": value => "myBackend"; -} - -cinder::backend::netapp{ 'myBackend': +cinder::backend::netapp { 'netapp': netapp_login => "%(CONFIG_CINDER_NETAPP_LOGIN)s", netapp_password => "%(CONFIG_CINDER_NETAPP_PASSWORD)s", netapp_server_hostname => "%(CONFIG_CINDER_NETAPP_HOSTNAME)s", @@ -18,6 +14,11 @@ cinder::backend::netapp{ 'myBackend': thres_avl_size_perc_start => "%(CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_START)s", thres_avl_size_perc_stop => "%(CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_STOP)s", nfs_shares_config => "%(CONFIG_CINDER_NETAPP_NFS_SHARES_CONFIG)s", - - require => Package['nfs-utils'], + require => Package['nfs-utils'], +} + +cinder::type { 'cinder_netapp_7mode_nfs': + set_key => 'volume_backend_name', + set_value => 'netapp', + require => Class['cinder::api'], } diff --git a/packstack/puppet/templates/cinder_netapp_cdot_iscsi.pp b/packstack/puppet/templates/cinder_netapp_cdot_iscsi.pp index 09c235daa..de373396c 100644 --- a/packstack/puppet/templates/cinder_netapp_cdot_iscsi.pp +++ b/packstack/puppet/templates/cinder_netapp_cdot_iscsi.pp @@ -2,11 +2,7 @@ package { 'iscsi-initiator-utils': ensure => present } -cinder_config { - "DEFAULT/enabled_backends": value => "myBackend"; -} - -cinder::backend::netapp{ 'myBackend': +cinder::backend::netapp { 'netapp': netapp_login => "%(CONFIG_CINDER_NETAPP_LOGIN)s", netapp_password => "%(CONFIG_CINDER_NETAPP_PASSWORD)s", netapp_server_hostname => "%(CONFIG_CINDER_NETAPP_HOSTNAME)s", @@ -16,6 +12,11 @@ cinder::backend::netapp{ 'myBackend': netapp_storage_protocol => "%(CONFIG_CINDER_NETAPP_STORAGE_PROTOCOL)s", netapp_transport_type => "%(CONFIG_CINDER_NETAPP_TRANSPORT_TYPE)s", netapp_vserver => "%(CONFIG_CINDER_NETAPP_VSERVER)s", - - require => Package['iscsi-initiator-utils'], + require => Package['iscsi-initiator-utils'], +} + +cinder::type { 'cinder_netapp_cdot_iscsi': + set_key => 'volume_backend_name', + set_value => 'netapp', + require => Class['cinder::api'], } diff --git a/packstack/puppet/templates/cinder_netapp_cdot_nfs.pp b/packstack/puppet/templates/cinder_netapp_cdot_nfs.pp index 960e3329a..d4fc0eb3e 100644 --- a/packstack/puppet/templates/cinder_netapp_cdot_nfs.pp +++ b/packstack/puppet/templates/cinder_netapp_cdot_nfs.pp @@ -2,11 +2,7 @@ package { 'nfs-utils': ensure => present } -cinder_config { - "DEFAULT/enabled_backends": value => "myBackend"; -} - -cinder::backend::netapp{ 'myBackend': +cinder::backend::netapp { 'netapp': netapp_login => "%(CONFIG_CINDER_NETAPP_LOGIN)s", netapp_password => "%(CONFIG_CINDER_NETAPP_PASSWORD)s", netapp_server_hostname => "%(CONFIG_CINDER_NETAPP_HOSTNAME)s", @@ -19,6 +15,11 @@ cinder::backend::netapp{ 'myBackend': thres_avl_size_perc_start => "%(CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_START)s", thres_avl_size_perc_stop => "%(CONFIG_CINDER_NETAPP_THRES_AVL_SIZE_PERC_STOP)s", nfs_shares_config => "%(CONFIG_CINDER_NETAPP_NFS_SHARES_CONFIG)s", - - require => Package['nfs-utils'], + require => Package['nfs-utils'], +} + +cinder::type { 'cinder_netapp_cdot_nfs': + set_key => 'volume_backend_name', + set_value => 'netapp', + require => Class['cinder::api'], } diff --git a/packstack/puppet/templates/cinder_netapp_eseries.pp b/packstack/puppet/templates/cinder_netapp_eseries.pp index b137d2e00..01e92fccb 100644 --- a/packstack/puppet/templates/cinder_netapp_eseries.pp +++ b/packstack/puppet/templates/cinder_netapp_eseries.pp @@ -2,11 +2,7 @@ package { 'iscsi-initiator-utils': ensure => present } -cinder_config { - "DEFAULT/enabled_backends": value => "myBackend"; -} - -cinder::backend::netapp{ 'myBackend': +cinder::backend::netapp { 'netapp': netapp_login => "%(CONFIG_CINDER_NETAPP_LOGIN)s", netapp_password => "%(CONFIG_CINDER_NETAPP_PASSWORD)s", netapp_server_hostname => "%(CONFIG_CINDER_NETAPP_HOSTNAME)s", @@ -18,6 +14,11 @@ cinder::backend::netapp{ 'myBackend': netapp_sa_password => "%(CONFIG_CINDER_NETAPP_SA_PASSWORD)s", netapp_storage_pools => "%(CONFIG_CINDER_NETAPP_STORAGE_POOLS)s", netapp_webservice_path => "%(CONFIG_CINDER_NETAPP_WEBSERVICE_PATH)s", - - require => Package['iscsi-initiator-utils'], + require => Package['iscsi-initiator-utils'], +} + +cinder::type { 'cinder_netapp_eseries': + set_key => 'volume_backend_name', + set_value => 'netapp', + require => Class['cinder::api'], } diff --git a/packstack/puppet/templates/cinder_nfs.pp b/packstack/puppet/templates/cinder_nfs.pp index d6f4c376f..fffc9be51 100644 --- a/packstack/puppet/templates/cinder_nfs.pp +++ b/packstack/puppet/templates/cinder_nfs.pp @@ -1,6 +1,13 @@ package { 'nfs-utils': ensure => present } -class { 'cinder::volume::nfs': - nfs_servers => [%(CONFIG_CINDER_NFS_MOUNTS)s], - require => Package['nfs-utils'], +cinder::backend::nfs { 'nfs': + nfs_servers => [%(CONFIG_CINDER_NFS_MOUNTS)s], + require => Package['nfs-utils'], + nfs_shares_config => '/etc/cinder/nfs_shares.conf', +} + +cinder::type { 'nfs': + set_key => 'volume_backend_name', + set_value => 'nfs', + require => Class['cinder::api'], } diff --git a/packstack/puppet/templates/cinder_vmdk.pp b/packstack/puppet/templates/cinder_vmdk.pp index 95728deaa..ff01b302a 100644 --- a/packstack/puppet/templates/cinder_vmdk.pp +++ b/packstack/puppet/templates/cinder_vmdk.pp @@ -1,5 +1,11 @@ -class { 'cinder::volume::vmdk': +cinder::backend::vmdk { 'vmdk': host_ip => "%(CONFIG_VCENTER_HOST)s", host_username => "%(CONFIG_VCENTER_USER)s", host_password => "%(CONFIG_VCENTER_PASSWORD)s", } + +cinder::type { 'vmdk': + set_key => 'volume_backend_name', + set_value => 'vmdk', + require => Class['cinder::api'], +}