[vCenter] Fix the parameters duplicated in answer file

Also this patch consolidate the options to a single vcenter host
for Cinder and Nova.

Change-Id: Iff01770b82dfceda1b3c706fb8a4556b38ecb774
Fixes: rhbz#1061372, rhbz#1092008
This commit is contained in:
Francesco Vollero
2014-05-06 13:00:06 +02:00
parent 4a33c3ff1d
commit 31891ae6fa
3 changed files with 59 additions and 107 deletions

View File

@@ -221,57 +221,6 @@ def initConfig(controllerObject):
controller.addGroup(groupDict, paramsList)
def check_vcenter_options(config):
return (config.get('CONFIG_NOVA_INSTALL', 'y') == 'n' and
config.get('CONFIG_VMWARE_BACKEND', 'n') == 'y' and
config.get('CONFIG_CINDER_BACKEND', 'lvm') == 'vmdk')
paramsList = [
{"CMD_OPTION" : "cinder-vcenter-host",
"USAGE" : ("The IP address of the VMware vCenter datastore"),
"PROMPT" : ("Enter the IP address of the VMware vCenter datastore to use with Cinder"),
"OPTION_LIST" : [],
"VALIDATORS" : [validators.validate_ip],
"DEFAULT_VALUE" : "",
"MASK_INPUT" : False,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_VCENTER_HOST",
"USE_DEFAULT" : False,
"NEED_CONFIRM" : False,
"CONDITION" : False },
{"CMD_OPTION" : "cinder-vcenter-username",
"USAGE" : ("The username to authenticate to VMware vCenter datastore"),
"PROMPT" : ("Enter the username to authenticate on VMware vCenter datastore"),
"VALIDATORS" : [validators.validate_not_empty],
"DEFAULT_VALUE" : "",
"MASK_INPUT" : False,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_VCENTER_USER",
"USE_DEFAULT" : False,
"NEED_CONFIRM" : False,
"CONDITION" : False,},
{"CMD_OPTION" : "cinder-vcenter-password",
"USAGE" : ("The password to authenticate to VMware vCenter datastore"),
"PROMPT" : ("Enter the password to authenticate on VMware vCenter datastore"),
"VALIDATORS" : [validators.validate_not_empty],
"DEFAULT_VALUE" : "",
"MASK_INPUT" : True,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_VCENTER_PASSWORD",
"VALIDATORS" : [validators.validate_not_empty],
"USE_DEFAULT" : False,
"NEED_CONFIRM" : False,
"CONDITION" : False,},
]
groupDict = { "GROUP_NAME" : "CINDERVCENTEROPTIONS",
"DESCRIPTION" : "Cinder VMware vCenter Config parameters",
"PRE_CONDITION" : check_vcenter_options,
"PRE_CONDITION_MATCH" : True,
"POST_CONDITION" : False,
"POST_CONDITION_MATCH" : True}
controller.addGroup(groupDict, paramsList)
def initSequences(controller):
if controller.CONF['CONFIG_CINDER_INSTALL'] != 'y':
@@ -427,7 +376,7 @@ def create_manifest(config):
config['FIREWALL_PORTS'] = "'3260', '8776'"
config['FIREWALL_CHAIN'] = "INPUT"
if config['CONFIG_NOVA_INSTALL'] == 'y':
if (config['CONFIG_NOVA_INSTALL'] == 'y' and config['CONFIG_VMWARE_BACKEND']=='n'):
for host in split_hosts(config['CONFIG_NOVA_COMPUTE_HOSTS']):
config['FIREWALL_ALLOWED'] = "'%s'" % host
config['FIREWALL_SERVICE_ID'] = "cinder_%s" % host

View File

@@ -309,50 +309,6 @@ def initConfig(controllerObject):
"NEED_CONFIRM" : False,
"CONDITION" : False },
],
"NOVA_VCENTER": [
{"CMD_OPTION" : "nova-vcenter-host",
"USAGE" : ("The IP address of the VMware vCenter server"),
"PROMPT" : ("Enter the IP address of the VMware vCenter server to use with Nova"),
"OPTION_LIST" : [],
"VALIDATORS" : [validators.validate_ip],
"DEFAULT_VALUE" : "",
"MASK_INPUT" : False,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_VCENTER_HOST",
"USE_DEFAULT" : False,
"NEED_CONFIRM" : False,
"CONDITION" : False },
{"CMD_OPTION" : "nova-vcenter-username",
"USAGE" : ("The username to authenticate to VMware vCenter server"),
"PROMPT" : ("Enter the username to authenticate on VMware vCenter server"),
"DEFAULT_VALUE" : "",
"MASK_INPUT" : False,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_VCENTER_USER",
"USE_DEFAULT" : False,
"NEED_CONFIRM" : False,
"CONDITION" : False,},
{"CMD_OPTION" : "nova-vcenter-password",
"USAGE" : ("The password to authenticate to VMware vCenter server"),
"PROMPT" : ("Enter the password to authenticate on VMware vCenter server"),
"DEFAULT_VALUE" : "",
"MASK_INPUT" : True,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_VCENTER_PASSWORD",
"USE_DEFAULT" : False,
"NEED_CONFIRM" : False,
"CONDITION" : False,},
{"CMD_OPTION" : "nova-vcenter-cluster",
"USAGE" : ("The name of the vCenter cluster"),
"PROMPT" : ("Enter the name of the vCenter datastore"),
"DEFAULT_VALUE" : "",
"MASK_INPUT" : False,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_VCENTER_CLUSTER_NAME",
"USE_DEFAULT" : False,
"NEED_CONFIRM" : False,
"CONDITION" : False,},
],
}
def use_nova_network(config):
@@ -365,10 +321,6 @@ def initConfig(controllerObject):
config['CONFIG_NEUTRON_INSTALL'] != 'y' and \
config['CONFIG_NOVA_NETWORK_MANAGER'] == manager
def use_nova_vcenter(config):
return (config['CONFIG_NOVA_INSTALL'] == 'y' and
config['CONFIG_VMWARE_BACKEND'] == 'y')
nova_groups = [
{"GROUP_NAME" : "NOVA",
"DESCRIPTION" : "Nova Options",
@@ -388,12 +340,6 @@ def initConfig(controllerObject):
"PRE_CONDITION_MATCH" : True,
"POST_CONDITION" : False,
"POST_CONDITION_MATCH" : True},
{"GROUP_NAME" : "NOVA_VCENTER",
"DESCRIPTION" : "Nova VMware vCenter Config parameters",
"PRE_CONDITION" : use_nova_vcenter,
"PRE_CONDITION_MATCH" : True,
"POST_CONDITION" : False,
"POST_CONDITION_MATCH" : True},
]
for group in nova_groups:
@@ -557,7 +503,7 @@ def createcomputemanifest(config):
else:
manifestdata += getManifestTemplate("nova_compute_libvirt.pp")
if (config['CONFIG_VMWARE_BACKEND'] != 'y' and
config['CONFIG_CINDER_INSTALL'] == 'y' and
config['CONFIG_CINDER_INSTALL'] == 'y' and
config['CONFIG_CINDER_BACKEND'] == 'gluster'):
manifestdata += getManifestTemplate("nova_gluster.pp")
if (config['CONFIG_VMWARE_BACKEND'] != 'y' and

View File

@@ -236,6 +236,63 @@ def initConfig(controllerObject):
"POST_CONDITION_MATCH" : True}
controller.addGroup(groupDict, paramsList)
def use_vcenter(config):
return (config['CONFIG_NOVA_INSTALL'] == 'y' and
config['CONFIG_VMWARE_BACKEND'] == 'y')
paramsList = [
{"CMD_OPTION" : "vcenter-host",
"USAGE" : ("The IP address of the VMware vCenter server"),
"PROMPT" : ("Enter the IP address of the VMware vCenter server to use with Nova"),
"OPTION_LIST" : [],
"VALIDATORS" : [validators.validate_ip],
"DEFAULT_VALUE" : "",
"MASK_INPUT" : False,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_VCENTER_HOST",
"USE_DEFAULT" : False,
"NEED_CONFIRM" : False,
"CONDITION" : False },
{"CMD_OPTION" : "vcenter-username",
"USAGE" : ("The username to authenticate to VMware vCenter server"),
"PROMPT" : ("Enter the username to authenticate on VMware vCenter server"),
"DEFAULT_VALUE" : "",
"MASK_INPUT" : False,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_VCENTER_USER",
"USE_DEFAULT" : False,
"NEED_CONFIRM" : False,
"CONDITION" : False,},
{"CMD_OPTION" : "vcenter-password",
"USAGE" : ("The password to authenticate to VMware vCenter server"),
"PROMPT" : ("Enter the password to authenticate on VMware vCenter server"),
"DEFAULT_VALUE" : "",
"MASK_INPUT" : True,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_VCENTER_PASSWORD",
"USE_DEFAULT" : False,
"NEED_CONFIRM" : False,
"CONDITION" : False,},
{"CMD_OPTION" : "vcenter-cluster",
"USAGE" : ("The name of the vCenter cluster"),
"PROMPT" : ("Enter the name of the vCenter datastore"),
"DEFAULT_VALUE" : "",
"MASK_INPUT" : False,
"LOOSE_VALIDATION": True,
"CONF_NAME" : "CONFIG_VCENTER_CLUSTER_NAME",
"USE_DEFAULT" : False,
"NEED_CONFIRM" : False,
"CONDITION" : False,},
]
groupDict = {"GROUP_NAME" : "VMWARE",
"DESCRIPTION" : "vCenter Config Parameters",
"PRE_CONDITION" : use_vcenter,
"PRE_CONDITION_MATCH" : True,
"POST_CONDITION" : False,
"POST_CONDITION_MATCH" : True}
controller.addGroup(groupDict, paramsList)
def initSequences(controller):
prescript_steps = [