Refactor cinder plugin and extend it with multiple backends support

Closes-Bug: rhbz#1139246
Change-Id: I9803939d45e9bafea9b21274a4c64248a037cd33
This commit is contained in:
Lukas Bezdicka
2014-09-03 09:39:35 -04:00
parent 67b98ec179
commit 770d5da931
14 changed files with 786 additions and 753 deletions

View File

@@ -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
--------------------------------------

View File

@@ -36,7 +36,8 @@ NETAPP_DEFAULT_STORAGE_PROTOCOL = "nfs"
def initConfig(controller):
params = [
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",
@@ -51,8 +52,8 @@ def initConfig(controller):
"CONDITION": False},
{"CMD_OPTION": "cinder-ks-passwd",
"USAGE": ("The password to use for the Cinder to authenticate with "
"Keystone"),
"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],
@@ -77,25 +78,14 @@ def initConfig(controller):
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
]
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 = [
"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."),
"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"],
@@ -107,24 +97,13 @@ def initConfig(controller):
"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 = [
"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."),
"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],
@@ -135,25 +114,15 @@ def initConfig(controller):
"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 = [
"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"),
"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],
@@ -165,25 +134,14 @@ def initConfig(controller):
"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 = [
"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"),
"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],
@@ -194,20 +152,9 @@ def initConfig(controller):
"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 = [
"CINDERNETAPPMAIN": [
{"CMD_OPTION": "cinder-netapp-login",
"USAGE": ("(required) Administrative user account name used to "
"access the storage system or proxy server. "),
@@ -223,8 +170,8 @@ def initConfig(controller):
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "cinder-netapp-password",
"USAGE": ("(required) Password for the administrative user account "
"specified in the netapp_login parameter."),
"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],
@@ -237,8 +184,8 @@ def initConfig(controller):
"NEED_CONFIRM": True,
"CONDITION": False},
{"CMD_OPTION": "cinder-netapp-hostname",
"USAGE": ("(required) The hostname (or IP address) for the storage "
"system or proxy server."),
"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],
@@ -252,11 +199,11 @@ def initConfig(controller):
"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."),
"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],
@@ -269,10 +216,10 @@ def initConfig(controller):
"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. "
"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"],
@@ -286,9 +233,9 @@ def initConfig(controller):
"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. "
"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"],
@@ -302,8 +249,8 @@ def initConfig(controller):
"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 "
"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"),
@@ -317,32 +264,14 @@ def initConfig(controller):
"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 = [
"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. "
"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": [""],
@@ -355,30 +284,17 @@ def initConfig(controller):
"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 = [
"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."),
"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],
@@ -391,9 +307,9 @@ def initConfig(controller):
"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. "
"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": [""],
@@ -407,12 +323,12 @@ def initConfig(controller):
"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. "
"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": [""],
@@ -426,8 +342,8 @@ def initConfig(controller):
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "cinder-netapp-nfs-shares-config",
"USAGE": ("(optional) File with the list of available NFS shares. "
"Defaults to ''."),
"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],
@@ -439,31 +355,15 @@ def initConfig(controller):
"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 = [
"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 "
"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"),
@@ -478,13 +378,13 @@ def initConfig(controller):
"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. "
"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": [""],
@@ -497,38 +397,22 @@ def initConfig(controller):
"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 = [
"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. "
"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": [""],
@@ -541,29 +425,16 @@ def initConfig(controller):
"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 = [
"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. "
"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": [""],
@@ -592,12 +463,12 @@ def initConfig(controller):
"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. "
"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": ["^[/].*$"],
@@ -611,11 +482,11 @@ def initConfig(controller):
"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. "
"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": [""],
@@ -629,19 +500,100 @@ def initConfig(controller):
"NEED_CONFIRM": False,
"CONDITION": False},
]
group = {"GROUP_NAME": "CINDERNETAPPESERIES",
}
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}
"POST_CONDITION_MATCH": True},
]
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<size>\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':

View File

@@ -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

View File

@@ -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,
}

View File

@@ -1,7 +1,7 @@
class {'cinder::backup':
class { 'cinder::backup':
}
class {'cinder::backup::swift':
class { 'cinder::backup::swift':
backup_swift_url => 'http://%(CONFIG_CONTROLLER_HOST)s:8080/v1/AUTH_'
}

View File

@@ -1,6 +1,13 @@
package { 'glusterfs-fuse': ensure => present }
class { 'cinder::volume::glusterfs':
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'],
}

View File

@@ -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'],
}

View File

@@ -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'],
}
cinder::type { 'cinder_netapp_7mode_iscsi':
set_key => 'volume_backend_name',
set_value => 'netapp',
require => Class['cinder::api'],
}

View File

@@ -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'],
}
cinder::type { 'cinder_netapp_7mode_nfs':
set_key => 'volume_backend_name',
set_value => 'netapp',
require => Class['cinder::api'],
}

View File

@@ -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'],
}
cinder::type { 'cinder_netapp_cdot_iscsi':
set_key => 'volume_backend_name',
set_value => 'netapp',
require => Class['cinder::api'],
}

View File

@@ -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'],
}
cinder::type { 'cinder_netapp_cdot_nfs':
set_key => 'volume_backend_name',
set_value => 'netapp',
require => Class['cinder::api'],
}

View File

@@ -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'],
}
cinder::type { 'cinder_netapp_eseries':
set_key => 'volume_backend_name',
set_value => 'netapp',
require => Class['cinder::api'],
}

View File

@@ -1,6 +1,13 @@
package { 'nfs-utils': ensure => present }
class { 'cinder::volume::nfs':
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'],
}

View File

@@ -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'],
}