diff --git a/lib/bootstrap.py b/lib/bootstrap.py index 7bd189c7000942d3b01f3e7b11152250c742f193..40da336adc380d5fd4172b1ac60f170e8dd59ad2 100644 --- a/lib/bootstrap.py +++ b/lib/bootstrap.py @@ -372,13 +372,13 @@ def InitCluster(cluster_name, mac_prefix, # pylint: disable=R0913, R0914 maintain_node_health=False, drbd_helper=None, uid_pool=None, default_iallocator=None, primary_ip_version=None, ipolicy=None, prealloc_wipe_disks=False, use_external_mip_script=False, - hv_state=None, disk_state=None, enabled_storage_types=None): + hv_state=None, disk_state=None, enabled_disk_templates=None): """Initialise the cluster. @type candidate_pool_size: int @param candidate_pool_size: master candidate pool size - @type enabled_storage_types: list of string - @param enabled_storage_types: list of storage types to be used in this + @type enabled_disk_templates: list of string + @param enabled_disk_templates: list of disk_templates to be used in this cluster """ @@ -396,14 +396,14 @@ def InitCluster(cluster_name, mac_prefix, # pylint: disable=R0913, R0914 " entries: %s" % invalid_hvs, errors.ECODE_INVAL) - if not enabled_storage_types: - raise errors.OpPrereqError("Enabled storage types list must contain at" + if not enabled_disk_templates: + raise errors.OpPrereqError("Enabled disk templates list must contain at" " least one member", errors.ECODE_INVAL) - invalid_storage_types = \ - set(enabled_storage_types) - constants.VALID_STORAGE_TYPES - if invalid_storage_types: - raise errors.OpPrereqError("Enabled storage_types contains invalid" - " entries: %s" % invalid_storage_types, + invalid_disk_templates = \ + set(enabled_disk_templates) - constants.DISK_TEMPLATES + if invalid_disk_templates: + raise errors.OpPrereqError("Enabled disk templates list contains invalid" + " entries: %s" % invalid_disk_templates, errors.ECODE_INVAL) try: @@ -634,7 +634,7 @@ def InitCluster(cluster_name, mac_prefix, # pylint: disable=R0913, R0914 ipolicy=full_ipolicy, hv_state_static=hv_state, disk_state_static=disk_state, - enabled_storage_types=enabled_storage_types, + enabled_disk_templates=enabled_disk_templates, ) master_node_config = objects.Node(name=hostname.name, primary_ip=hostname.ip, diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py index 21d5abb38543d8fd443584e32c871f49dd7828bc..652b5f497c071e3eec899eaee525d61601806409 100644 --- a/lib/client/gnt_cluster.py +++ b/lib/client/gnt_cluster.py @@ -226,7 +226,7 @@ def InitCluster(opts, args): use_external_mip_script=external_ip_setup_script, hv_state=hv_state, disk_state=disk_state, - enabled_storage_types=enabled_storage_types, + enabled_disk_templates=enabled_disk_templates, ) op = opcodes.OpClusterPostInit() SubmitOpCode(op, opts=opts) @@ -1507,7 +1507,7 @@ commands = { MAINTAIN_NODE_HEALTH_OPT, UIDPOOL_OPT, DRBD_HELPER_OPT, NODRBD_STORAGE_OPT, DEFAULT_IALLOCATOR_OPT, PRIMARY_IP_VERSION_OPT, PREALLOC_WIPE_DISKS_OPT, NODE_PARAMS_OPT, GLOBAL_SHARED_FILEDIR_OPT, USE_EXTERNAL_MIP_SCRIPT, - DISK_PARAMS_OPT, HV_STATE_OPT, DISK_STATE_OPT, ENABLED_STORAGE_TYPES_OPT] + DISK_PARAMS_OPT, HV_STATE_OPT, DISK_STATE_OPT, ENABLED_DISK_TEMPLATES_OPT] + INSTANCE_POLICY_OPTS, "[opts...] <cluster_name>", "Initialises a new cluster configuration"), "destroy": (