

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 設定佇列的儲存設定檔
<a name="storage-profiles-for-queues"></a>

 佇列的組態包含提交至佇列之任務需要存取之共用檔案系統位置的區分大小寫名稱清單。例如，提交至佇列的任務`Q1`需要檔案系統位置`FSCommon`和 `FS1`。提交至佇列的任務`Q2`需要檔案系統位置 `FSCommon`和 `FS2`。

若要將佇列的組態設定為需要這些檔案系統位置，請使用下列指令碼：

```
# Change the value of FARM_ID to your farm's identifier
FARM_ID=farm-{{00112233445566778899aabbccddeeff}}
# Change the value of QUEUE1_ID to queue Q1's identifier
QUEUE1_ID=queue-{{00112233445566778899aabbccddeeff}}
# Change the value of QUEUE2_ID to queue Q2's identifier
QUEUE2_ID=queue-{{00112233445566778899aabbccddeeff}}

aws deadline update-queue --farm-id $FARM_ID --queue-id $QUEUE1_ID \
  --required-file-system-location-names-to-add FSComm FS1

aws deadline update-queue --farm-id $FARM_ID --queue-id $QUEUE2_ID \
  --required-file-system-location-names-to-add FSComm FS2
```

 佇列的組態也包含允許儲存設定檔的清單，這些設定檔適用於提交到 的任務，以及與該佇列相關聯的機群。只有定義佇列所有必要檔案系統位置的檔案系統位置的儲存設定檔，才允許在佇列的允許儲存設定檔清單中。

如果您提交的儲存描述檔不在佇列允許的儲存描述檔清單中，則任務會失敗。您可以隨時將沒有儲存設定檔的任務提交至佇列。標記為 `WSAll`和 的工作站組態`WS1`都有佇列 所需的檔案系統位置 (`FSCommon` 和 `FS1`)`Q1`。他們需要被允許將任務提交到佇列。同樣地，工作站會設定 `WSAll`並`WS2`符合佇列 的要求`Q2`。必須允許他們提交任務至該佇列。更新兩個佇列組態，以允許使用下列指令碼搭配這些儲存設定檔提交任務：

```
# Change the value of WSALL_ID to the identifier of the WSAll storage profile
WSALL_ID=sp-{{00112233445566778899aabbccddeeff}}
# Change the value of WS1 to the identifier of the WS1 storage profile
WS1_ID=sp-{{00112233445566778899aabbccddeeff}}
# Change the value of WS2 to the identifier of the WS2 storage profile
WS2_ID=sp-{{00112233445566778899aabbccddeeff}}

aws deadline update-queue --farm-id $FARM_ID --queue-id $QUEUE1_ID \
  --allowed-storage-profile-ids-to-add $WSALL_ID $WS1_ID

aws deadline update-queue --farm-id $FARM_ID --queue-id $QUEUE2_ID \
  --allowed-storage-profile-ids-to-add $WSALL_ID $WS2_ID
```

 如果您將`WS2`儲存描述檔新增至佇列允許的儲存描述檔清單`Q1`，則會失敗：

```
$ aws deadline update-queue --farm-id $FARM_ID --queue-id $QUEUE1_ID \
  --allowed-storage-profile-ids-to-add $WS2_ID

An error occurred (ValidationException) when calling the UpdateQueue operation: Storage profile id: sp-{{00112233445566778899aabbccddeeff}} does not have required file system location: FS1
```

 這是因為`WS2`儲存描述檔不包含`FS1`佇列`Q1`所需檔案系統位置的定義。

 將已設定的機群與不在佇列允許儲存設定檔清單中的儲存設定檔建立關聯也會失敗。例如：

```
$ aws deadline create-queue-fleet-association --farm-id $FARM_ID \
   --fleet-id $FLEET_ID \
   --queue-id $QUEUE1_ID

An error occurred (ValidationException) when calling the CreateQueueFleetAssociation operation: Mismatch between storage profile ids.
```

若要修正錯誤，請將名為 `WorkerConfig` 的儲存設定檔新增至佇列 `Q1`和佇列 的允許儲存設定檔清單`Q2`。然後，將機群與這些佇列建立關聯，以便機群中的工作者可以從兩個佇列執行任務。

```
# Change the value of FLEET_ID to your fleet's identifier
FLEET_ID=fleet-{{00112233445566778899aabbccddeeff}}
# Change the value of WORKER_CFG_ID to your storage profile named WorkerCfg
WORKER_CFG_ID=sp-{{00112233445566778899aabbccddeeff}}

aws deadline update-queue --farm-id $FARM_ID --queue-id $QUEUE1_ID \
  --allowed-storage-profile-ids-to-add $WORKER_CFG_ID

aws deadline update-queue --farm-id $FARM_ID --queue-id $QUEUE2_ID \
  --allowed-storage-profile-ids-to-add $WORKER_CFG_ID

aws deadline create-queue-fleet-association --farm-id $FARM_ID \
  --fleet-id $FLEET_ID \
  --queue-id $QUEUE1_ID

aws deadline create-queue-fleet-association --farm-id $FARM_ID \
  --fleet-id $FLEET_ID \
  --queue-id $QUEUE2_ID
```