本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
Slurm集群快速容量不足故障转移
从AWS ParallelCluster版本 3.2.0 开始,集群在默认情况下启用快速容量不足故障转移模式下运行。这样可以最大限度地减少检测到 EC2 容量不足错误时重试排队任务所花费的时间。当您使用多种实例类型配置集群时,这尤其有效。
EC2 检测到容量不足故障:
-
InsufficientInstanceCapacity
-
InsufficientHostCapacity
-
InsufficientReservedInstanceCapacity
-
MaxSpotInstanceCountExceeded
-
SpotMaxPriceTooLow
:如果竞价请求价格,低于要求的最低竞价请求履行价格,则激活。 -
Unsupported
:使用特定实例不支持的实例类型激活AWS 区域。
在快速容量不足故障切换模式下,如果在将任务分配给 SlurmQueues/时检测到容量不足错误 compute resource,AWS ParallelCluster则执行以下操作:
-
它在预定义的时间段内将计算资源设置为禁用 (
DOWN
) 状态。 -
它
POWER_DOWN_FORCE
用于取消计算资源失败的节点任务并暂停故障节点。它将故障节点设置为IDLE
和POWER_DOWN (!)
状态,然后设置为POWERING_DOWN (%)
。 -
它将任务重新请求给另一个计算资源。
禁用计算资源的静态节点和已启动节点不受影响。作业可以在这些节点上完成。
重复此循环,直到任务成功分配给一个或多个计算资源节点。有关节点状态的信息,请参阅Slurm多队列模式指南。
如果找不到运行作业的计算资源,则作业将设置为PENDING
状态,直到预定义的时间段过去。在这种情况下,您可以修改预定义的时间段,如下一节所述。
容量不足超时参数
insufficient_capacity_timeout
insufficient_capacity_timeout
指定检测到容量不足错误时计算资源保持禁用 (down
) 状态的时间段(以秒为单位)。
默认情况下,insufficient_capacity_timeout
处于启用状态。
默认时间insufficient_capacity_timeout
为 600 秒(10 分钟)。
如果该insufficient_capacity_timeout
值小于或等于零,则禁用快速容量不足故障切换模式。
您可以通过在中的clustermgtd
配置文件中添加参数来更改该insufficient_capacity_timeout
值HeadNode
。/etc/parallelcluster/slurm_plugin/parallelcluster_clustermgtd.conf
可以在不停止计算队列的情况下随时更新该参数。
例如:
-
insufficient_capacity_timeout=600
:如果检测到容量不足错误,则将计算资源设置为禁用 (
DOWN
)。10 分钟后,其故障节点设置为idle~
(POWER_SAVING
) 状态。 -
insufficient_capacity_timeout=60
:如果检测到容量不足错误,则计算资源处于禁用状态 (
DOWN
)。1 分钟后,其故障节点将设置为idle~
状态。 -
insufficient_capacity_timeout=0
:快速容量不足故障切换模式已禁用。计算资源未被禁用。
注意
从节点因容量不足错误而出现故障到集群管理守护程序检测到节点故障的时间之间可能会有长达一分钟的延迟。这是因为集群管理守护程序会检查节点容量不足故障,并将计算资源每隔一分钟设置为down
状态。
快速容量不足故障切换模式状态
当集群处于快速容量不足故障切换模式时,您可以检查其状态和节点状态。
节点状态
当任务提交到计算资源动态节点并检测到容量不足错误时,该节点将down#
处于有原因的状态。
(Code:InsufficientInstanceCapacity)Failure when resuming nodes.
然后将已关闭电源的节点(处于idle~
状态的节点)设置为down~
有原因。
(Code:InsufficientInstanceCapacity)Temporarily disabling node due to insufficient capacity.
该作业被重新请求给队列中的其他计算资源。
计算资源静态节点和不受快速容量不足故障转移模式影响的节点。UP
考虑以下示例中所示的节点状态。
$
sinfo
PARTITION AVAIL TIMELIMIT NODES STATE NODELIST queue1* up infinite 30 idle~ queue1-dy-c-1-[1-15],queue1-dy-c-2-[1-15] queue2 up infinite 30 idle~ queue2-dy-c-1-[1-15],queue2-dy-c-2-[1-15]
我们向 queue1 提交了一个需要一个节点的任务。
$
sinfo
PARTITION AVAIL TIMELIMIT NODES STATE NODELIST queue1* up infinite 1 down# queue1-dy-c-1-1 queue1* up infinite 15 idle~ queue1-dy-c-2-[1-15] queue1* up infinite 14 down~ queue1-dy-c-1-[2-15] queue2 up infinite 30 idle~ queue2-dy-c-1-[1-15],queue2-dy-c-2-[1-15]
启动queue1-dy-c-1-1
节点以运行作业。但是,由于容量不足错误,实例未能启动。节点设置queue1-dy-c-1-1
为down
。计算资源 (queue2-dy-c-1
) 中已关闭电源的动态节点设置为down
。
您可以使用来检查节点原因scontrol show nodes
。
$
scontrol show nodes queue1-dy-c-1-1
NodeName=broken-dy-c-2-1 Arch=x86_64 CoresPerSocket=1 CPUAlloc=0 CPUTot=96 CPULoad=0.00 ... ExtSensorsJoules=n/s ExtSensorsWatts=0 ExtSensorsTemp=n/s Reason=(Code:InsufficientInstanceCapacity)Failure when resuming nodes [root@2022-03-10T22:17:50]
$
scontrol show nodes queue1-dy-c-1-2
NodeName=broken-dy-c-2-1 Arch=x86_64 CoresPerSocket=1 CPUAlloc=0 CPUTot=96 CPULoad=0.00 ... ExtSensorsJoules=n/s ExtSensorsWatts=0 ExtSensorsTemp=n/s Reason=(Code:InsufficientInstanceCapacity)Temporarily disabling node due to insufficient capacity [root@2022-03-10T22:17:50]
该作业排队到队列计算资源中的其他实例类型。
insufficient_capacity_timeout
经过后,计算资源中的节点将重置为idle~
状态。
$
sinfo
PARTITION AVAIL TIMELIMIT NODES STATE NODELIST queue1* up infinite 30 idle~ queue1-dy-c-1-[1-15],queue1-dy-c-2-[1-15] queue2 up infinite 30 idle~ queue2-dy-c-1-[1-15],queue2-dy-c-2-[1-15]
在insufficient_capacity_timeout
经过时间并将计算资源中的节点重置为idle~
状态后,Slurm调度程序会降低节点的优先级。除非出现以下情况之一,否则调度程序会继续从其他队列计算资源中选择权重更高的节点:
-
作业的提交要求与恢复的计算资源相匹配。
-
没有其他计算资源可用,因为它们已满负荷。
-
slurmctld
已重新启动。 -
AWS ParallelCluster计算队列已停止并开始关闭所有节点的电源并开启电源。
相关日志
与容量不足错误和快速容量不足故障转移模式相关的日志可以在resume
日志中Slurm找到,并在头节点clustermgtd
日志中找到。
- Slurm
resume
(/var/log/parallelcluster/slurm_resume.log
) -
节点因容量不足而无法启动时的错误消息。
[slurm_plugin.instance_manager:_launch_ec2_instances] - ERROR - Failed RunInstances request: dcd0c252-90d4-44a7-9c79-ef740f7ecd87 [slurm_plugin.instance_manager:add_instances_for_nodes] - ERROR - Encountered exception when launching instances for nodes (x1) ['queue1-dy-c-1-1']: An error occurred (InsufficientInstanceCapacity) when calling the RunInstances operation (reached max retries: 1): We currently do not have sufficient p4d.24xlarge capacity in the Availability Zone you requested (us-west-2b). Our system will be working on provisioning additional capacity. You can currently get p4d.24xlarge capacity by not specifying an Availability Zone in your request or choosing us-west-2a, us-west-2c.
- Slurm
clustermgtd
(/var/log/parallelcluster/clustermgtd
) -
由于容量不足,队列 1 中的计算资源 c-1 被禁用。
[slurm_plugin.clustermgtd:_reset_timeout_expired_compute_resources] - INFO - The following compute resources are in down state due to insufficient capacity: {'queue1': {'c-1': ComputeResourceFailureEvent(timestamp=datetime.datetime(2022, 4, 14, 23, 0, 4, 769380, tzinfo=datetime.timezone.utc), error_code='InsufficientInstanceCapacity')}}, compute resources are reset after insufficient capacity timeout (600 seconds) expired
容量不足超时到期后,将重置计算资源,将计算资源内的节点设置为
idle~
。[root:_reset_insufficient_capacity_timeout_expired_nodes] - INFO - Reset the following compute resources because insufficient capacity timeout expired: {'queue1': ['c-1']}