

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

# 將 AWS ParallelCluster 受管儲存體轉換為外部儲存體
<a name="shared-storage-conversion-v3"></a>

了解如何將 AWS ParallelCluster 受管儲存轉換為外部儲存。

這些程序是以下列範例組態檔案程式碼片段為基礎。

```
...
  - MountDir: /fsx
    Name: fsx
    StorageType: FsxLustre
    FsxLustreSettings:
      StorageCapacity: 1200
      DeletionPolicy: Delete
...
```

**將 AWS ParallelCluster 受管儲存體轉換為外部儲存體**

1. 在叢集組態檔案中`Retain`將 `DeletionPolicy`設定為 。

   ```
   ...
      - MountDir: /fsx
        Name: fsx
        StorageType: FsxLustre
        FsxLustreSettings:
          StorageCapacity: 1200
          DeletionPolicy: Retain
   ...
   ```

1. 若要設定`DeletionPolicy`變更，請執行下列命令。

   ```
   pcluster update-cluster -n cluster-name -c cluster-config.yaml
   ```

1. 從叢集組態檔案移除 `SharedStorage`區段。

   ```
   ...
   ...
   ```

1. 若要將 受`SharedStorage`管變更為外部，`SharedStorage`並將其從叢集分離，請執行下列命令。

   ```
   pcluster update-cluster -n cluster-name -c cluster-config.yaml
   ```

1. 您的共用儲存體現在位於外部，並與叢集分離。

1. 若要將外部檔案系統連接到原始叢集或其他叢集，請遵循下列步驟。

   1. 取得 FSx for Lustre 檔案系統 ID。

      1. 若要使用 AWS CLI 執行下列命令，並尋找名稱包含原始叢集名稱的檔案系統，並記下檔案系統 ID。

         ```
         aws fsx describe-file-systems
         ```

      1. 若要使用 AWS 管理主控台，請登入並導覽至 https：//[https://console.aws.amazon.com/fsx/](https://console.aws.amazon.com/fsx/)。在檔案系統清單中，尋找名稱包含原始叢集名稱的檔案系統，並記下檔案系統 ID。

   1. 更新檔案系統安全群組規則，以提供對檔案系統和叢集子網路的存取。您可以在 Amazon FSx 主控台中找到檔案系統安全群組名稱和 ID。

      將規則新增至檔案系統安全群組，以允許傳入和傳出 TCP 流量往返前端節點和運算節點 IP CIDR 範圍或字首。為傳入和傳出 TCP 流量指定 TCP 連接埠 988、1021、1022 和 1023。

      如需詳細資訊，請參閱《第 [`SharedStorage`](SharedStorage-v3.md) 2 [`FsxLustreSettings`](SharedStorage-v3.md#SharedStorage-v3-FsxLustreSettings) 版使用者指南》中的 / / [`FileSystemId`](SharedStorage-v3.md#yaml-SharedStorage-FsxLustreSettings-FileSystemId)和建立、設定和刪除 Amazon EC2 的安全群組。 [ Amazon EC2 ](https://docs.aws.amazon.com/cli/latest/userguide/cli-services-ec2-sg.html) *AWS Command Line Interface *

   1. 將 `SharedStorage`區段新增至叢集組態。

      ```
      ...
         - MountDir: /fsx
           Name: fsx-external
           StorageType: FsxLustre
           FsxLustreSettings:
             FileSystemId: fs-02e5b4b4abd62d51c
      ...
      ```

   1. 若要將外部共用儲存新增至叢集，請執行下列命令。

      ```
      pcluster update-cluster -n cluster-name -c cluster-config.yaml
      ```