

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 配置
<a name="configuration"></a>

默认情况下， AWS ParallelCluster 使用该`~/.parallelcluster/config`文件作为所有配置参数。您可以使用 `-c` 或 `--config` 命令行选项或 `AWS_PCLUSTER_CONFIG_FILE` 环境变量指定自定义配置文件。

示例配置文件安装在 Python 目录 AWS ParallelCluster 中，网址为`site-packages/aws-parallelcluster/examples/config`。示例配置文件也可在 GitHub、上找到[https://github.com/aws/aws-parallelcluster/blob/v2.11.9/cli/src/pcluster/examples/config](https://github.com/aws/aws-parallelcluster/blob/v2.11.9/cli/src/pcluster/examples/config)。

当前 AWS ParallelCluster 2 个版本：2.11.9。

**Topics**
+ [布局](#layout)
+ [`[global]` 部分](global.md)
+ [`[aws]` 部分](aws.md)
+ [`[aliases]` 部分](aliases.md)
+ [`[cluster]` 部分](cluster-definition.md)
+ [`[compute_resource]` 部分](compute-resource-section.md)
+ [`[cw_log]` 部分](cw-log-section.md)
+ [`[dashboard]` 部分](dashboard-section.md)
+ [`[dcv]` 部分](dcv-section.md)
+ [`[ebs]` 部分](ebs-section.md)
+ [`[efs]` 部分](efs-section.md)
+ [`[fsx]` 部分](fsx-section.md)
+ [`[queue]` 部分](queue-section.md)
+ [`[raid]` 部分](raid-section.md)
+ [`[scaling]` 部分](scaling-section.md)
+ [`[vpc]` 部分](vpc-section.md)
+ [示例](examples.md)

## 布局
<a name="layout"></a>

 AWS ParallelCluster 配置在多个部分中定义。

以下部分是必需的：[`[global]` 部分](global.md)和 [`[aws]` 部分](aws.md)。

您还必须包含至少一个 [`[cluster]` 部分](cluster-definition.md)和一个 [`[vpc]` 部分](vpc-section.md)。

一个部分以方括号中的部分名称开头，后跟参数和配置。

```
[global]
cluster_template = default
update_check = true
sanity_check = true
```

# `[global]` 部分
<a name="global"></a>

指定与 `pcluster` 相关的全局配置选项。

```
[global]
```

**Topics**
+ [`cluster_template`](#cluster-template)
+ [`update_check`](#update-check)
+ [`sanity_check`](#sanity-check)

## `cluster_template`
<a name="cluster-template"></a>

定义默认用于集群的 `cluster` 部分的名称。有关 `cluster` 部分的更多信息，请参阅 [`[cluster]` 部分](cluster-definition.md)。集群名称必须以字母开头，不能超过 60 个字符，并且只能包含字母、数字和连字符 (-)。

例如，以下设置指定默认情况下使用 `[cluster default]` 开始的部分。

```
cluster_template = default
```

[更新策略：在更新期间不分析此设置。](using-pcluster-update.md#update-policy-setting-ignored)

## `update_check`
<a name="update-check"></a>

**（可选）**检查 `pcluster` 的更新。

默认值为 `true`。

```
update_check = true
```

[更新策略：在更新期间不分析此设置。](using-pcluster-update.md#update-policy-setting-ignored)

## `sanity_check`
<a name="sanity-check"></a>

**（可选）**尝试验证集群参数中定义的资源的配置。

默认值为 `true`。

**警告**  
如果 `sanity_check` 设置为 `false`，则跳过重要的检查。这可能会导致您的配置无法正常运行。

```
sanity_check = true
```

**注意**  
在 2.5.0 AWS ParallelCluster 版本之前，[`sanity_check`](#sanity-check)默认为。`false`

[更新策略：在更新期间不分析此设置。](using-pcluster-update.md#update-policy-setting-ignored)

# `[aws]` 部分
<a name="aws"></a>

**（可选）**用于选择 AWS 区域。

集群创建使用以下优先顺序 AWS 区域 为新集群选择：

1. [`pcluster create`](pluster.create.md) 的 `-r` 或 `--region` 参数。

1. `AWS_DEFAULT_REGION` 环境变量。

1. `aws_region_name`在 AWS ParallelCluster 配置文件`[aws]`部分进行设置（默认位置为`~/.parallelcluster/config`.） 这是由 [`pcluster configure`](pcluster.configure.md) 命令更新的位置。

1. `region`在 AWS CLI 配置文件`[default]`部分设置 (`~/.aws/config`.)

**注意**  
在 2.10.0 AWS ParallelCluster 版本之前，这些设置是必需的，并且适用于所有集群。

要存储证书，您可以使用环境、Amazon 的 IAM 角色或 EC2 [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html)，而不是将证书保存到 AWS ParallelCluster 配置文件中。

```
[aws]
aws_region_name = Region
```

[更新策略：在更新期间不分析此设置。](using-pcluster-update.md#update-policy-setting-ignored)

# `[aliases]` 部分
<a name="aliases"></a>

**Topics**

指定别名，并使您能够自定义 `ssh` 命令。

请注意以下默认设置：
+ `CFN_USER` 设置为操作系统的默认用户名
+ `MASTER_IP` 设置为头节点的 IP 地址
+ `ARGS` 设置为用户在 *`pcluster ssh cluster_name`* 之后提供的任何参数

```
[aliases]
# This is the aliases section, you can configure
# ssh alias here
ssh = ssh {CFN_USER}@{MASTER_IP} {ARGS}
```

[更新策略：在更新期间不分析此设置。](using-pcluster-update.md#update-policy-setting-ignored)

# `[cluster]` 部分
<a name="cluster-definition"></a>

定义可用于创建集群的集群模板。配置文件可以包含多个 `[cluster]` 部分。

可以使用同一个集群模板创建多个集群。

格式为 `[cluster cluster-template-name]`。默认情况下，使用由 [`[global]` 部分](global.md)中的 [`cluster_template`](global.md#cluster-template) 设置命名的 [`[cluster]` 部分](#cluster-definition)，但可以在 [`pcluster`](pcluster.md) 命令行上覆盖。

*cluster-template-name*必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

```
[cluster default]
```

**Topics**
+ [`additional_cfn_template`](#additional-cfn-template)
+ [`additional_iam_policies`](#additional-iam-policies)
+ [`base_os`](#base-os)
+ [`cluster_resource_bucket`](#cluster-resource-bucket-section)
+ [`cluster_type`](#cluster-type)
+ [`compute_instance_type`](#compute-instance-type)
+ [`compute_root_volume_size`](#compute-root-volume-size)
+ [`custom_ami`](#custom-ami-section)
+ [`cw_log_settings`](#cw-log-settings)
+ [`dashboard_settings`](#dashboard-settings)
+ [`dcv_settings`](#dcv-settings)
+ [`desired_vcpus`](#desired-vcpus)
+ [`disable_cluster_dns`](#disable-cluster-dns-settings)
+ [`disable_hyperthreading`](#disable-hyperthreading)
+ [`ebs_settings`](#ebs-settings)
+ [`ec2_iam_role`](#ec2-iam-role)
+ [`efs_settings`](#efs-settings)
+ [`enable_efa`](#enable-efa)
+ [`enable_efa_gdr`](#enable-efa-gdr)
+ [`enable_intel_hpc_platform`](#enable-intel-hpc-platform)
+ [`encrypted_ephemeral`](#encrypted-ephemeral)
+ [`ephemeral_dir`](#ephemeral-dir)
+ [`extra_json`](#extra-json)
+ [`fsx_settings`](#fsx-settings)
+ [`iam_lambda_role`](#iam-lambda-role)
+ [`initial_queue_size`](#configuration-initial-queue-size)
+ [`key_name`](#key-name)
+ [`maintain_initial_size`](#maintain-initial-size)
+ [`master_instance_type`](#master-instance-type)
+ [`master_root_volume_size`](#master-root-volume-size)
+ [`max_queue_size`](#configuration-max-queue-size)
+ [`max_vcpus`](#max-vcpus)
+ [`min_vcpus`](#min-vcpus)
+ [`placement`](#placement)
+ [`placement_group`](#placement-group)
+ [`post_install`](#post-install)
+ [`post_install_args`](#post-install-args)
+ [`pre_install`](#pre-install)
+ [`pre_install_args`](#pre-install-args)
+ [`proxy_server`](#proxy-server)
+ [`queue_settings`](#queue-settings)
+ [`raid_settings`](#raid-settings)
+ [`s3_read_resource`](#s3-read-resource)
+ [`s3_read_write_resource`](#s3-read-write-resource)
+ [`scaling_settings`](#scaling-settings)
+ [`scheduler`](#scheduler)
+ [`shared_dir`](#cluster-shared-dir)
+ [`spot_bid_percentage`](#spot-bid-percentage)
+ [`spot_price`](#spot-price)
+ [`tags`](#tags)
+ [`template_url`](#template-url)
+ [`vpc_settings`](#vpc-settings)

## `additional_cfn_template`
<a name="additional-cfn-template"></a>

**（可选）**定义要与集群一起启动的附加 AWS CloudFormation 模板。此附加模板用于创建存在于集群外部但属于集群生命周期一部分的资源。

值必须是指向公有模板的 HTTP URL，并提供所有参数。

没有默认值。

```
additional_cfn_template = https://<bucket-name>.s3.amazonaws.com/my-cfn-template.yaml
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `additional_iam_policies`
<a name="additional-iam-policies"></a>

**（可选）**指定 Amazon EC2 的 IAM 策略的 Amazon 资源名称 (ARN) 列表。除了 AWS ParallelCluster 所需的权限（以逗号分隔）之外，此列表也附加到集群中使用的根角色。IAM 策略名称及其 ARN 不相同。名称不能用作 `additional_iam_policies` 的参数。

如果您打算在集群节点的默认设置中添加额外的策略，我们建议您使用 `additional_iam_policies` 设置传递其他自定义 IAM 策略，而不是使用 [`ec2_iam_role`](#ec2-iam-role) 设置添加特定的 EC2 策略。这是因为`additional_iam_policies`已添加到 AWS ParallelCluster 所需的默认权限中。现有 [`ec2_iam_role`](#ec2-iam-role) 必须包含所需的所有权限。但是，随着功能的添加，不同版本之间所需的权限通常会有所不同，因此现有的 [`ec2_iam_role`](#ec2-iam-role) 可能会过时。

没有默认值。

```
additional_iam_policies = arn:aws:iam::123456789012:policy/CustomEC2Policy
```

**注意**  
在 AWS ParallelCluster 版本 2.5.0 中增加了对 [`additional_iam_policies`](#additional-iam-policies) 的支持。

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `base_os`
<a name="base-os"></a>

**（必需）**指定在集群中使用的操作系统类型。

可用的选项为：
+ `alinux2`
+ `centos7`
+ `ubuntu1804`
+ `ubuntu2004`

**注意**  
对于 AWS 基于 Graviton 的实例，仅`alinux2`支持`ubuntu1804`、或`ubuntu2004`。

**注意**  
在 2.11.4 AWS ParallelCluster 版本中删除`centos8`了对 Support 的支持。在 AWS ParallelCluster 版本 2.11.0 中增加了对 `ubuntu2004` 的支持，并删除了对 `alinux` 和 `ubuntu1604` 的支持。在 2.10.0 AWS ParallelCluster 版本中添加`centos8``centos6`了对的支持，并删除了对的支持。在 AWS ParallelCluster 版本 2.6.0 中增加了对 `alinux2` 的支持。在 AWS ParallelCluster 版本 2.5.0 中增加了对 `ubuntu1804` 的支持，并删除了对 `ubuntu1404` 的支持。

除下表中 AWS 区域 提到的具体内容外，其他不支持`centos7`。所有其他 AWS 商业区域都支持以下所有操作系统。


| 分区（AWS 区域） | `alinux2` | `centos7` | `ubuntu1804` 和 `ubuntu2004` | 
| --- | --- | --- | --- | 
| 商业（均 AWS 区域 未特别提及） | True | True | True | 
| AWS GovCloud （美国东部）(us-gov-east-1) | True | False | True | 
| AWS GovCloud （美国西部）(us-gov-west-1) | True | False | True | 
| 中国（北京） (cn-north-1) | True | False | True | 
| 中国（宁夏） (cn-northwest-1) | True | False | True | 

**注意**  
[`base_os`](#base-os) 参数还确定用于登录集群的用户名。
+ `centos7`: `centos` 
+ `ubuntu1804` 和 `ubuntu2004`：`ubuntu`
+ `alinux2`: `ec2-user` 

**注意**  
在 2.7.0 AWS ParallelCluster 版本之前，该[`base_os`](#base-os)参数是可选的，默认值为。`alinux`从 AWS ParallelCluster 版本 2.7.0 开始，[`base_os`](#base-os) 参数是必需的。

**注意**  
如果 [`scheduler`](#scheduler) 参数为 `awsbatch`，则仅支持 `alinux2`。

```
base_os = alinux2
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `cluster_resource_bucket`
<a name="cluster-resource-bucket-section"></a>

**（可选）**指定用于托管创建集群时生成的资源的 Amazon S3 存储桶的名称。桶必须启用版本控制。有关更多信息，请参阅 *Amazon Simple Storage Service 用户指南* 中的[使用版本控制](https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html)。此存储桶可用于多个集群。桶和集群必须位于同一区域中。

如果未指定此参数，则在创建集群时会创建新桶。新桶的名称为 `parallelcluster-random_string`。在这个名字中，*random\$1string*是一个由字母数字字符组成的随机字符串。所有集群资源都存储在此存储桶中，路径为：`bucket_name/resource_directory` `resource_directory`有形式`stack_name-random_string`，其中*stack\$1name*是使用的其中一个 CloudFormation 堆栈的名称。 AWS ParallelCluster的值*bucket\$1name*可以在`parallelcluster-clustername`堆栈输出的`ResourcesS3Bucket`值中找到。的值*resource\$1directory*可以在同一堆栈的`ArtifactS3RootDirectory`输出值中找到。

默认值为 `parallelcluster-random_string`。

```
cluster_resource_bucket = amzn-s3-demo-bucket
```

**注意**  
在 2.10.0 AWS ParallelCluster 版本中添加[`cluster_resource_bucket`](#cluster-resource-bucket-section)了对 Support 的支持。

[更新策略：如果更改此设置，则不允许更新。不能强制更新此设置。](using-pcluster-update.md#update-policy-read-only-resource-bucket)

## `cluster_type`
<a name="cluster-type"></a>

**（可选）**定义要启动的集群的类型。如果定义了 [`queue_settings`](#queue-settings) 设置，则必须在 [`[queue]` 部分](queue-section.md)中将此设置替换为 [`compute_type`](queue-section.md#queue-compute-type) 设置。

有效的选项为：`ondemand` 和 `spot`。

默认值为 `ondemand`。

有关竞价型实例的更多信息，请参阅[使用竞价型实例](spot.md)。

**注意**  
使用竞价型实例要求您的账户中存在 `AWSServiceRoleForEC2Spot` 服务相关角色。要使用在您的账户中创建此角色 AWS CLI，请运行以下命令：  

```
aws iam create-service-linked-role --aws-service-name spot.amazonaws.com
```
有关更多信息，请参阅《Amazon EC2 用户指南》**中的[竞价型实例请求的服务相关角色](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html#service-linked-roles-spot-instance-requests)。

```
cluster_type = ondemand
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `compute_instance_type`
<a name="compute-instance-type"></a>

**（可选）**定义用于集群计算节点的 Amazon EC2 实例类型。该实例类型的架构必须与用于 [`master_instance_type`](#master-instance-type) 设置的架构相同。如果定义了 [`queue_settings`](#queue-settings) 设置，则必须在 [`[compute_resource]` 部分](compute-resource-section.md)中将此设置替换为 [`instance_type`](compute-resource-section.md#compute-resource-instance-type) 设置。

如果您使用的是`awsbatch`调度程序，请参阅 AWS Batch 用户界面中创建的计算环境以获取支持的实例类型列表。

默认值为 `t2.micro`；当调度器为 `awsbatch` 时，为 `optimal`。

```
compute_instance_type = t2.micro
```

**注意**  
2.8.0 版本中增加了对 AWS 基于 Graviton 的`C6g`实例（包括`A1`和实例）的 AWS ParallelCluster 支持。

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `compute_root_volume_size`
<a name="compute-root-volume-size"></a>

**（可选）**以千兆字节 (GiB) 为单位指定 ComputeFleet 根卷大小。AMI 必须支持 `growroot`。

默认值为 `35`。

**注意**  
对于 2.5.0 和 2.10.4 之间的 AWS ParallelCluster 版本，默认值为 25。在 2.5.0 AWS ParallelCluster 版本之前，默认值为 20。

```
compute_root_volume_size = 35
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `custom_ami`
<a name="custom-ami-section"></a>

**（可选）**指定用于头节点和计算节点的自定义 AMI 的 ID，而不是默认[发布](https://github.com/aws/aws-parallelcluster/blob/v2.11.9/amis.txt)的 AMI AMIs。有关更多信息，请参阅 [修改 AMI](tutorials_02_ami_customization.md#modify-an-aws-parallelcluster-ami)或 [构建自定义 AWS ParallelCluster AMI](tutorials_02_ami_customization.md#build-a-custom-aws-parallelcluster-ami)。

没有默认值。

```
custom_ami = ami-00d4efc81188687a0
```

如果自定义 AMI 需要其他权限才能启动，则必须将这些权限添加到用户和头节点策略中。

例如，如果自定义 AMI 具有与之关联的加密快照，则用户和头节点策略中都需要以下其他策略：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:DescribeKey",
                "kms:ReEncrypt*",
                "kms:CreateGrant",
                "kms:Decrypt"
            ],
            "Resource": [
                "arn:aws:kms:us-east-1:111122223333:key/<AWS_KMS_KEY_ID>"
            ]
        }
    ]
}
```

------

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `cw_log_settings`
<a name="cw-log-settings"></a>

**（可选）**使用 CloudWatch 日志配置标识该`[cw_log]`部分。部分名称必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

有关更多信息，请参阅 [`[cw_log]` 部分](cw-log-section.md)、[亚马逊 CloudWatch 控制面板](cloudwatch-dashboard.md) 和 [与 Amazon CloudWatch 日志集成](cloudwatch-logs.md)。

例如，以下设置指定启动部分`[cw_log custom-cw]`用于 CloudWatch 日志配置。

```
cw_log_settings = custom-cw
```

**注意**  
在 2.6.0 AWS ParallelCluster 版本中添加[`cw_log_settings`](#cw-log-settings)了对 Support 的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `dashboard_settings`
<a name="dashboard-settings"></a>

**（可选）**使用 CloudWatch仪表板配置标识该`[dashboard]`部分。部分名称必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

有关更多信息，请参阅 [`[dashboard]` 部分](dashboard-section.md)。

例如，以下设置指定启动的部分`[dashboard custom-dashboard`用于 CloudWatch 仪表板配置。

```
dashboard_settings = custom-dashboard
```

**注意**  
在 2.10.0 AWS ParallelCluster 版本中添加[`dashboard_settings`](#dashboard-settings)了对 Support 的支持。

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `dcv_settings`
<a name="dcv-settings"></a>

**（可选）**使用 Amazon DCV 配置标识 `[dcv]` 部分。部分名称必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

有关更多信息，请参阅 [`[dcv]` 部分](dcv-section.md)。

例如，以下设置指定将以 `[dcv custom-dcv]` 开始的部分用于 Amazon DCV 配置。

```
dcv_settings = custom-dcv
```

**注意**  
在 AWS 基于 Graviton 的实例上，仅支持 Amazon DCV。`alinux2`

**注意**  
在 2.5.0 AWS ParallelCluster 版本中添加[`dcv_settings`](#dcv-settings)了对 Support 的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `desired_vcpus`
<a name="desired-vcpus"></a>

**（可选）**指定计算环境CPUs 中所需的 v 数。仅在调度器为 `awsbatch` 时使用。

默认值为 `4`。

```
desired_vcpus = 4
```

[更新策略：在更新期间不分析此设置。](using-pcluster-update.md#update-policy-setting-ignored)

## `disable_cluster_dns`
<a name="disable-cluster-dns-settings"></a>

**（可选）**指定是否不应为集群创建 DNS 条目。默认情况下， AWS ParallelCluster 会创建 Route 53 托管区域。如果 `disable_cluster_dns` 设置为 `true`，则不会创建托管区。

默认值为 `false`。

```
disable_cluster_dns = true
```

**警告**  
集群需要名称解析系统才能正常运行。如果 `disable_cluster_dns` 设置为 `true`，则还必须提供其他名称解析系统。

**重要**  
只有在指定了 [`queue_settings`](#queue-settings) 设置时才支持 [`disable_cluster_dns`](#disable-cluster-dns-settings) = `true`。

**注意**  
在 2.9.1 AWS ParallelCluster 版本中增加了对 Support 的支持。[`disable_cluster_dns`](#disable-cluster-dns-settings)

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `disable_hyperthreading`
<a name="disable-hyperthreading"></a>

**（可选）**禁用头节点和计算节点上的超线程。并非所有实例类型都可以禁用超线程。有关支持禁用超线程的实例类型列表，请参阅《Amazon EC2 用户指南》**中的[每种实例类型的 CPU 内核以及每个 CPU 内核的线程](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values)。如果定义了 [`queue_settings`](#queue-settings) 设置，则可以定义此设置，也可以定义 [`[queue]` 部分](queue-section.md)中的 [`disable_hyperthreading`](queue-section.md#queue-disable-hyperthreading) 设置。

默认值为 `false`。

```
disable_hyperthreading = true
```

**注意**  
[`disable_hyperthreading`](#disable-hyperthreading) 仅在 `scheduler = awsbatch` 时影响头节点。

**注意**  
在 AWS ParallelCluster 版本 2.5.0 中增加了对 [`disable_hyperthreading`](#disable-hyperthreading) 的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `ebs_settings`
<a name="ebs-settings"></a>

**（可选）**使用头节点上挂载的 Amazon EBS 卷标识 `[ebs]` 部分。使用多个 Amazon EBS 卷时，请以列表形式输入这些参数，用逗号分隔每个参数。部分名称必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

支持最多五 (5) 个额外的 Amazon EBS 卷。

有关更多信息，请参阅 [`[ebs]` 部分](ebs-section.md)。

例如，以下设置指定将以 `[ebs custom1]` 和 `[ebs custom2]` 开始的部分用于 Amazon EBS 卷。

```
ebs_settings = custom1, custom2
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `ec2_iam_role`
<a name="ec2-iam-role"></a>

**（可选）**定义将附加到集群中所有实例的 Amazon EC2 的现有 IAM 角色的名称。IAM 角色名称与其 Amazon 资源名称 (ARN) 不同。 ARNs 不能用作论据`ec2_iam_role`。

如果指定了此选项，则忽略 [`additional_iam_policies`](#additional-iam-policies) 设置。如果您打算在集群节点的默认设置中添加额外的策略，我们建议您使用 [`additional_iam_policies`](#additional-iam-policies) 设置传递其他自定义 IAM 策略，而不是使用 `ec2_iam_role` 设置。

如果未指定此选项，则使用 Amazon EC2 的默认 AWS ParallelCluster IAM 角色。有关更多信息，请参阅 [AWS Identity and Access Management 中的角色 AWS ParallelCluster](iam.md)。

没有默认值。

```
ec2_iam_role = ParallelClusterInstanceRole
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `efs_settings`
<a name="efs-settings"></a>

**（可选）**指定与 Amazon EFS 文件系统相关的设置。部分名称必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

有关更多信息，请参阅 [`[efs]` 部分](efs-section.md)。

例如，以下设置指定将以 `[efs customfs]` 开始的部分用于 Amazon EFS 文件系统配置。

```
efs_settings = customfs
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `enable_efa`
<a name="enable-efa"></a>

**（可选）**如果存在，则指定为计算节点启用 Elastic Fabric Adapter (EFA)。要查看支持 EFA 的 EC2 实例的列表，请参阅 *Amazon EC2 用户指南（适用于 Linux 实例）*中的[支持的实例类型](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html#efa-instance-types)。有关更多信息，请参阅 [Elastic Fabric Adapter](efa.md)。如果定义了 [`queue_settings`](#queue-settings) 设置，则可以定义此设置，也可以定义 [`[queue]` 部分](queue-section.md)中的 [`enable_efa`](queue-section.md#queue-enable-efa) 设置。应使用集群置放群组来最大限度地减少实例之间的延迟。有关更多信息，请参阅[`placement`](#placement)和[`placement_group`](#placement-group)。

```
enable_efa = compute
```

**注意**  
在 2.10.1 版本中，在基于 ARM 的 Graviton2 实例上增加了对 EFA 的支持。 AWS ParallelCluster 

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `enable_efa_gdr`
<a name="enable-efa-gdr"></a>

**（可选）**从 2.11.3 AWS ParallelCluster 版本开始，此设置无效。如果实例类型和操作系统都支持 GPUDirect Elastic Fabric Adapter (EFA)，则始终启用对 RDMA（远程直接内存访问）的支持。

**注意**  
AWS ParallelCluster 版本 2.10.0 到 2.11.2：如果`compute`，则指定计算节点启用弹性结构适配器 (EFA) 对 GPUDirect RDMA（远程直接内存访问）的支持。将此设置设置为 `compute` 需要先将 [`enable_efa`](#enable-efa) 设置设为 `compute`。特定操作系统（是`alinux2`、`centos7`、或 `p4d.24xlarge``ubuntu2004`）上的特定实例类型 () 支持对 GPUDirect RDMA [`base_os`](#base-os) 的 EFA 支持。`ubuntu1804`如果定义了 [`queue_settings`](#queue-settings) 设置，则可以定义此设置，也可以定义 [`[queue]` 部分](queue-section.md)中的 [`enable_efa_gdr`](queue-section.md#queue-enable-efa-gdr) 设置。应使用集群置放群组来最大限度地减少实例之间的延迟。有关更多信息，请参阅[`placement`](#placement)和[`placement_group`](#placement-group)。

```
enable_efa_gdr = compute
```

**注意**  
在 2.10.0 AWS ParallelCluster 版本中添加`enable_efa_gdr`了对 Support 的支持。

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `enable_intel_hpc_platform`
<a name="enable-intel-hpc-platform"></a>

**（可选）**如果存在，则表示接受 Intel Parallel Studio 的[最终用户许可协议](https://software.intel.com/en-us/articles/end-user-license-agreement)。这将导致 Intel Parallel Studio 安装在头节点上并与计算节点共享。这使头节点进行引导的时间增加了几分钟。仅 CentOS 7 ([`base_os`](#base-os)` = centos7`) 上支持 [`enable_intel_hpc_platform`](#enable-intel-hpc-platform) 设置。

默认值为 `false`。

```
enable_intel_hpc_platform = true
```

**注意**  
该[`enable_intel_hpc_platform`](#enable-intel-hpc-platform)参数与基于 AWS Graviton 的实例不兼容。

**注意**  
在 AWS ParallelCluster 版本 2.5.0 中增加了对 [`enable_intel_hpc_platform`](#enable-intel-hpc-platform) 的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `encrypted_ephemeral`
<a name="encrypted-ephemeral"></a>

**（可选）**使用 LUKS (Linux Unified Key Setup)，通过无法恢复的内存中密钥对临时实例存储卷进行加密。

有关更多信息，请参阅 [https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md](https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md)。

默认值为 `false`。

```
encrypted_ephemeral = true
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `ephemeral_dir`
<a name="ephemeral-dir"></a>

**（可选）**定义实例存储卷（如果使用）的挂载路径。

默认值为 `/scratch`。

```
ephemeral_dir = /scratch
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `extra_json`
<a name="extra-json"></a>

**（可选）**定义合并到 Chef `dna.json` 中的额外 JSON。有关更多信息，请参阅 [构建自定义 AWS ParallelCluster AMI](tutorials_02_ami_customization.md)。

默认值为 `{}`。

```
extra_json = {}
```

**注意**  
从 AWS ParallelCluster 版本 2.6.1 开始，启动节点时默认会跳过大多数安装配方，以缩短启动时间。要以牺牲启动时间为代价运行所有安装食谱以获得更好的向后兼容性，请将 `"skip_install_recipes" : "no"` 添加到 [`extra_json`](#extra-json) 设置中的 `cluster` 键。例如：  

```
extra_json = { "cluster" : { "skip_install_recipes" : "no" } }
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `fsx_settings`
<a name="fsx-settings"></a>

**（可选）**指定定义 for Lustre 配置 FSx 的部分。部分名称必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

有关更多信息，请参阅 [`[fsx]` 部分](fsx-section.md)。

例如，以下设置指定启动部分用`[fsx fs]`于 for Lustre 配置。 FSx 

```
fsx_settings = fs
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `iam_lambda_role`
<a name="iam-lambda-role"></a>

**（可选）**定义现有 AWS Lambda 执行角色的名称。此角色附加到集群中所有 Lambda 函数。有关更多信息，请参阅*AWS Lambda 开发人员指南* 中的 [AWS Lambda 执行角色](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html)。

**注意**  
从 2.11.5 版开始， AWS ParallelCluster 不支持使用SGE或Torque调度程序。

IAM 角色名称与其 Amazon 资源名称 (ARN) 不同。 ARNs 不能用作论据`iam_lambda_role`。如果同时定义了 [`ec2_iam_role`](#ec2-iam-role) 和 `iam_lambda_role`，并且 [`scheduler`](#scheduler) 是 `sge`、`slurm` 或 `torque`，则不会创建任何角色。如果 [`scheduler`](#scheduler) 是 `awsbatch`，则在 [`pcluster start`](pcluster.start.md) 期间将创建角色。有关示例策略，请参阅 [使用 SGE、Slurm 或 Torque 的 `ParallelClusterLambdaPolicy`](iam.md#parallelcluster-lambda-policy) 和 [使用 `awsbatch` 的 `ParallelClusterLambdaPolicy`](iam.md#parallelcluster-lambda-policy-batch)。

没有默认值。

```
iam_lambda_role = ParallelClusterLambdaRole
```

**注意**  
在 2.10.1 AWS ParallelCluster 版本中增加了对 Support 的支持。`iam_lambda_role`

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `initial_queue_size`
<a name="configuration-initial-queue-size"></a>

**（可选）**设置要作为集群中的计算节点启动的 Amazon EC2 实例的初始数量。如果定义了 [`queue_settings`](#queue-settings) 设置，则必须在 [`[compute_resource]` 部分](compute-resource-section.md)中删除此设置并替换为 [`initial_count`](compute-resource-section.md#compute-resource-initial-count) 设置。

**注意**  
从 2.11.5 版开始， AWS ParallelCluster 不支持使用SGE或Torque调度程序。

此设置仅适用于传统调度器（SGE、Slurm 和 Torque）。如果 [`maintain_initial_size`](#maintain-initial-size) 设置为 `true`，则 [`initial_queue_size`](#configuration-initial-queue-size) 设置必须至少为一 (1)。

如果调度器是 `awsbatch`，请改用 [`min_vcpus`](#min-vcpus)。

默认值为 `2`。

```
initial_queue_size = 2
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `key_name`
<a name="key-name"></a>

**（可选）**用于启用对实例进行的 SSH 访问的现有 Amazon EC2 密钥对的名称。

```
key_name = mykey
```

**注意**  
在 2.11.0 AWS ParallelCluster 版本之前，`key_name`是必需的设置。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `maintain_initial_size`
<a name="maintain-initial-size"></a>

**注意**  
从 2.11.5 版开始， AWS ParallelCluster 不支持使用SGE或Torque调度程序。

**（可选）**为传统的调度器（SGE、Slurm 和 Torque）保持自动扩缩组的初始大小。

如果调度器是 `awsbatch`，请改用 [`desired_vcpus`](#desired-vcpus)。

此设置是一个布尔标记。如果设置为 `true`，则自动扩缩组的成员数永远不会少于 [`initial_queue_size`](#configuration-initial-queue-size) 的值，并且 [`initial_queue_size`](#configuration-initial-queue-size) 的值必须为一 (1) 或更大。集群仍可以扩展到 [`max_queue_size`](#configuration-max-queue-size) 的值。如果为 `cluster_type = spot`，则自动扩缩组的实例可能会中断，并且大小可能降至 [`initial_queue_size`](#configuration-initial-queue-size) 以下。

如果设置为 `false`，则自动扩缩组的成员数可以缩减为零 (0)，以防止在不需要资源时闲置。

如果定义了 [`queue_settings`](#queue-settings) 设置，则必须在 [`[compute_resource]` 部分](compute-resource-section.md)中删除此设置并替换为 [`initial_count`](compute-resource-section.md#compute-resource-initial-count) 和 [`min_count`](compute-resource-section.md#compute-resource-min-count) 设置。

默认值为 `false`。

```
maintain_initial_size = false
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `master_instance_type`
<a name="master-instance-type"></a>

**（可选）**定义用于头节点的 Amazon EC2 实例类型。该实例类型的架构必须与用于 [`compute_instance_type`](#compute-instance-type) 设置的架构相同。

如果有免费套餐，则默认为免费套餐实例类型（`t2.micro`或`t3.micro`）。 AWS 区域 其中 AWS 区域 没有免费套餐，默认为`t3.micro`。有关 AWS 免费套餐的更多信息，请参阅[AWS 免费套餐 FAQs](https://aws.amazon.com/free/free-tier-faqs/)。

```
master_instance_type = t2.micro
```

**注意**  
在 2.10.1 AWS ParallelCluster 版本之前，全部默认为。`t2.micro` AWS 区域在 AWS ParallelCluster 版本2.10.0 中，头节点不支持 `p4d.24xlarge`。2.8.0 版本中增加了对 AWS 基于 Graviton 的实例（例如`A1`和`C6g`）的 AWS ParallelCluster 支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `master_root_volume_size`
<a name="master-root-volume-size"></a>

**（可选）**指定头节点根卷大小，以吉字节 (GiB) 为单位。AMI 必须支持 `growroot`。

默认值为 `35`。

**注意**  
对于 2.5.0 和 2.10.4 之间的 AWS ParallelCluster 版本，默认值为 25。在 2.5.0 AWS ParallelCluster 版本之前，默认值为 20。

```
master_root_volume_size = 35
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `max_queue_size`
<a name="configuration-max-queue-size"></a>

**（可选）**设置集群中可以启动的 Amazon EC2 实例的最大数量。如果定义了 [`queue_settings`](#queue-settings) 设置，则必须在 [`[compute_resource]` 部分](compute-resource-section.md)中删除此设置并替换为 [`max_count`](compute-resource-section.md#compute-resource-max-count) 设置。

**注意**  
从 2.11.5 版开始， AWS ParallelCluster 不支持使用SGE或Torque调度程序。

此设置仅适用于传统调度器（SGE、Slurm 和 Torque）。

如果调度器是 `awsbatch`，请改用 [`max_vcpus`](#max-vcpus)。

默认值为 `10`。

```
max_queue_size = 10
```

更新策略：可以在更新期间更改此设置，但如果该值降低，则应停止计算实例集。否则，现有节点可能会被终止。

## `max_vcpus`
<a name="max-vcpus"></a>

**（可选）**指定计算环境CPUs 中 v 的最大数量。仅在调度器为 `awsbatch` 时使用。

默认值为 `20`。

```
max_vcpus = 20
```

[更新策略：更新期间不能减小此设置。](using-pcluster-update.md#update-policy-no-decrease)

## `min_vcpus`
<a name="min-vcpus"></a>

**（可选）**为 `awsbatch` 调度器保持自动扩缩组的初始大小。

**注意**  
从 2.11.5 版开始， AWS ParallelCluster 不支持使用SGE或Torque调度程序。

如果调度器是 SGE、Slurm 或 Torque，请改用 [`maintain_initial_size`](#maintain-initial-size)。

计算环境中的成员数绝不会少于 [`min_vcpus`](#min-vcpus) 的值。

默认值为 `0`。

```
min_vcpus = 0
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `placement`
<a name="placement"></a>

**（可选）**定义集群置放群组逻辑，并使整个集群或仅计算实例能够使用集群置放群组。

如果定义了 [`queue_settings`](#queue-settings) 设置，则对每个 [`[queue]` 部分](queue-section.md)，应删除此设置并替换为 [`placement_group`](queue-section.md#queue-placement-group) 设置。如果将同一个置放群组用于不同的实例类型，则请求更有可能因容量不足错误而失败。有关更多信息，请参阅《Amazon EC2 用户指南》**中的[实例容量不足](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/troubleshooting-launch.html#troubleshooting-launch-capacity)。只有事先创建了置放群组并在每个队列的 [`placement_group`](queue-section.md#queue-placement-group) 设置中进行了配置，多个队列才能共享该置放群组。如果每个 [`[queue]` 部分](queue-section.md)都定义了 [`placement_group`](queue-section.md#queue-placement-group) 设置，则头节点不能位于队列的置放群组中。

有效选项是 `cluster` 或 `compute`。

当调度器为 `awsbatch` 时，不使用此参数。

默认值为 `compute`。

```
placement = compute
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `placement_group`
<a name="placement-group"></a>

**（可选）**定义集群置放群组。如果定义了 [`queue_settings`](#queue-settings) 设置，则应在 [`[queue]` 部分](queue-section.md)中删除此设置并替换为 [`placement_group`](queue-section.md#queue-placement-group) 设置。

有效选项为以下值：
+ `DYNAMIC`
+ 现有的 Amazon EC2 集群置放群组名称

当设置为 `DYNAMIC` 时，将唯一置放群组作为集群堆栈的一部分进行创建和删除。

当调度器为 `awsbatch` 时，不使用此参数。

有关置放群组的更多信息，请参阅《Amazon EC2 用户指南》**中的[置放群组](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html)。如果将同一个置放群组用于不同的实例类型，则请求更有可能因容量不足错误而失败。有关更多信息，请参阅《Amazon EC2 用户指南》**中的[实例容量不足](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/troubleshooting-launch.html#troubleshooting-launch-capacity)。

没有默认值。

并非所有实例类型都支持集群置放群组。例如，`t3.micro` 的默认实例类型不支持集群置放群组。有关支持集群置放群组的实例类型列表的信息，请参阅《Amazon EC2 用户指南》**中的[集群置放群组规则和限制](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#placement-groups-limitations-cluster)。有关使用置放群组时的提示，请参阅[置放群组和实例启动问题](troubleshooting.md#placement-groups-and-instance-launch-issues)。

```
placement_group = DYNAMIC
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `post_install`
<a name="post-install"></a>

**（可选）**指定在所有节点引导操作完成后运行的安装后脚本的 URL。有关更多信息，请参阅 [自定义引导操作](pre_post_install.md)。

当使用 `awsbatch` 作为调度器时，安装后脚本仅在头节点上运行。

参数格式可以是 `http://hostname/path/to/script.sh` 或 `s3://bucket-name/path/to/script.sh`。

没有默认值。

```
post_install = s3://<bucket-name>/my-post-install-script.sh
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `post_install_args`
<a name="post-install-args"></a>

**（可选）**指定要传递到安装后脚本的用双引号引起的参数列表。

没有默认值。

```
post_install_args = "argument-1 argument-2"
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `pre_install`
<a name="pre-install"></a>

**（可选）**指定在启动任何节点部署引导操作之前运行的预安装脚本的 URL。有关更多信息，请参阅 [自定义引导操作](pre_post_install.md)。

当使用 `awsbatch` 作为调度器时，预安装脚本仅在头节点上运行。

参数格式可以是 `http://hostname/path/to/script.sh` 或 `s3://bucket-name/path/to/script.sh`。

没有默认值。

```
pre_install = s3://bucket-name/my-pre-install-script.sh
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `pre_install_args`
<a name="pre-install-args"></a>

**（可选）**指定要传递到预安装脚本的用双引号引起的参数列表。

没有默认值。

```
pre_install_args = "argument-3 argument-4"
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `proxy_server`
<a name="proxy-server"></a>

**（可选）**定义 HTTP 或 HTTPS 代理服务器，通常为 `http://x.x.x.x:8080`。

没有默认值。

```
proxy_server = http://10.11.12.13:8080
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `queue_settings`
<a name="queue-settings"></a>

**（可选）**指定集群使用队列而不是同构计算队列，以及使用哪些[`[queue]`部分](queue-section.md)。列出的第一个 [`[queue]` 部分](queue-section.md)是默认的调度器队列。`queue` 部分名称必须以小写字母开头，不能超过 30 个字符，并且只能包含小写字母、数字和连字符 (-)。

**重要**  
仅在 [`scheduler`](#scheduler) 设置为 `slurm` 时支持 [`queue_settings`](#queue-settings)。不得指定 [`cluster_type`](#cluster-type)、[`compute_instance_type`](#compute-instance-type)、[`initial_queue_size`](#configuration-initial-queue-size)、[`maintain_initial_size`](#maintain-initial-size)、[`max_queue_size`](#configuration-max-queue-size)、[`placement`](#placement)、[`placement_group`](#placement-group) 和 [`spot_price`](#spot-price) 设置。[`disable_hyperthreading`](#disable-hyperthreading) 和 [`enable_efa`](#enable-efa) 设置既可以在 [`[cluster]` 部分](#cluster-definition)中指定，也可以在 [`[queue]` 部分](queue-section.md)中指定，但不能同时在这些部分中指定。

最多支持五 (5) 个 [`[queue]` 部分](queue-section.md)。

有关更多信息，请参阅 [`[queue]` 部分](queue-section.md)。

例如，以下设置指定使用以 `[queue q1]` 和 `[queue q2]` 开始的部分。

```
queue_settings = q1, q2
```

**注意**  
在 2.9.0 AWS ParallelCluster 版本中添加[`queue_settings`](#queue-settings)了对 Support 的支持。

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `raid_settings`
<a name="raid-settings"></a>

**（可选）**使用 Amazon EBS 卷 RAID 配置标识 `[raid]` 部分。部分名称必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

有关更多信息，请参阅 [`[raid]` 部分](raid-section.md)。

例如，以下设置指定将以 `[raid rs]` 开始的部分用于自动扩缩配置。

```
raid_settings = rs
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `s3_read_resource`
<a name="s3-read-resource"></a>

**（可选）**指定向 AWS ParallelCluster 节点授予只读访问权限的 Amazon S3 资源。

例如，`arn:aws:s3:::my_corporate_bucket*`提供对*my\$1corporate\$1bucket*存储桶和存储桶中对象的只读访问权限。

有关格式的详细信息，请参阅[使用 Amazon S3](s3_resources.md)。

没有默认值。

```
s3_read_resource = arn:aws:s3:::my_corporate_bucket*
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `s3_read_write_resource`
<a name="s3-read-write-resource"></a>

**（可选）**指定向 AWS ParallelCluster 节点授予 read/write 访问权限的 Amazon S3 资源。

例如，`arn:aws:s3:::my_corporate_bucket/Development/*`提供对*my\$1corporate\$1bucket*存储桶`Development`文件夹中所有对象的 read/write 访问权限。

有关格式的详细信息，请参阅[使用 Amazon S3](s3_resources.md)。

没有默认值。

```
s3_read_write_resource = arn:aws:s3:::my_corporate_bucket/*
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `scaling_settings`
<a name="scaling-settings"></a>

使用自动扩缩配置标识 `[scaling]` 部分。部分名称必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

有关更多信息，请参阅 [`[scaling]` 部分](scaling-section.md)。

例如，以下设置指定将以 `[scaling custom]` 开始的部分用于自动扩缩配置。

```
scaling_settings = custom
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `scheduler`
<a name="scheduler"></a>

**（必需）**定义集群调度器。

有效选项为以下值：

`awsbatch`  
AWS Batch  
有关 `awsbatch` 调度器的更多信息，请参阅[联网设置](networking.md#awsbatch-networking)和 [AWS Batch (`awsbatch`)](awsbatchcli.md)。

`sge`  
从 2.11.5 版开始， AWS ParallelCluster 不支持使用SGE或Torque调度程序。
Son of Grid Engine (SGE)

`slurm`  
Slurm Workload Manager (Slurm)

`torque`  
从 2.11.5 版开始， AWS ParallelCluster 不支持使用SGE或Torque调度程序。
Torque Resource Manager (Torque)

**注意**  
在 2.7.0 AWS ParallelCluster 版本之前，该`scheduler`参数是可选的，默认值为。`sge`从 2.7.0 AWS ParallelCluster 版开始，该`scheduler`参数为必填项。

```
scheduler = slurm
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `shared_dir`
<a name="cluster-shared-dir"></a>

**（可选）**定义共享 Amazon EBS 卷的挂载路径。

请勿将此选项与多个 Amazon EBS 卷一起使用。相反，在每个 [`[ebs]` 部分](ebs-section.md)下提供 [`shared_dir`](#cluster-shared-dir) 值。

有关使用多个 Amazon EBS 卷的详细信息，请参阅 [`[ebs]` 部分](ebs-section.md)。

默认值为 `/shared`。

以下示例显示一个在 `/myshared` 上挂载的共享 Amazon EBS 卷。

```
shared_dir = myshared
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `spot_bid_percentage`
<a name="spot-bid-percentage"></a>

**（可选）**设置按需百分比，用于计算计划程序的最高竞价价格。 ComputeFleet `awsbatch`

如果未指定，则选择当前 Spot 市场价格，最高为按需价格。

```
spot_bid_percentage = 85
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `spot_price`
<a name="spot-price"></a>

**注意**  
从 2.11.5 版开始， AWS ParallelCluster 不支持使用SGE或Torque调度程序。

**（可选）**为传统调度程序（SGESlurm、和Torque）设置最高竞价价格。 ComputeFleet 仅当 [`cluster_type`](#cluster-type) 设置设为 `spot` 时使用。如果您不指定值，则按 Spot 价格进行收费，最高为按需价格。如果定义了 [`queue_settings`](#queue-settings) 设置，则必须在 [`[compute_resource]` 部分](compute-resource-section.md)中删除此设置并替换为 [`spot_price`](compute-resource-section.md#compute-resource-spot-price) 设置。

如果计划程序为 `awsbatch`，请改用 [spot\$1bid\$1percentage](#spot-bid-percentage)。

有关查找满足您需求的竞价型实例的帮助，请参阅[竞价型实例顾问](https://aws.amazon.com/ec2/spot/instance-advisor/)。

```
spot_price = 1.50
```

**注意**  
在 AWS ParallelCluster 版本 2.5.0 中，如果[`spot_price`](#spot-price)未指定`cluster_type = spot`但未指定，则实例启动 ComputeFleet 失败。此问题已在 2.5.1 AWS ParallelCluster 版本中修复。

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `tags`
<a name="tags"></a>

**（可选）**定义要使用的标签 CloudFormation。

如果通过 *--tags* 指定了命令行标签，则它们将与配置标签合并。

命令行标签覆盖具有相同键的配置标签。

标签是 JSON 格式的。请勿在大括号外使用引号。

有关更多信息，请参阅 *AWS CloudFormation 用户指南* 中的[CloudFormation 资源标签类型](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html)。

```
tags = {"key" : "value", "key2" : "value2"}
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

**注意**  
更新策略不支持更改 AWS ParallelCluster 版本 2.8.0 到版本 2.9.1 的 `tags` 设置。  
对于版本 2.10.0 到版本 2.11.7，列出的支持更改 `tags` 设置的更新策略不准确。不支持修改此设置时进行集群更新。

## `template_url`
<a name="template-url"></a>

**（可选）**定义用于创建集群的 AWS CloudFormation 模板的路径。

更新使用最初用于创建堆栈的模板。

默认值为 `https://aws_region_name-aws-parallelcluster.s3.amazonaws.com/templates/aws-parallelcluster-version.cfn.json`。

**警告**  
这是一个高级参数。对此设置进行任何更改需自行承担风险。

```
template_url = https://us-east-1-aws-parallelcluster.s3.amazonaws.com/templates/aws-parallelcluster-2.11.9.cfn.json
```

[更新策略：在更新期间不分析此设置。](using-pcluster-update.md#update-policy-setting-ignored)

## `vpc_settings`
<a name="vpc-settings"></a>

**（必需）**使用将在其中部署集群的 Amazon VPC 配置标识 `[vpc]` 部分。部分名称必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

有关更多信息，请参阅 [`[vpc]` 部分](vpc-section.md)。

例如，以下设置指定将以 `[vpc public]` 开始的部分用于 Amazon VPC 配置。

```
vpc_settings = public
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

# `[compute_resource]` 部分
<a name="compute-resource-section"></a>

定义计算资源的配置设置。[`[compute_resource]` 部分](#compute-resource-section)由 [`[queue]` 部分](queue-section.md)中的 [`compute_resource_settings`](queue-section.md#queue-compute-resource-settings) 设置引用。只有当 [`scheduler`](cluster-definition.md#scheduler) 设置为 `slurm` 时，才支持 [`[compute_resource]` 部分](#compute-resource-section)。

格式为`[compute_resource <compute-resource-name>]`。 *compute-resource-name*必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

```
[compute_resource cr1]
instance_type = c5.xlarge
min_count = 0
initial_count = 2
max_count = 10
spot_price = 0.5
```

**注意**  
2.9.0 AWS ParallelCluster 版本中增加了对该[`[compute_resource]`部分](#compute-resource-section)的支持。

**Topics**
+ [`initial_count`](#compute-resource-initial-count)
+ [`instance_type`](#compute-resource-instance-type)
+ [`max_count`](#compute-resource-max-count)
+ [`min_count`](#compute-resource-min-count)
+ [`spot_price`](#compute-resource-spot-price)

## `initial_count`
<a name="compute-resource-initial-count"></a>

**（可选）**设置要为此计算资源启动的 Amazon EC2 实例的初始数量。至少在计算资源中启动了这么多节点之后，集群创建才会完成。如果队列的 [`compute_type`](queue-section.md#queue-compute-type) 设置为 `spot`，并且没有足够的竞价型实例可用，则集群创建可能会超时并失败。任何大于 [`min_count`](#compute-resource-min-count) 设置的计数均为受 [`scaledown_idletime`](scaling-section.md#scaledown-idletime) 设置控制的动态容量。该设置替代 [`initial_queue_size`](cluster-definition.md#configuration-initial-queue-size) 设置。

默认值为 `0`。

```
initial_count = 2
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `instance_type`
<a name="compute-resource-instance-type"></a>

**（必需）**定义用于此计算资源的 Amazon EC2 实例类型。该实例类型的架构必须与用于 [`master_instance_type`](cluster-definition.md#master-instance-type) 设置的架构相同。对于 [`[queue]` 部分](queue-section.md)引用的每个 [`[compute_resource]` 部分](#compute-resource-section)，`instance_type` 设置必须是唯一的。该设置替代 [`compute_instance_type`](cluster-definition.md#compute-instance-type) 设置。

```
instance_type = t2.micro
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `max_count`
<a name="compute-resource-max-count"></a>

**（可选）**设置可在该计算资源中启动的 Amazon EC2 实例的最大数量。任何大于 [`initial_count`](#compute-resource-initial-count) 设置的计数都将在关闭模式下启动。该设置替代 [`max_queue_size`](cluster-definition.md#configuration-max-queue-size) 设置。

默认值为 `10`。

```
max_count = 10
```

[更新策略：要将队列大小减至当前节点数以下，需要先停止计算实例集。](using-pcluster-update.md#update-policy-max-count)

**注意**  
在 AWS ParallelCluster 版本 2.0.0 到 2.9.1 的计算队列停止之前，更新策略不支持更改`max_count`设置。

## `min_count`
<a name="compute-resource-min-count"></a>

**（可选）**设置可以在此计算资源中启动的 Amazon EC2 实例的最小数量。这些节点均为静态容量。至少在计算资源中启动了此数量的节点之后，集群创建才会完成。

默认值为 `0`。

```
min_count = 1
```

[更新策略：减少队列中静态节点的数量需要先停止计算实例集。](using-pcluster-update.md#update-policy-min-count)

**注意**  
在 AWS ParallelCluster 版本 2.0.0 到 2.9.1 的计算队列停止之前，更新策略不支持更改`min_count`设置。

## `spot_price`
<a name="compute-resource-spot-price"></a>

**（可选）**设置此计算资源的最高竞价价格。仅当包含此计算资源的队列的 [`compute_type`](queue-section.md#queue-compute-type) 设置设为 `spot` 时才使用。该设置替代 [`spot_price`](cluster-definition.md#spot-price) 设置。

如果您不指定值，则按竞价价格进行收费，最高为按需价格。

有关查找满足您需求的竞价型实例的帮助，请参阅[竞价型实例顾问](https://aws.amazon.com/ec2/spot/instance-advisor/)。

```
spot_price = 1.50
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

# `[cw_log]` 部分
<a name="cw-log-section"></a>

定义 CloudWatch 日志的配置设置。

格式为`[cw_log cw-log-name]`。 *cw-log-name*必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

```
[cw_log custom-cw-log]
enable = true
retention_days = 14
```

有关更多信息，请参阅[与 Amazon CloudWatch 日志集成](cloudwatch-logs.md)、[亚马逊 CloudWatch 控制面板](cloudwatch-dashboard.md)和[与 Amazon CloudWatch 日志集成](cloudwatch-logs.md)。

**注意**  
在 2.6.0 AWS ParallelCluster 版本中添加`cw_log`了对 Support 的支持。

## `enable`
<a name="cw-log-section-enable"></a>

 **（可选）**表示是否启用 CloudWatch 日志。

默认值为 `true`。用于禁`false`用 CloudWatch 日志。

以下示例启用 CloudWatch 日志。

```
enable = true
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `retention_days`
<a name="cw-log-section-retention-days"></a>

 **（可选）**表示 CloudWatch 日志保留单个日志事件的天数。

默认值为 `14`。支持的值为 1、3、5、7、14、30、60、90、120、150、180、365、400、545、731、1827 和 3653。

以下示例将 CloudWatch 日志配置为将日志事件保留 30 天。

```
retention_days = 30
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

# `[dashboard]` 部分
<a name="dashboard-section"></a>

定义 CloudWatch 仪表板的配置设置。

格式为`[dashboard dashboard-name]`。 *dashboard-name*必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

```
[dashboard custom-dashboard]
enable = true
```

**注意**  
在 2.10.0 AWS ParallelCluster 版本中添加`dashboard`了对 Support 的支持。

## `enable`
<a name="dashboard-section-enable"></a>

 **（可选）**表示 CloudWatch 仪表板是否已启用。

默认值为 `true`。用于禁`false`用 CloudWatch 控制面板。

以下示例启用 CloudWatch 仪表板。

```
enable = true
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

# `[dcv]` 部分
<a name="dcv-section"></a>

定义头节点上运行的 Amazon DCV 服务器的配置设置。

要创建和配置 Amazon DCV 服务器，请使用您在 `dcv` 部分中定义的名称指定集群 [`dcv_settings`](cluster-definition.md#dcv-settings)，并将 [`enable`](#dcv-section-enable) 设置为 `master`，将 [`base_os`](cluster-definition.md#base-os) 设置为 `alinux2`、`centos7`、`ubuntu1804` 或 `ubuntu2004`。如果头节点是 ARM 实例，则将 [`base_os`](cluster-definition.md#base-os) 设置为 `alinux2`、`centos7` 或 `ubuntu1804`。

格式为`[dcv dcv-name]`。 *dcv-name*必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

```
[dcv custom-dcv]
enable = master
port = 8443
access_from = 0.0.0.0/0
```

有关更多信息，请参阅 [通过 Amazon DCV 连接到头节点](dcv.md)。

**重要**  
默认情况下，设置的 Amazon DCV 端口对所有 IPv4 地址开放。 AWS ParallelCluster 但是，只有当您具有 Amazon DCV 会话的 URL 时，才能连接到 Amazon DCV 端口，并应在 `pcluster dcv connect` 返回 URL 后的 30 秒内连接到 Amazon DCV 会话。请使用 [`access_from`](#dcv-section-access-from) 设置进一步限制对具有 CIDR 格式 IP 范围的 Amazon DCV 端口的访问，并使用 [`port`](#dcv-section-port) 设置来设置非标准端口。

**注意**  
在 AWS ParallelCluster 版本 2.10.4 中删除了对 `centos8` 上 [`[dcv]` 部分](#dcv-section)的支持。在 2.10.0 AWS ParallelCluster 版本中增加了`centos8`对上[`[dcv]`节](#dcv-section)的支持。2.9.0 版本中增加了对 AWS 基于 Graviton 的实例[`[dcv]`部分](#dcv-section)的 AWS ParallelCluster 支持。在 2.6.0 AWS ParallelCluster 版本中添加`ubuntu1804`了对`alinux2`和[`[dcv]`部分](#dcv-section)的支持。在 2.5.0 AWS ParallelCluster 版本中增加了`centos7`对上[`[dcv]`节](#dcv-section)的支持。

## `access_from`
<a name="dcv-section-access-from"></a>

 **（可选，建议）**指定用于连接到 Amazon DCV 的 CIDR 格式的 IP 范围。此设置仅在 AWS ParallelCluster 创建安全组时使用。

默认值是 `0.0.0.0/0`，允许从任何 Internet 地址访问。

```
access_from = 0.0.0.0/0
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `enable`
<a name="dcv-section-enable"></a>

 **（必需）**指示是否在头节点上启用 Amazon DCV。要在头节点上启用 Amazon DCV 并配置所需的安全组规则，请将 `enable` 设置设为 `master`。

以下示例在头节点上启用 Amazon DCV。

```
enable = master
```

**注意**  
Amazon DCV 自动生成自签名证书，用于保护 Amazon DCV 客户端和头节点上运行的 Amazon DCV 服务器之间的流量。要配置您自己的证书，请参阅 [Amazon DCV HTTPS 证书](dcv.md#dcv-certificate)。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `port`
<a name="dcv-section-port"></a>

 **（可选）**指定 Amazon DCV 的端口。

默认值为 `8443`。

```
port = 8443
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

# `[ebs]` 部分
<a name="ebs-section"></a>

定义头节点上挂载且通过 NFS 共享到计算节点的卷的 Amazon EBS 卷配置设置。

要了解如何在集群定义中包含 Amazon EBS 卷，请参阅 ``[cluster]` 部分`/``ebs_settings``。

要将现有的 Amazon EBS 卷用于独立于集群生命周期的长期永久性存储，请指定 [`ebs_volume_id`](#ebs-volume-id)。

如果您未指定[`ebs_volume_id`](#ebs-volume-id)，则在 AWS ParallelCluster 创建集群时根据`[ebs]`设置创建 EBS 卷，并在删除集群时删除该卷和数据。

有关更多信息，请参阅 [最佳实践：将集群移至新的 AWS ParallelCluster 次要版本或补丁版本](best-practices.md#best-practices-cluster-upgrades)。

格式为`[ebs ebs-name]`。 *ebs-name*必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

```
[ebs custom1]
shared_dir = vol1
ebs_snapshot_id = snap-xxxxx
volume_type = io1
volume_iops = 200
...

[ebs custom2]
shared_dir = vol2
...

...
```

**Topics**
+ [`shared_dir`](#ebs-shared-dir)
+ [`ebs_kms_key_id`](#ebs-kms-key-id)
+ [`ebs_snapshot_id`](#ebs-snapshot-id)
+ [`ebs_volume_id`](#ebs-volume-id)
+ [`encrypted`](#encrypted)
+ [`volume_iops`](#volume-iops)
+ [`volume_size`](#volume-size)
+ [`volume_throughput`](#volume-throughput)
+ [`volume_type`](#volume-type)

## `shared_dir`
<a name="ebs-shared-dir"></a>

**（必需）**指定在其中挂载共享 Amazon EBS 卷的路径。

使用多个 Amazon EBS 卷时需要此参数。

当使用一个 Amazon EBS 卷时，此选项将覆盖在 [`[cluster]` 部分](cluster-definition.md)下指定的 [`shared_dir`](cluster-definition.md#cluster-shared-dir)。在以下示例中，卷将挂载到 `/vol1`。

```
shared_dir = vol1
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `ebs_kms_key_id`
<a name="ebs-kms-key-id"></a>

**（可选）**指定用于加密的自定义密 AWS KMS 钥。

此参数必须与 `encrypted = true` 一起使用。它还必须具有自定义 [`ec2_iam_role`](cluster-definition.md#ec2-iam-role)。

有关更多信息，请参阅 [使用自定义 KMS 密钥对磁盘加密](tutorials_04_encrypted_kms_fs.md)。

```
ebs_kms_key_id = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `ebs_snapshot_id`
<a name="ebs-snapshot-id"></a>

**（可选）**如果将快照用作卷的源，则定义 Amazon EBS 快照 ID。

没有默认值。

```
ebs_snapshot_id = snap-xxxxx
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `ebs_volume_id`
<a name="ebs-volume-id"></a>

**（可选）**定义要附加到头节点的现有 Amazon EBS 卷的卷 ID。

没有默认值。

```
ebs_volume_id = vol-xxxxxx
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `encrypted`
<a name="encrypted"></a>

**（可选）**指定是否加密 Amazon EBS 卷。注意：请*勿* 使用快照。

默认值为 `false`。

```
encrypted = false
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `volume_iops`
<a name="volume-iops"></a>

**（可选）**为 `io1`、`io2` 和 `gp3` 类型卷定义 IOPS 数。

默认值、支持的值以及 `volume_size`/`volume_iops` 比率因 [`volume_type`](raid-section.md#raid-volume-type) 和 [`volume_size`](#volume-size) 而异。

`volume_type` = `io1`  
默认值：`volume_iops` = 100  
支持的值：`volume_iops` = 100–64000 †  
最大 `volume_iops`/`volume_size` 比率 = 50 IOPS/GiB。5000 IOPS 需要至少 100 GiB 的 `volume_size`。

`volume_type` = `io2`  
默认值：`volume_iops` = 100  
支持的值：`volume_iops` = 100–64000（`io2` Block Express 卷为 256000）†  
最大 `volume_iops`/`volume_size` 比率 = 500 IOPS/GiB。5000 IOPS 需要至少 10 GiB 的 `volume_size`。

`volume_type` = `gp3`  
默认值：`volume_iops` = 3000  
支持的值：`volume_iops` = 3000–16000  
最大 `volume_iops`/`volume_size` 比率 = 500 IOPS/GiB。5000 IOPS 需要至少 10 GiB 的 `volume_size`。

```
volume_iops = 200
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

† 只有[在 Nitro System 上构建的实例](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances)配置超过 32000 IOPS 时，才能保证最大 IOPS。其他实例保证最高为 32000 IOPS。除非您[修改卷](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modify-volume.html)，否则较早的 `io1` 卷可能无法实现完全性能。`io2`Block Express 卷支持高达 256000 的 `volume_iops` 值。有关更多信息，请参阅《*亚马逊 EC2 用户指南》*[中的 “`io2`屏蔽 Express 卷（预览版）](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html#io2-block-express)”。

## `volume_size`
<a name="volume-size"></a>

**（可选）**指定要创建的卷的大小，以 GiB 为单位（如果未使用快照）。

默认值和支持的值因 [`volume_type`](#volume-type) 而异。

`volume_type` = `standard`  
默认值：`volume_size` = 20 GiB  
支持的值：`volume_size` = 1–1024 GiB

`volume_type` = `gp2`、`io1`、`io2` 和 `gp3`  
默认值：`volume_size` = 20 GiB  
支持的值：`volume_size` = 1–16384 GiB

`volume_type` = `sc1` 和 `st1`  
默认值：`volume_size` = 500 GiB  
支持的值：`volume_size` = 500–16384 GiB

```
volume_size = 20
```

**注意**  
在 2.10.1 AWS ParallelCluster 版本之前，所有卷类型的默认值均为 20 GiB。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `volume_throughput`
<a name="volume-throughput"></a>

**（可选）**定义 `gp3` 卷类型的吞吐量，以 MiB/s 为单位。

默认值为 `125`。

支持的值：`volume_throughput` = 125–1000 MiB/s

`volume_throughput` 与 `volume_iops` 的比率不能超过 0.25。1000 MiB/s 的最大吞吐量要求 `volume_iops` 设置至少为 4000。

```
volume_throughput = 1000
```

**注意**  
在 2.10.1 AWS ParallelCluster 版本中增加了对 Support 的支持。`volume_throughput`

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `volume_type`
<a name="volume-type"></a>

**（可选）**指定要启动的卷的 [Amazon EBS 卷类型](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)。

有效选项为以下卷类型：

`gp2`, `gp3`  
通用型 SSD

`io1`, `io2`  
预调配 IOPS SSD

`st1`  
吞吐量优化型 HDD

`sc1`  
Cold HDD

`standard`  
上一代磁介质

有关更多信息，请参阅《[亚马逊* EC2 用户指南》中的 Amaz* on EBS 卷类型](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)。

默认值为 `gp2`。

```
volume_type = io2
```

**注意**  
在 2.10.1 AWS ParallelCluster 版本中增加了对`gp3`和`io2`的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

# `[efs]` 部分
<a name="efs-section"></a>

定义头节点和计算节点上挂载的 Amazon EFS 的配置设置。有关更多信息，请参阅 *Amazon EFS API 参考[CreateFileSystem](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html)*中的。

要了解如何在集群定义中包含 Amazon EFS 文件系统，请参阅 ``[cluster]` 部分`/``efs_settings``。

要使用现有的 Amazon EFS 文件系统进行独立于集群生命周期的长期永久性存储，请指定 [`efs_fs_id`](#efs-efs-fs-id)。

如果您未指定[`efs_fs_id`](#efs-efs-fs-id)，则在 AWS ParallelCluster 创建集群时根据`[efs]`设置创建 Amazon EFS 文件系统，并在删除集群时删除文件系统和数据。

有关更多信息，请参阅 [最佳实践：将集群移至新的 AWS ParallelCluster 次要版本或补丁版本](best-practices.md#best-practices-cluster-upgrades)。

格式为`[efs efs-name]`。 *efs-name*必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

```
[efs customfs]
shared_dir = efs
encrypted = false
performance_mode = generalPurpose
```

**Topics**
+ [`efs_fs_id`](#efs-efs-fs-id)
+ [`efs_kms_key_id`](#efs-efs-kms-key-id)
+ [`encrypted`](#efs-encrypted)
+ [`performance_mode`](#efs-performance-mode)
+ [`provisioned_throughput`](#efs-provisioned-throughput)
+ [`shared_dir`](#efs-shared-dir)
+ [`throughput_mode`](#efs-throughput-mode)

## `efs_fs_id`
<a name="efs-efs-fs-id"></a>

**（可选）**为现有文件系统定义 Amazon EFS 文件系统 ID。

指定此选项将使所有其他 Amazon EFS 选项失效，但 [`shared_dir`](cluster-definition.md#cluster-shared-dir) 除外。

如果设置此选项，则它仅支持以下类型的文件系统：
+ 堆栈的可用区中没有挂载目标的文件系统。
+ 堆栈的可用区中有一个允许来自 `0.0.0.0/0` 的入站和出站 NFS 流量的现有挂载目标的文件系统。

用于验证 [`efs_fs_id`](#efs-efs-fs-id) 的健全性检查要求 IAM 角色具有以下权限：
+ `elasticfilesystem:DescribeMountTargets`
+ `elasticfilesystem:DescribeMountTargetSecurityGroups`
+ `ec2:DescribeSubnets`
+ `ec2:DescribeSecurityGroups`
+ `ec2:DescribeNetworkInterfaceAttribute`

要避免错误，您必须将这些权限添加到您的 IAM 角色或设置 `sanity_check = false`。

**重要**  
当您设置允许来自的入站和出站 NFS 流量的挂载目标时`0.0.0.0/0`，它会将文件系统暴露给来自挂载目标可用区内任何位置的 NFS 挂载请求。 AWS 不建议在堆栈的可用区中创建挂载目标。相反，让我们来 AWS 处理这个步骤。如果您想要在堆栈的可用区中拥有挂载目标，请考虑通过在 [`[vpc]` 部分](vpc-section.md)下提供 [`vpc_security_group_id`](vpc-section.md#vpc-security-group-id) 选项来使用自定义安全组。然后，将该安全组添加到挂载目标，并关闭 `sanity_check` 以创建集群。

没有默认值。

```
efs_fs_id = fs-12345
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `efs_kms_key_id`
<a name="efs-efs-kms-key-id"></a>

**（可选）**标识用于保护加密文件系统的 AWS Key Management Service (AWS KMS) 客户托管密钥。如果设置了此参数，则必须将 [`encrypted`](#efs-encrypted) 设置为 `true`。这与《*亚马逊 EFS API 参考*》中的[KmsKeyId](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html#efs-CreateFileSystem-request-KmsKeyId)参数相对应。

没有默认值。

```
efs_kms_key_id = 1234abcd-12ab-34cd-56ef-1234567890ab
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `encrypted`
<a name="efs-encrypted"></a>

**（可选）**指示是否对文件系统加密。此参数对应于 *Amazon EFS API 参考* 中的 [Encrypted](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html#efs-CreateFileSystem-request-Encrypted) 参数。

默认值为 `false`。

```
encrypted = true
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `performance_mode`
<a name="efs-performance-mode"></a>

**（可选）**定义文件系统的性能模式。这与《*亚马逊 EFS API 参考*》中的[PerformanceMode](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html#efs-CreateFileSystem-request-PerformanceMode)参数相对应。

有效选项为以下值：
+ `generalPurpose`
+ `maxIO`

 这两个值都区分大小写。

对于大多数文件系统，我们推荐使用 `generalPurpose` 性能模式。

使用 `maxIO` 性能模式的文件系统可以扩展到更高级别的聚合吞吐量和每秒操作数。但是，对于大多数文件操作来说，代价是稍高的延迟。

创建文件系统后，无法更改此参数。

默认值为 `generalPurpose`。

```
performance_mode = generalPurpose
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `provisioned_throughput`
<a name="efs-provisioned-throughput"></a>

**（可选）**定义文件系统的预置吞吐量（以 MiB/s 为单位）。这与《*亚马逊 EFS API 参考*》中的[ProvisionedThroughputInMibps](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html#efs-CreateFileSystem-response-ProvisionedThroughputInMibps)参数相对应。

如果您使用了此参数，则必须将 [`throughput_mode`](#efs-throughput-mode) 设置为 `provisioned`。

吞吐量配额为 `1024` MiB/s。要请求提高配额，请联系 支持。

最小值为 `0.0` MiB/s。

```
provisioned_throughput = 1024
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `shared_dir`
<a name="efs-shared-dir"></a>

**（必需）**定义头节点和计算节点上的 Amazon EFS 挂载点。

此参数为必需参数。仅在指定 [`shared_dir`](cluster-definition.md#cluster-shared-dir) 时使用 Amazon EFS 部分。

请勿使用 `NONE` 或 `/NONE` 作为共享目录。

以下示例在 `/efs` 上挂载 Amazon EFS。

```
shared_dir = efs
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `throughput_mode`
<a name="efs-throughput-mode"></a>

**（可选）**定义文件系统的吞吐量模式。这与《*亚马逊 EFS API 参考*》中的[ThroughputMode](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html#efs-CreateFileSystem-request-ThroughputMode)参数相对应。

有效选项为以下值：
+ `bursting`
+ `provisioned`

默认值为 `bursting`。

```
throughput_mode = provisioned
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

# `[fsx]` 部分
<a name="fsx-section"></a>

为附加 FSx 的 Lustre 文件系统定义配置设置。有关更多信息，请参阅《[亚马逊 FSx ](https://docs.aws.amazon.com/fsx/latest/APIReference/API_CreateFileSystem.html) *API 参考》 FSx CreateFileSystem中的亚马逊*。

如果支持 Lustre FSx 的`ubuntu2004`、、、或。[`base_os`](cluster-definition.md#base-os) `alinux2` `centos7` `ubuntu1804`

使用 Amazon Linux 时，内核必须为 `4.14.104-78.84.amzn1.x86_64` 或更高版本。有关说明，请参阅[《*Amazon FSx for Lustre 用户指南》中的安装 lustre* 客户端](https://docs.aws.amazon.com/fsx/latest/LustreGuide/install-lustre-client.html)。

**注意**  
FSx 当`awsbatch`用作调度程序时，目前不支持 for Lustre。

**注意**  
在 2.10 FSx .4 AWS ParallelCluster 版本中删除`centos8`了对 Lustre on 的支持。在 2.11. FSx 0 AWS ParallelCluster 版本中添加`ubuntu2004`了对 Lustre on 的支持。在 2.10. FSx 0 AWS ParallelCluster 版本中添加`centos8`了对 Lustre on 的支持。在`alinux2`、和 2.6.0 AWS ParallelCluster 版本中添加`ubuntu1804`了`ubuntu1604`对 Lustre 的支持。 FSx 在 2.4. FSx 0 AWS ParallelCluster 版本中添加`centos7`了对 Lustre on 的支持。

如果使用现有文件系统，则必须将其关联到一个安全组，该安全组允许到端口 `988` 的入站 TCP 流量。在安全组规则上将源设置为 `0.0.0.0/0` 时，可以从 VPC 安全组中所有 IP 范围的客户端访问该规则的协议和端口范围。要进一步限制对文件系统的访问，我们建议您对安全组规则使用更具限制性的源。例如，您可以使用更具体的 CIDR 范围、IP 地址或安全组 IDs。在未使用 [`vpc_security_group_id`](vpc-section.md#vpc-security-group-id) 时，将自动执行此操作。

要使用现有 Amazon FSx 文件系统进行独立于集群生命周期的长期永久存储，请指定[`fsx_fs_id`](#fsx-fs-id)。

如果您未指定[`fsx_fs_id`](#fsx-fs-id)，则在 AWS ParallelCluster 创建集群时根据`[fsx]`设置 FSx 为 Lustre 文件系统创建，并在删除集群时删除文件系统和数据。

有关更多信息，请参阅 [最佳实践：将集群移至新的 AWS ParallelCluster 次要版本或补丁版本](best-practices.md#best-practices-cluster-upgrades)。

格式为`[fsx fsx-name]`。 *fsx-name*必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

```
[fsx fs]
shared_dir = /fsx
fsx_fs_id = fs-073c3803dca3e28a6
```

要创建并配置新的文件系统，请使用以下参数：

```
[fsx fs]
shared_dir = /fsx
storage_capacity = 3600
imported_file_chunk_size = 1024
export_path = s3://bucket/folder
import_path = s3://bucket
weekly_maintenance_start_time = 1:00:00
```

**Topics**
+ [`auto_import_policy`](#fsx-auto-import-policy)
+ [`automatic_backup_retention_days`](#fsx-automatic-backup-retention-days)
+ [`copy_tags_to_backups`](#fsx-copy-tags-to-backups)
+ [`daily_automatic_backup_start_time`](#fsx-daily-automatic-backup-start-time)
+ [`data_compression_type`](#fsx-data-compression-type)
+ [`deployment_type`](#fsx-deployment-type)
+ [`drive_cache_type`](#fsx-drive-cache-type)
+ [`export_path`](#fsx-export-path)
+ [`fsx_backup_id`](#fsx-backup-id)
+ [`fsx_fs_id`](#fsx-fs-id)
+ [`fsx_kms_key_id`](#fsx-kms-key-id)
+ [`import_path`](#fsx-import-path)
+ [`imported_file_chunk_size`](#fsx-imported-file-chunk-size)
+ [`per_unit_storage_throughput`](#fsx-per-unit-storage-throughput)
+ [`shared_dir`](#fsx-shared-dir)
+ [`storage_capacity`](#fsx-storage-capacity)
+ [`storage_type`](#fsx-storage-type)
+ [`weekly_maintenance_start_time`](#fsx-weekly-maintenance-start-time)

## `auto_import_policy`
<a name="fsx-auto-import-policy"></a>

**（可选）**指定自动导入策略，以反映用于创建 for Lustre 文件系统的 FSx S3 存储桶中的更改。可能的值包括：

`NEW`  
FSx for Lustre 会自动导入添加到链接的 S3 存储桶中且当前不存在于 for Lustre 文件系统中的任何新对象 FSx 的目录列表。

`NEW_CHANGED`  
FSx for Lustre 会自动导入添加到 S3 存储桶中的任何新对象以及在 S3 存储桶中更改的任何现有对象的文件和目录列表。

这与[AutoImportPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-autoimportpolicy)属性相对应。有关更多信息，请参阅 *Amaz FSx on for Lustre 用户指南中的自动从 S3 存储桶导*[入更新](https://docs.aws.amazon.com/fsx/latest/LustreGuide/autoimport-data-repo.html)。指定 [`auto_import_policy`](#fsx-auto-import-policy) 参数后，不得指定 [`automatic_backup_retention_days`](#fsx-automatic-backup-retention-days)、[`copy_tags_to_backups`](#fsx-copy-tags-to-backups)、[`daily_automatic_backup_start_time`](#fsx-daily-automatic-backup-start-time) 和 [`fsx_backup_id`](#fsx-backup-id) 参数。

如果未指定该`auto_import_policy`设置，则会禁用自动导入。 FSx for Lustre 仅在创建文件系统时更新链接的 S3 存储桶中的文件和目录列表。

```
auto_import_policy = NEW_CHANGED
```

**注意**  
在 2.10.0 AWS ParallelCluster 版本中添加[`auto_import_policy`](#fsx-auto-import-policy)了对 Support 的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `automatic_backup_retention_days`
<a name="fsx-automatic-backup-retention-days"></a>

**（可选）**指定保留自动备份的天数。此参数仅适用于 `PERSISTENT_1` 部署类型。指定 [`automatic_backup_retention_days`](#fsx-automatic-backup-retention-days) 参数后，不得指定 [`auto_import_policy`](#fsx-auto-import-policy)、[`export_path`](#fsx-export-path)、[`import_path`](#fsx-import-path) 和 [`imported_file_chunk_size`](#fsx-imported-file-chunk-size) 参数。这与[AutomaticBackupRetentionDays](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-automaticbackupretentiondays)属性相对应。

默认值是 0。此设置禁用自动备份。可能的值是介于 0 到 35 之间的整数（含 0 和 35）。

```
automatic_backup_retention_days = 35
```

**注意**  
在 AWS ParallelCluster 版本 2.8.0 中添加了对 [`automatic_backup_retention_days`](#fsx-automatic-backup-retention-days) 的支持。

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `copy_tags_to_backups`
<a name="fsx-copy-tags-to-backups"></a>

**（可选）**指定是否将文件系统的标签复制到备份中。此参数仅适用于 `PERSISTENT_1` 部署类型。指定 [`copy_tags_to_backups`](#fsx-copy-tags-to-backups) 参数后，必须使用大于 0 的值指定 [`automatic_backup_retention_days`](#fsx-automatic-backup-retention-days)，并且不得指定 [`auto_import_policy`](#fsx-auto-import-policy)、[`export_path`](#fsx-export-path)、[`import_path`](#fsx-import-path) 和 [`imported_file_chunk_size`](#fsx-imported-file-chunk-size) 参数。这与[CopyTagsToBackups](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-copytagstobackups)属性相对应。

默认值为 `false`。

```
copy_tags_to_backups = true
```

**注意**  
在 2.8.0 AWS ParallelCluster 版本中添加[`copy_tags_to_backups`](#fsx-copy-tags-to-backups)了对 Support 的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `daily_automatic_backup_start_time`
<a name="fsx-daily-automatic-backup-start-time"></a>

**（可选）**指定一天中开始自动备份的时间 (UTC)。此参数仅适用于 `PERSISTENT_1` 部署类型。指定 [`daily_automatic_backup_start_time`](#fsx-daily-automatic-backup-start-time) 参数后，必须使用大于 0 的值指定 [`automatic_backup_retention_days`](#fsx-automatic-backup-retention-days)，并且不得指定 [`auto_import_policy`](#fsx-auto-import-policy)、[`export_path`](#fsx-export-path)、[`import_path`](#fsx-import-path) 和 [`imported_file_chunk_size`](#fsx-imported-file-chunk-size) 参数。这与[DailyAutomaticBackupStartTime](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-dailyautomaticbackupstarttime)属性相对应。

格式为 `HH:MM`，其中 `HH` 是一天中的零填充小时（0-23），`MM` 是小时中的零填充分钟。例如，1:03 A.M. UTC 如下所示。

```
daily_automatic_backup_start_time = 01:03
```

默认值是介于 `00:00` 和 `23:59` 之间的随机时间。

**注意**  
在 AWS ParallelCluster 版本 2.8.0 中添加了对 [`daily_automatic_backup_start_time`](#fsx-daily-automatic-backup-start-time) 的支持。

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `data_compression_type`
<a name="fsx-data-compression-type"></a>

**（可选）**指定 f FSx or Lustre 的数据压缩类型。这与[DataCompressionType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-datacompressiontype)属性相对应。有关更多信息，[FSx 请参阅《*Amazon FSx for Lustre 用户指南》中的 Lustre* 数据压缩](https://docs.aws.amazon.com/fsx/latest/LustreGuide/data-compression.html)。

唯一有效值为 `LZ4`。要禁用数据压缩，请删除 [`data_compression_type`](#fsx-data-compression-type) 参数。

```
data_compression_type = LZ4
```

**注意**  
在 2.11.0 [`data_compression_type`](#fsx-data-compression-type) AWS ParallelCluster 版本中增加了对 Support 的支持。

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `deployment_type`
<a name="fsx-deployment-type"></a>

**（可选）**指定 Lustre FSx 的部署类型。这与[DeploymentType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-deploymenttype)属性相对应。有关更多信息，[FSx 请参阅《*Amazon FSx for Lustre 用户指南》中的 Lustre* 部署选项](https://docs.aws.amazon.com/fsx/latest/LustreGuide/using-fsx-lustre.html)。为数据的临时存储和短期处理选择临时部署类型。`SCRATCH_2` 是最新一代临时文件系统。它提供了超出基准吞吐量的突增吞吐量以及传输中数据加密。

有效值为 `SCRATCH_1`、`SCRATCH_2` 和 `PERSISTENT_1`。

`SCRATCH_1`  
Lustre FSx 的默认部署类型。对于此部署类型，[`storage_capacity`](#fsx-storage-capacity) 设置的可能值为 1200 和 2400，以及 3600 的任何倍数。在 2.4.0 AWS ParallelCluster 版本中添加`SCRATCH_1`了对 Support 的支持。

`SCRATCH_2`  
最新一代临时文件系统。它支持的工作负载最高可达基准吞吐量的六倍。对于支持的 AWS 区域中支持的实例类型，它还支持传输中数据加密。有关更多信息，请参阅 *Amazon for Lustre 用户指南 FSx *中的[加密传输中的数据](https://docs.aws.amazon.com/fsx/latest/LustreGuide/encryption-in-transit-fsxl.html)。对于此部署类型，[`storage_capacity`](#fsx-storage-capacity) 设置的可能值为 1200，以及 2400 的任何倍数。在 AWS ParallelCluster 版本 2.6.0 中添加了对 `SCRATCH_2` 的支持。

`PERSISTENT_1`  
专为长期存储而设计。文件服务器具有高可用性，并且数据在文件系统的 AWS 可用区内复制。对于支持的实例类型，它还支持传输中数据加密。对于此部署类型，[`storage_capacity`](#fsx-storage-capacity) 设置的可能值为 1200，以及 2400 的任何倍数。在 2.6.0 AWS ParallelCluster 版本中添加`PERSISTENT_1`了对 Support 的支持。

默认值为 `SCRATCH_1`。

```
deployment_type = SCRATCH_2
```

**注意**  
在 2.6.0 AWS ParallelCluster 版本中添加[`deployment_type`](#fsx-deployment-type)了对 Support 的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `drive_cache_type`
<a name="fsx-drive-cache-type"></a>

**（可选）**指定文件系统具有 SSD 驱动器缓存。只有将 [`storage_type`](#fsx-storage-type) 设置设为 `HDD` 后，才能设置此参数。这与[DriveCacheType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-drivecachetype)属性相对应。有关更多信息，[FSx 请参阅《*Amazon FSx for Lustre 用户指南》中的 Lustre* 部署选项](https://docs.aws.amazon.com/fsx/latest/LustreGuide/using-fsx-lustre.html)。

唯一有效值为 `READ`。要禁用 SSD 驱动器缓存，请不要指定 `drive_cache_type` 设置。

```
drive_cache_type = READ
```

**注意**  
在 2.10.0 AWS ParallelCluster 版本中添加[`drive_cache_type`](#fsx-drive-cache-type)了对 Support 的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `export_path`
<a name="fsx-export-path"></a>

**（可选）**指定在其中导出文件系统的根的 Amazon S3 路径。指定 [`export_path`](#fsx-export-path) 参数后，不得指定 [`automatic_backup_retention_days`](#fsx-automatic-backup-retention-days)、[`copy_tags_to_backups`](#fsx-copy-tags-to-backups)、[`daily_automatic_backup_start_time`](#fsx-daily-automatic-backup-start-time) 和 [`fsx_backup_id`](#fsx-backup-id) 参数。这与[ExportPath](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-exportpath)属性相对应。文件数据和元数据不会自动导出到 `export_path`。有关导出数据和元数据的信息，请参阅 *Amazon for Lustre 用户指南中的导出 FSx 对*[数据存储库的更改](https://docs.aws.amazon.com/fsx/latest/LustreGuide/export-changed-data-meta-dra.html)。

默认值为 `s3://import-bucket/FSxLustre[creation-timestamp]`，其中 `import-bucket` 是 [`import_path`](#fsx-import-path) 参数中提供的存储桶。

```
export_path = s3://bucket/folder
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `fsx_backup_id`
<a name="fsx-backup-id"></a>

**（可选）**指定用于从现有备份还原文件系统的备份 ID。指定 [`fsx_backup_id`](#fsx-backup-id) 参数后，不得指定 [`auto_import_policy`](#fsx-auto-import-policy)、[`deployment_type`](#fsx-deployment-type)、[`export_path`](#fsx-export-path)、[`fsx_kms_key_id`](#fsx-kms-key-id)、[`import_path`](#fsx-import-path)、[`imported_file_chunk_size`](#fsx-imported-file-chunk-size)、[`storage_capacity`](#fsx-storage-capacity) 和 [`per_unit_storage_throughput`](#fsx-per-unit-storage-throughput) 参数。这些参数从备份中进行读取。此外，不得指定 [`auto_import_policy`](#fsx-auto-import-policy)、[`export_path`](#fsx-export-path)、[`import_path`](#fsx-import-path) 和 [`imported_file_chunk_size`](#fsx-imported-file-chunk-size) 参数。

这与[BackupId](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-fsx-filesystem.html#cfn-fsx-filesystem-backupid)属性相对应。

```
fsx_backup_id = backup-fedcba98
```

**注意**  
在 2.8.0 AWS ParallelCluster 版本中添加[`fsx_backup_id`](#fsx-backup-id)了对 Support 的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `fsx_fs_id`
<a name="fsx-fs-id"></a>

**（可选）**附加现有 FSx 的 Lustre 文件系统。

如果指定了此选项，则仅使用 [`[fsx]` 部分](#fsx-section)中的 [`shared_dir`](#fsx-shared-dir) 和 [`fsx_fs_id`](#fsx-fs-id) 设置，并忽略 [`[fsx]` 部分](#fsx-section)中的任何其他设置。

```
fsx_fs_id = fs-073c3803dca3e28a6
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `fsx_kms_key_id`
<a name="fsx-kms-key-id"></a>

**（可选）**指定您的 AWS Key Management Service (AWS KMS) 客户托管密钥的密钥 ID。

此密钥用于加密文件系统中的静态数据。

它必须与自定义 [`ec2_iam_role`](cluster-definition.md#ec2-iam-role) 结合使用。有关更多信息，请参阅 [使用自定义 KMS 密钥对磁盘加密](tutorials_04_encrypted_kms_fs.md)。这与《*亚马逊 FSx API 参考*》中的[KmsKeyId](https://docs.aws.amazon.com/fsx/latest/APIReference/API_CreateFileSystem.html#FSx-CreateFileSystem-request-KmsKeyId)参数相对应。

```
fsx_kms_key_id = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```

**注意**  
在 2.6.0 AWS ParallelCluster 版本中添加[`fsx_kms_key_id`](#fsx-kms-key-id)了对 Support 的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `import_path`
<a name="fsx-import-path"></a>

**（可选）**指定将其中的数据加载到文件系统并用作导出存储桶的 S3 存储桶。有关更多信息，请参阅 [`export_path`](#fsx-export-path)。如果指定 [`import_path`](#fsx-import-path) 参数，则不得指定 [`automatic_backup_retention_days`](#fsx-automatic-backup-retention-days)、[`copy_tags_to_backups`](#fsx-copy-tags-to-backups)、[`daily_automatic_backup_start_time`](#fsx-daily-automatic-backup-start-time) 和 [`fsx_backup_id`](#fsx-backup-id) 参数。这与《*亚马逊 FSx API 参考*》中的[ImportPath](https://docs.aws.amazon.com/fsx/latest/APIReference/API_CreateFileSystemLustreConfiguration.html#FSx-Type-CreateFileSystemLustreConfiguration-ImportPath)参数相对应。

导入在创建集群时发生。有关更多信息，请参阅 *Amazon FSx for Lustre 用户指南*中的[从数据存储库导入](https://docs.aws.amazon.com/fsx/latest/LustreGuide/importing-files.html)数据。导入时，仅导入文件元数据（名称、所有权、时间戳和权限）。在首次访问文件之前，不会从 S3 存储桶导入文件数据。有关预加载文件内容的信息，请参阅 A *ma FSx zon for Lustr* e 用户指南中的将[文件预加载到您的文件系统](https://docs.aws.amazon.com/fsx/latest/LustreGuide/preload-file-contents-hsm-dra.html)。

如果未提供值，则该文件系统为空。

```
import_path =  s3://bucket
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `imported_file_chunk_size`
<a name="fsx-imported-file-chunk-size"></a>

**（可选）**对于从数据存储库导入的文件（使用 [`import_path`](#fsx-import-path)），此参数决定单个物理磁盘上存储的每个文件的条带计数和最大数据量（以 MiB 为单位）。可以对单个文件进行条带化的最大磁盘数受构成文件系统的总磁盘数限制。指定 [`imported_file_chunk_size`](#fsx-imported-file-chunk-size) 参数后，不得指定 [`automatic_backup_retention_days`](#fsx-automatic-backup-retention-days)、[`copy_tags_to_backups`](#fsx-copy-tags-to-backups)、[`daily_automatic_backup_start_time`](#fsx-daily-automatic-backup-start-time) 和 [`fsx_backup_id`](#fsx-backup-id) 参数。这与[ImportedFileChunkSize](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-importedfilechunksize)属性相对应。

区块大小默认为 `1024` (1 GiB)，最大值能够达到 512000 MiB (500 GiB)。Amazon S3 数据元的最大大小为 5 TB。

```
imported_file_chunk_size = 1024
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `per_unit_storage_throughput`
<a name="fsx-per-unit-storage-throughput"></a>

**（`PERSISTENT_1` 部署类型所必需）** 对于 [`deployment_type`](#fsx-deployment-type)` = PERSISTENT_1` 部署类型，描述每 1 TiB 存储的读取和写入吞吐量（以 MB/s/TiB 为单位）。文件系统吞吐容量的计算方法是将文件系统存储容量 (TiB) 乘以 [`per_unit_storage_throughput`](#fsx-per-unit-storage-throughput) (MB/s/TiB). For a 2.4 TiB ﬁle system, provisioning 50 MB/s/TiBof)，得出 120 MB/s 的文件系统吞吐[`per_unit_storage_throughput`](#fsx-per-unit-storage-throughput)量。您需要为预置的吞吐量付费。这与[PerUnitStorageThroughput](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-perunitstoragethroughput)属性相对应。

可能的值取决于 [`storage_type`](#fsx-storage-type) 设置的值。

`storage\$1type = SSD`  
可能的值为 50、100、200。

`storage\$1type = HDD`  
可能的值为 12、40。

```
per_unit_storage_throughput = 200
```

**注意**  
在 AWS ParallelCluster 版本 2.6.0 中添加了对 [`per_unit_storage_throughput`](#fsx-per-unit-storage-throughput) 的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `shared_dir`
<a name="fsx-shared-dir"></a>

**（必需）**在头部和计算节点上定义 Lustre 文件系统的挂载点。 FSx 

请勿使用 `NONE` 或 `/NONE` 作为共享目录。

以下示例在 `/fsx` 上挂载文件系统。

```
shared_dir = /fsx
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `storage_capacity`
<a name="fsx-storage-capacity"></a>

**（必需）**指定文件系统的存储容量（以 GiB 为单位）。这与[StorageCapacity](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-fsx-filesystem.html#cfn-fsx-filesystem-storagecapacity)属性相对应。

存储容量可以使用的值因 [`deployment_type`](#fsx-deployment-type) 设置而异。

`SCRATCH_1`  
可能的值是 1200 和 2400，以及 3600 的任何倍数。

`SCRATCH_2`  
可能的值是 1200，以及 2400 的任何倍数。

`PERSISTENT_1`  
可能的值根据其他设置的值而有所不同。    
`storage\$1type = SSD`  
可能的值是 1200，以及 2400 的任何倍数。  
`storage\$1type = HDD`  
可能的值根据 [`per_unit_storage_throughput`](#fsx-per-unit-storage-throughput) 设置的设置而有所不同。    
`per\$1unit\$1storage\$1throughput = 12`  
可能的值是 6000 的任何倍数。  
`per\$1unit\$1storage\$1throughput = 40`  
可能的值是 1800 的任何倍数。

```
storage_capacity = 7200
```

**注意**  
对于 AWS ParallelCluster 版本 2.5.0 和 2.5.1，[`storage_capacity`](#fsx-storage-capacity)支持可能的值 1200、2400 和 3600 的任意倍数。对于 2.5.0 之前的 AWS ParallelCluster 版本，[`storage_capacity`](#fsx-storage-capacity)其最小大小为 3600。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `storage_type`
<a name="fsx-storage-type"></a>

**（可选）**指定文件系统的存储类型。这与[StorageType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-fsx-filesystem.html#cfn-fsx-filesystem-storagetype)属性相对应。可能的值为 `SSD` 和 `HDD`。默认为 `SSD`。

存储类型会更改其他设置的可能值。

`storage_type = SSD`   
指定固态驱动器 (SSD) 存储类型。  
`storage_type = SSD` 会更改其他几个设置的可能值。    
[`drive_cache_type`](#fsx-drive-cache-type)  
不能指定此设置。  
[`deployment_type`](#fsx-deployment-type)  
此设置可以设置为 `SCRATCH_1`、`SCRATCH_2` 或 `PERSISTENT_1`。  
[`per_unit_storage_throughput`](#fsx-per-unit-storage-throughput)  
如果 [`deployment_type`](#fsx-deployment-type) 被设置为 `PERSISTENT_1`，则必须指定此设置。可能的值为 50、100 或 200。  
[`storage_capacity`](#fsx-storage-capacity)  
必须指定此设置。可能的值根据 [`deployment_type`](#fsx-deployment-type) 而有所不同。    
`deployment_type = SCRATCH_1`  
[`storage_capacity`](#fsx-storage-capacity) 可以是 1200、2400 或 3600 的任何倍数。  
`deployment_type = SCRATCH_2` 或 `deployment_type = PERSISTENT_1`  
[`storage_capacity`](#fsx-storage-capacity) 可以是 1200 或 2400 的任何倍数。

`storage_type = HDD`  
指定硬盘驱动器 (HDD) 存储类型。  
`storage_type = HDD` 会更改其他设置的可能值。    
[`drive_cache_type`](#fsx-drive-cache-type)  
可以指定此设置。  
[`deployment_type`](#fsx-deployment-type)  
此设置必须设置为 `PERSISTENT_1`。  
[`per_unit_storage_throughput`](#fsx-per-unit-storage-throughput)  
必须指定此设置。可能的值为 12 或 40。  
[`storage_capacity`](#fsx-storage-capacity)  
必须指定此设置。可能的值根据 [`per_unit_storage_throughput`](#fsx-per-unit-storage-throughput) 设置而有所不同。    
`storage_capacity = 12`  
[`storage_capacity`](#fsx-storage-capacity) 可以是 6000 的任何倍数。  
`storage_capacity = 40`  
[`storage_capacity`](#fsx-storage-capacity) 可以是 1800 的任何倍数。

```
storage_type = SSD
```

**注意**  
在 AWS ParallelCluster 版本 2.10.0 中添加了对 [`storage_type`](#fsx-storage-type) 设置的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `weekly_maintenance_start_time`
<a name="fsx-weekly-maintenance-start-time"></a>

**（可选）**指定执行每周维护的首选时间，采用 UTC 时区。这与[WeeklyMaintenanceStartTime](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-fsx-filesystem-lustreconfiguration.html#cfn-fsx-filesystem-lustreconfiguration-weeklymaintenancestarttime)属性相对应。

格式为 [星期几]:[小时]:[分钟]。例如，周一的午夜如下所示。

```
weekly_maintenance_start_time = 1:00:00
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

# `[queue]` 部分
<a name="queue-section"></a>

定义单个队列的配置设置。只有当 [`scheduler`](cluster-definition.md#scheduler) 设置为 `slurm` 时，才支持 [`[queue]` 部分](#queue-section)。

格式为`[queue <queue-name>]`。 *queue-name*必须以小写字母开头，不能超过 30 个字符，并且只能包含小写字母、数字和连字符 (-)。

```
[queue q1]
compute_resource_settings = i1,i2
placement_group = DYNAMIC
enable_efa = true
disable_hyperthreading = false
compute_type = spot
```

**注意**  
2.9.0 AWS ParallelCluster 版本中增加了对该[`[queue]`部分](#queue-section)的支持。

**Topics**
+ [`compute_resource_settings`](#queue-compute-resource-settings)
+ [`compute_type`](#queue-compute-type)
+ [`disable_hyperthreading`](#queue-disable-hyperthreading)
+ [`enable_efa`](#queue-enable-efa)
+ [`enable_efa_gdr`](#queue-enable-efa-gdr)
+ [`placement_group`](#queue-placement-group)

## `compute_resource_settings`
<a name="queue-compute-resource-settings"></a>

**（必需）**标识包含该队列的计算资源配置的 [`[compute_resource]` 部分](compute-resource-section.md)。部分名称必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

每个 [`[compute_resource]` 部分](compute-resource-section.md)最多支持三 (3) 个 [`[queue]` 部分](#queue-section)。

例如，以下设置指定使用以 `[compute_resource cr1]` 和 `[compute_resource cr2]` 开始的部分。

```
compute_resource_settings = cr1, cr2
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `compute_type`
<a name="queue-compute-type"></a>

**（可选）**定义要为此队列启动的实例的类型。该设置替代 [`cluster_type`](cluster-definition.md#cluster-type) 设置。

有效的选项为：`ondemand` 和 `spot`。

默认值为 `ondemand`。

有关竞价型实例的更多信息，请参阅[使用竞价型实例](spot.md)。

**注意**  
使用竞价型实例要求您的账户中存在 `AWSServiceRoleForEC2Spot` 服务相关角色。要使用在您的账户中创建此角色 AWS CLI，请运行以下命令：  

```
aws iam create-service-linked-role --aws-service-name spot.amazonaws.com
```
有关更多信息，请参阅 *Amazon EC2 用户指南*中的[竞价型实例请求的服务相关角色](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html#service-linked-roles-spot-instance-requests)。

以下示例 SpotInstances 用于此队列中的计算节点。

```
compute_type = spot
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `disable_hyperthreading`
<a name="queue-disable-hyperthreading"></a>

**（可选）**对此队列中的节点禁用超线程。并非所有实例类型都可以禁用超线程。有关支持禁用超线程的实例类型列表，请参阅 A *mazon EC2 用户*指南中[每种实例类型的 CPU 核心和每个 CPU 内核的线程](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values)。如果定义了 [`[cluster]` 部分](cluster-definition.md)中的 [`disable_hyperthreading`](cluster-definition.md#disable-hyperthreading) 设置，则不能定义此设置。

默认值为 `false`。

```
disable_hyperthreading = true
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `enable_efa`
<a name="queue-enable-efa"></a>

**（可选）**如果设置为 `true`，则指定为此队列中的节点启用 Elastic Fabric Adapter (EFA)。要查看支持 EFA 的 EC2 实例列表，请参阅 *Amazon Linux 实例 EC2 用户指南中的支持的实例*[类型](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html#efa-instance-types)。如果定义了 [`[cluster]` 部分](cluster-definition.md)中的 [`enable_efa`](cluster-definition.md#enable-efa) 设置，则不能定义此设置。应使用集群置放群组来最大限度地减少实例之间的延迟。有关更多信息，请参阅[`placement`](cluster-definition.md#placement)和[`placement_group`](cluster-definition.md#placement-group)。

```
enable_efa = true
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `enable_efa_gdr`
<a name="queue-enable-efa-gdr"></a>

**（可选）**从 2.11.3 AWS ParallelCluster 版本开始，此设置无效。Elastic Fabric Adapter (EFA) GPUDirect 对计算节点的 RDMA（远程直接内存访问）支持始终处于启用状态（如果实例类型支持），则始终处于启用状态。

**注意**  
AWS ParallelCluster 版本 2.10.0 到 2.11.2：如果`true`，则指定为该队列中的节点启用弹性结构适配器 (EFA) Fabric GPUDirect RDMA（远程直接内存访问）。将其设置为`true`要求将该[`enable_efa`](#queue-enable-efa)设置设置为 `true` .EF GPUDirect A RDMA，这些操作系统（`alinux2`、`centos7``ubuntu1804`、或 `p4d.24xlarge``ubuntu2004`）支持以下实例类型 ()。如果定义了 [`[cluster]` 部分](cluster-definition.md)中的 [`enable_efa_gdr`](cluster-definition.md#enable-efa-gdr) 设置，则不能定义此设置。应使用集群置放群组来最大限度地减少实例之间的延迟。有关更多信息，请参阅[`placement`](cluster-definition.md#placement)和[`placement_group`](cluster-definition.md#placement-group)。

默认值为 `false`。

```
enable_efa_gdr = true
```

**注意**  
在 2.10.0 AWS ParallelCluster 版本中添加`enable_efa_gdr`了对 Support 的支持。

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `placement_group`
<a name="queue-placement-group"></a>

**（可选）**如果存在，则定义此队列的置放群组。该设置替代 [`placement_group`](cluster-definition.md#placement-group) 设置。

有效选项为以下值：
+ `DYNAMIC`
+ 现有的 Amazon EC2 集群置放群组名称

当设置为 `DYNAMIC` 时，将此队列的唯一置放群组作为集群堆栈的一部分进行创建和删除。

有关置放群组的更多信息，请参阅 *Amazon EC2 用户指南*中的[置放群组](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html)。如果将同一个置放群组用于不同的实例类型，则请求更有可能因容量不足错误而失败。有关更多信息，请参阅 *Amazon EC2 用户指南*中的[实例容量不足](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/troubleshooting-launch.html#troubleshooting-launch-capacity)。

没有默认值。

并非所有实例类型都支持集群置放群组。例如，`t2.micro` 不支持集群置放群组。有关支持集群置放群组的实例类型列表的信息，请参阅 *Amazon EC2 用户指南*中的[集群置放群组规则和限制](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#placement-groups-limitations-cluster)。有关使用置放群组时的提示，请参阅[置放群组和实例启动问题](troubleshooting.md#placement-groups-and-instance-launch-issues)。

```
placement_group = DYNAMIC
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

# `[raid]` 部分
<a name="raid-section"></a>

定义通过多个完全相同的 Amazon EBS 卷构建的 RAID 阵列的配置设置。RAID 驱动器挂载到头节点上并通过 NFS 导出到计算节点。

格式为`[raid raid-name]`。 *raid-name*必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

```
[raid rs]
shared_dir = raid
raid_type = 1
num_of_raid_volumes = 2
encrypted = true
```

**Topics**
+ [`shared_dir`](#raid-shared-dir)
+ [`ebs_kms_key_id`](#raid-ebs_kms_key_id)
+ [`encrypted`](#raid-encrypted)
+ [`num_of_raid_volumes`](#num-of-raid-volumes)
+ [`raid_type`](#raid-type)
+ [`volume_iops`](#raid-volume-iops)
+ [`volume_size`](#raid-volume-size)
+ [`volume_throughput`](#raid-volume-throughput)
+ [`volume_type`](#raid-volume-type)

## `shared_dir`
<a name="raid-shared-dir"></a>

**（必需）**定义头节点和计算节点上 RAID 阵列的挂载点。

仅在指定此参数时创建 RAID 驱动器。

请勿使用 `NONE` 或 `/NONE` 作为共享目录。

以下示例在 `/raid` 上挂载阵列。

```
shared_dir = raid
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `ebs_kms_key_id`
<a name="raid-ebs_kms_key_id"></a>

**（可选）**指定用于加密的自定义密 AWS KMS 钥。

此参数必须与 `encrypted = true` 一起使用，并且它必须具有自定义 [`ec2_iam_role`](cluster-definition.md#ec2-iam-role)。

有关更多信息，请参阅 [使用自定义 KMS 密钥对磁盘加密](tutorials_04_encrypted_kms_fs.md)。

```
ebs_kms_key_id = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `encrypted`
<a name="raid-encrypted"></a>

**（可选）**指定是否对文件系统加密。

默认值为 `false`。

```
encrypted = false
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `num_of_raid_volumes`
<a name="num-of-raid-volumes"></a>

**（可选）**定义用于组装 RAID 阵列的 Amazon EBS 卷数。

最小卷数为 `2`。

最大卷数为 `5`。

默认值为 `2`。

```
num_of_raid_volumes = 2
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `raid_type`
<a name="raid-type"></a>

**（必需）**定义 RAID 阵列的 RAID 类型。

仅在指定此参数时创建 RAID 驱动器。

有效选项为以下值：
+ `0`
+ `1`

有关 RAID 类型的更多信息，请参阅《*亚马逊 EC2 用户指南*》中的 [RAID 信息](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/raid-config.html)。

以下示例创建 RAID `0` 阵列：

```
raid_type = 0
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `volume_iops`
<a name="raid-volume-iops"></a>

**（可选）**为 `io1`、`io2` 和 `gp3` 类型卷定义 IOPS 数。

默认值、支持的值以及 `volume_size`/`volume_iops` 比率因 [`volume_type`](#raid-volume-type) 和 [`volume_size`](#raid-volume-size) 而异。

`volume_type` = `io1`  
默认值：`volume_iops` = 100  
支持的值：`volume_iops` = 100–64000 †  
最大 `volume_iops`/`volume_size` 比率 = 50 IOPS/GiB。5000 IOPS 需要至少 100 GiB 的 `volume_size`。

`volume_type` = `io2`  
默认值：`volume_iops` = 100  
支持的值：`volume_iops` = 100–64000（`io2` Block Express 卷为 256000）†  
最大 `volume_iops`/`volume_size` 比率 = 500 IOPS/GiB。5000 IOPS 需要至少 10 GiB 的 `volume_size`。

`volume_type` = `gp3`  
默认值：`volume_iops` = 3000  
支持的值：`volume_iops` = 3000–16000  
最大 `volume_iops`/`volume_size` 比率 = 500 IOPS/GiB。5000 IOPS 需要至少 10 GiB 的 `volume_size`。

```
volume_iops = 3000
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

† 只有[在 Nitro System 上构建的实例](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances)配置超过 32000 IOPS 时，才能保证最大 IOPS。其他实例保证最高为 32000 IOPS。除非您[修改卷](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modify-volume.html)，否则较旧的 `io1` 卷可能无法实现完全性能。`io2`Block Express 卷支持高达 256000 的 `volume_iops` 值。有关更多信息，请参阅《*亚马逊 EC2 用户指南》*[中的 “`io2`屏蔽 Express 卷（预览版）](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html#io2-block-express)”。

## `volume_size`
<a name="raid-volume-size"></a>

**（可选）**定义要创建的卷的大小，以 GiB 为单位。

默认值和支持的值因 [`volume_type`](#raid-volume-type) 而异。

`volume_type` = `standard`  
默认值：`volume_size` = 20 GiB  
支持的值：`volume_size` = 1–1024 GiB

`volume_type` = `gp2`、`io1`、`io2` 和 `gp3`  
默认值：`volume_size` = 20 GiB  
支持的值：`volume_size` = 1–16384 GiB

`volume_type` = `sc1` 和 `st1`  
默认值：`volume_size` = 500 GiB  
支持的值：`volume_size` = 500–16384 GiB

```
volume_size = 20
```

**注意**  
在 2.10.1 AWS ParallelCluster 版本之前，所有卷类型的默认值均为 20 GiB。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `volume_throughput`
<a name="raid-volume-throughput"></a>

**（可选）**定义 `gp3` 卷类型的吞吐量，以 MiB/s 为单位。

默认值为 `125`。

支持的值：`volume_throughput` = 125–1000 MiB/s

`volume_throughput` 与 `volume_iops` 的比率不能超过 0.25。1000 MiB/s 的最大吞吐量要求 `volume_iops` 设置至少为 4000。

```
volume_throughput = 1000
```

**注意**  
在 2.10.1 AWS ParallelCluster 版本中增加了对 Support 的支持。`volume_throughput`

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `volume_type`
<a name="raid-volume-type"></a>

**（可选）**定义要构建的卷的类型。

有效选项为以下值：

`gp2`, `gp3`  
通用型 SSD

`io1`, `io2`  
预调配 IOPS SSD

`st1`  
吞吐量优化型 HDD

`sc1`  
Cold HDD

`standard`  
上一代磁介质

有关更多信息，请参阅《[亚马逊* EC2 用户指南》中的 Amaz* on EBS 卷类型](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)。

默认值为 `gp2`。

```
volume_type = io2
```

**注意**  
在 2.10.1 AWS ParallelCluster 版本中增加了对`gp3`和`io2`的支持。

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

# `[scaling]` 部分
<a name="scaling-section"></a>

**Topics**
+ [`scaledown_idletime`](#scaledown-idletime)

指定用于定义计算节点如何扩展的设置。

格式为`[scaling scaling-name]`。 *scaling-name*必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

```
[scaling custom]
scaledown_idletime = 10
```

## `scaledown_idletime`
<a name="scaledown-idletime"></a>

**（可选）**指定没有作业的时间量（以分钟为单位），经过此时段后，计算节点将终止。

如果 `awsbatch` 为调度器，则不使用此参数。

默认值为 `10`。

```
scaledown_idletime = 10
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

# `[vpc]` 部分
<a name="vpc-section"></a>

指定 Amazon VPC 配置设置。有关更多信息 VPCs，请参阅[什么是 Amazon VPC？](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) 以及 *Amazon VPC 用户指南中有关您的 VPC* [的安全最佳实践](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-best-practices.html)。

格式为`[vpc vpc-name]`。 *vpc-name*必须以字母开头，不能超过 30 个字符，并且只能包含字母、数字、连字符 (-) 和下划线 (\$1)。

```
[vpc public]
vpc_id = vpc-xxxxxx
master_subnet_id = subnet-xxxxxx
```

**Topics**
+ [`additional_sg`](#additional-sg)
+ [`compute_subnet_cidr`](#compute-subnet-cidr)
+ [`compute_subnet_id`](#compute-subnet-id)
+ [`master_subnet_id`](#master-subnet-id)
+ [`ssh_from`](#ssh-from)
+ [`use_public_ips`](#use-public-ips)
+ [`vpc_id`](#vpc-id)
+ [`vpc_security_group_id`](#vpc-security-group-id)

## `additional_sg`
<a name="additional-sg"></a>

**（可选）**提供适用于所有实例的其他 Amazon VPC 安全组 ID。

没有默认值。

```
additional_sg = sg-xxxxxx
```

## `compute_subnet_cidr`
<a name="compute-subnet-cidr"></a>

**（可选）**指定无类别域间路由 (CIDR) 块。如果要创建计算子网 AWS ParallelCluster ，请使用此参数。

```
compute_subnet_cidr = 10.0.100.0/24
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `compute_subnet_id`
<a name="compute-subnet-id"></a>

**（可选）**指定要在其中预置计算节点的现有子网的 ID。

如果未指定，则 [`compute_subnet_id`](#compute-subnet-id) 使用 [`master_subnet_id`](#master-subnet-id) 的值。

如果子网是私有子网，则必须设置 NAT 以进行 Web 访问。

```
compute_subnet_id = subnet-xxxxxx
```

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `master_subnet_id`
<a name="master-subnet-id"></a>

**（必需）**指定要在其中预置头节点的现有子网的 ID。

```
master_subnet_id = subnet-xxxxxx
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `ssh_from`
<a name="ssh-from"></a>

**（可选）**指定允许从中进行 SSH 访问的 CIDR 格式的 IP 范围。

此参数仅在 AWS ParallelCluster 创建安全组时使用。

默认值为 `0.0.0.0/0`。

```
ssh_from = 0.0.0.0/0
```

[更新策略：可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-setting-supported)

## `use_public_ips`
<a name="use-public-ips"></a>

**（可选）**定义是否向计算实例分配公有 IP 地址。

如果设置为 `true`，则弹性 IP 地址与头节点相关联。

如果设置为 `false`，则根据“自动分配公有 IP”子网配置参数的值，头节点将具有或没有公有 IP。

有关示例，请参阅[联网配置](networking.md)。

默认值为 `true`。

```
use_public_ips = true
```

**重要**  
默认情况下，每个地址 AWS 账户 仅限于五 (5) 个弹性 IP 地址 AWS 区域。有关更多信息，请参阅 *Amazon EC2 用户指南*中的[弹性 IP 地址限制](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#using-instance-addressing-limit)。

[更新策略：必须停止计算实例集才能更改此设置以进行更新。](using-pcluster-update.md#update-policy-compute-fleet)

## `vpc_id`
<a name="vpc-id"></a>

**（必需）**指定要在其中预置集群的 Amazon VPC 的 ID。

```
vpc_id = vpc-xxxxxx
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `vpc_security_group_id`
<a name="vpc-security-group-id"></a>

**（可选）**指定将现有安全组用于所有实例。

没有默认值。

```
vpc_security_group_id = sg-xxxxxx
```

创建的安全组 AWS ParallelCluster 允许使用端口 22 从设置中指定的地址进行 SSH 访问，如果未指定[`ssh_from`](#ssh-from)设置，则允许使用所有 IPv4 地址 (`0.0.0.0/0`) 进行 SSH 访问。[`ssh_from`](#ssh-from)如果启用了 Amazon DCV，则安全组允许使用端口 8443（或任何设置指定）从[`port`](dcv-section.md#dcv-section-port)设置中指定的地址访问 Amazon DCV，如果未指定[`access_from`](dcv-section.md#dcv-section-access-from)设置，则允许使用所有 IPv4 地址 (`0.0.0.0/0`) 访问 Amazon DCV。[`access_from`](dcv-section.md#dcv-section-access-from)

**警告**  
您可以更改此参数的值并更新集群（如果[`[cluster]`[`fsx_settings`](cluster-definition.md#fsx-settings)](cluster-definition.md)未指定），或者两者兼而有之，`fsx_settings`并且[`fsx-fs-id`](fsx-section.md#fsx-fs-id)在[`[fsx fs]`](fsx-section.md)中为 Lustre 文件系统指定了外部现有 FSx 的 Lustre 文件系统。  
如果在和中指定了 FSx 适用于 Lustre 的 AWS ParallelCluster 托管文件系统，则无法更改此参数`fsx_settings`的`[fsx fs]`值。

[更新政策：如果配置中未指定 AWS ParallelCluster 托管 Amazon FSx for Lustre 文件系统，则可以在更新期间更改此设置。](using-pcluster-update.md#update-policy-no-managed-fsx-lustre)

# 示例
<a name="examples"></a>

以下示例配置演示了使用以下方法的 AWS ParallelCluster 配置 Slurm, Torque和 AWS Batch 调度程序。

**注意**  
从 2.11.5 版开始， AWS ParallelCluster 不支持使用 SGE 或 Torque 调度器。

**Contents**
+ [Slurm Workload Manager (`slurm`)](#example.slurm)
+ [Son of Grid Engine (`sge`) 和 Torque Resource Manager (`torque`)](#example.torque)
+ [AWS Batch (`awsbatch`)](#example.awsbatch)

## Slurm Workload Manager (`slurm`)
<a name="example.slurm"></a>

以下示例使用 `slurm` 计划程序启动集群。该示例配置启动 1 个包含 2 个作业队列的集群。第一个队列 `spot` 最初具有 2 个可用的 `t3.micro` 竞价型实例。它可以纵向扩展到最多 10 个实例，并可在 10 分钟没有作业运行时缩减到最少 1 个实例（可使用 [`scaledown_idletime`](scaling-section.md#scaledown-idletime) 设置进行调整）。第二个队列 `ondemand` 从没有实例开始，最多可以纵向扩展到 5 个 `t3.micro` 按需型实例。

```
[global]
update_check = true
sanity_check = true
cluster_template = slurm

[aws]
aws_region_name = <your AWS 区域>

[vpc public]
master_subnet_id = <your subnet>
vpc_id = <your VPC>

[cluster slurm]
key_name = <your EC2 keypair name>
base_os = alinux2                   # optional, defaults to alinux2
scheduler = slurm
master_instance_type = t3.micro     # optional, defaults to t3.micro
vpc_settings = public
queue_settings = spot,ondemand

[queue spot]
compute_resource_settings = spot_i1
compute_type = spot                 # optional, defaults to ondemand

[compute_resource spot_i1]
instance_type = t3.micro
min_count = 1                       # optional, defaults to 0
initial_count = 2                   # optional, defaults to 0

[queue ondemand]
compute_resource_settings = ondemand_i1

[compute_resource ondemand_i1]
instance_type = t3.micro
max_count = 5                       # optional, defaults to 10
```

## Son of Grid Engine (`sge`) 和 Torque Resource Manager (`torque`)
<a name="example.torque"></a>

**注意**  
此示例仅适用于 AWS ParallelCluster 2.11.4 及以下版本。从 2.11.5 版开始， AWS ParallelCluster 不支持使用 SGE 或 Torque 调度器。

以下示例使用 `torque` 划 `sge` 调度器启动集群。要将 SGE，更改`scheduler = torque`为`scheduler = sge`。该示例配置允许最多 5 个并发节点，且当 10 分钟没有作业运行时缩减到 2 个节点。

```
[global]
update_check = true
sanity_check = true
cluster_template = torque

[aws]
aws_region_name = <your AWS 区域>

[vpc public]
master_subnet_id = <your subnet>
vpc_id = <your VPC>

[cluster torque]
key_name = <your EC2 keypair name>but they aren't eligible for future updates
base_os = alinux2                   # optional, defaults to alinux2
scheduler = torque                  # optional, defaults to sge
master_instance_type = t3.micro     # optional, defaults to t3.micro
vpc_settings = public
initial_queue_size = 2              # optional, defaults to 0
maintain_initial_size = true        # optional, defaults to false
max_queue_size = 5                  # optional, defaults to 10
```

**注意**  
从 2.11.5 版开始， AWS ParallelCluster 不支持使用 SGE 或 Torque 调度器。如果您使用这些版本，则可以继续使用它们，或者从 AWS 服务和 Support 团队那里获得故障排除 AWS 支持。

## AWS Batch (`awsbatch`)
<a name="example.awsbatch"></a>

以下示例使用 `awsbatch` 计划程序启动集群。它设置为根据您的作业资源需求来选择更好的实例类型。

该示例配置允许最多 40 个并发 vCPUs，并且在 10 分钟内没有作业运行时缩小到零（可使用该[`scaledown_idletime`](scaling-section.md#scaledown-idletime)设置进行调整）。

```
[global]
update_check = true
sanity_check = true
cluster_template = awsbatch

[aws]
aws_region_name = <your AWS 区域>

[vpc public]
master_subnet_id = <your subnet>
vpc_id = <your VPC>

[cluster awsbatch]
scheduler = awsbatch
compute_instance_type = optimal # optional, defaults to optimal
min_vcpus = 0                   # optional, defaults to 0
desired_vcpus = 0               # optional, defaults to 4
max_vcpus = 40                  # optional, defaults to 20
base_os = alinux2               # optional, defaults to alinux2, controls the base_os of
                                # the head node and the docker image for the compute fleet
key_name = <your EC2 keypair name>
vpc_settings = public
```