檢視檔案共用、共用連結及裝載目標

透過控制台、命令列介面 (CLI)、API 或 Terraform 檢視 File Storage for VPC 共用、存取者共用綁定及掛載目標。

在主控台中檢視檔案共用、共用綁定和掛載目標

在主控台中檢視所有檔案共用

  1. IBM Cloud 主控台中,按一下「導航功能表 圖示 > Infrastructure VPC 圖示 > 儲存 > 檔案儲存共用

  2. VPC 的檔案共用清單頁面會顯示在該區域中建立的所有檔案共用。 動作 功能表 「動作」圖示 選項用來管理檔案共用。 清單頁的資訊如下表所示。

文件共享清單頁面。
欄位
地區 檔案共用的帳戶區域。 選取不同的地區以查看該地區中區域的檔案共用。
名稱 檔案共用名稱。 它可以是原始檔案共用或抄本檔案共用。 按一下名稱以查看該檔案共用的詳細資料。
狀態 如需檔案共用的狀態清單,請參閱 檔案共用生命週期狀態
資源群組 欄位顯示檔案共用所屬資源群組的名稱。
位置 該欄位顯示檔案共用所在的區域。
裝載目標 與檔案共用相關聯的裝載目標數。 每個 VPC 對應的每個檔案共享,皆可設定一個掛載目標。
Snapshot 此欄位顯示檔案共用的快照數量。 此列預設為隱藏。 按一下「設定」圖示」,選擇您要查看的欄位。
大小 檔案共用的大小 (GB)。
跨帳戶角色 此列中的值可以是 None, Origin share,或 Accessor share。 如果值為 None,則不會與其他帳戶或外部服務共用共用。 如果值為 Origin share,則該共用與另一個帳戶或外部服務共用,並與另一個帳戶中的存取器共用綁定。 如果值是 Accessor share,則此共用與來源共用綁定,目的是存取來源共用的資料。
抄寫角色 來源和複製檔案共用之間的關係。 「的抄本」指出檔案共用已鏈結的來源共用抄本。 「來源」指出共用已鏈結之抄本的來源。 「無」表示檔案共用不會抄寫另一個共用。
抄寫狀態 此列預設為隱藏。 按一下「設定」圖示」,選擇您要查看的欄位。
加密類型 它顯示檔案共用的加密類型 (提供者管理或客戶管理)。 客戶管理的加密 會使用您自己的根金鑰來保護您的資料。 使用者介面亦會識別金鑰管理服務(KMS)。

您可以按一下 動作圖示 來存取「動作」功能表。 視檔案共用的狀態而定,「動作」功能表提供用來管理檔案共用的選項。

  • 對於處於_穩定_狀態的區域檔案共用,您可以選擇重新命名共用、編輯 IOPS、複製共享的 CRN、建立副本或刪除檔案共用。 如果您已設定複製至複製檔案共用,則會停用刪除建立複製動作。 如需詳細資訊,請參閱 建立複製檔案共用
  • 對於區域檔案共用,動作功能表包含重新命名、編輯大小和頻寬、複製 CRN、建立快照和刪除動作。

在主控台中檢視檔案共用的詳細資訊

  1. 跳至所有檔案共用的清單。 從 IBM Cloud 主控台,按一下「導航功能表 圖示 > Infrastructure VPC 圖示 > 儲存 > 檔案儲存共用

  2. 按一下檔案共用的名稱以查看詳細資料頁面。 會顯示檔案共用的可編輯名稱及狀態。 如果您將使用者或存取管理標籤套用到檔案共用,它們將列在狀態旁邊。 按一下 新增標籤,以將新的 標籤 套用至共用。

  3. 詳細資訊頁面有幾個選項卡。 預設顯示 “概覽” 標籤。

    • 概述- 下表描述了可用於文件共享的資訊。
    文件共享詳細資訊頁面
    欄位
    檔案共用詳細資料
    名稱 檔案共用名稱。 按一下 編輯圖示 「編輯」圖示,以變更名稱。
    檔案共用 ID 您建立檔案共用時產生的 UUID。
    資源群組 與帳戶中檔案共用相關聯的資源群組。
    建立日期 建立檔案共用的日期。
    位置 檔案共用的位置 (例如 us-south-2 )。
    抄寫角色 原始檔共用或抄本。
    加密 指定提供者管理或 客戶管理的加密。 當使用客戶管理的金鑰加密檔案共用時,也會顯示加密實例、加密金鑰名稱和加密金鑰 CRN。
    掛載目標存取模式
    已廢棄
    此欄位僅在檔案共用採用已廢止的 VPC 存取模式時才會顯示。 點擊「編輯圖示 編輯圖示」以切換存取模式。 如需更多資訊,請參閱 遷移指南
    CRN 檔案共用的可複製雲端資源名稱。
    傳輸模式下允許加密 此值顯示當用戶端存取檔案共用時是否需要傳輸中加密。 按一下 編輯圖示 「編輯」圖示,以變更容許的值。 可能的值是 User managed,和 None。 對於採用已廢棄的 VPC 存取模式的檔案共用,此欄位不適用。
    選擇連線方式 擁有特別權限、可預覽全新區域性檔案共享服務的客戶,可從 IPsec、Stunnel 及「無」中進行選擇。
    跨帳戶角色 可能的值為 None、Origin、Accessor。 對於採用已廢棄的 VPC 存取模式的檔案共用,此欄位不適用。
    Snapshot 計數 該值表示為文件共享拍攝的快照數。 對於採用已廢棄的 VPC 存取模式的檔案共用,此欄位不適用。
    所有快照中變更資料的大小 它表示所有快照中的可計費資料量。 對於採用已廢棄的 VPC 存取模式的檔案共用,此欄位不適用。
    設定檔詳細資料
    設定檔 定義檔案共享效能的共享 設定 檔的名稱。 在大多數情況下,dp2 profile。
    大小 檔案共享容量(以 GB 為單位)。
    IOPS 上限 指定共用的最大 IOPS。 此欄位顯示的是區域共用。
    頻寬 為共用指定的最大頻寬限制。 區域共用會顯示此欄位。
    裝載目標 與檔案共用相關聯的裝載目標數。 每個 VPC 對應的每個檔案共享,皆可設定一個掛載目標。 您可以為其他 VPC 建立更多裝載目標。 按一下 「動作」圖示,以重新命名或刪除裝載目標,或檢視裝載路徑。
    名稱 掛載目標的名稱。
    狀態 VPC 上裝載目標的狀態。
    虛擬私有雲
    已停用
    若檔案共用採用已廢止的 VPC 存取模式,則會顯示此欄位。 點擊名稱即可前往該 VPC 的詳細資訊頁面,您可在該頁面查看在該 VPC 中具有掛載目標 的檔案共用清單
    子網路 檔案共用具有安全群組存取模式時,會顯示此欄位。 按一下子網路的名稱以查看其詳細資料。
    安全群組 檔案共用具有安全群組存取模式時,會顯示此欄位。 這是共用所屬的安全群組數目。
    保留 IP 檔案共用具有安全群組存取模式時,會顯示此欄位。 連接至裝載目標之虛擬網路介面的 IP 位址
    傳輸中加密 檔案共用具有安全群組存取模式時,會顯示此欄位。 該值可啟用或停用。
    存取者共用連結 若該資源在其他 VPC 中擁有存取權資源,則會顯示此區段。
    連結 ID 此欄位顯示將原始共用連接至存取元共用的連結 ID。
    帳戶 ID 可透過存取元共用來存取共用資料的帳戶 ID。
    存取元 ID 此欄位顯示在另一個 VPC 中建立存取器共用的帳戶 ID。
    狀態 它會顯示存取元檔案共用的生命週期狀態。 預期為 status Stable
    建立日期 建立存取權限股份的日期與時間。
    檔案共用抄寫關係

    顯示來源及抄本檔案共用的名稱、位置及狀態

    • 如果未建立抄本檔案共用,請按一下 建立抄本建立抄本
    • 若要岔斷抄寫關係,請按一下 移除抄寫關係。 然後,抄本檔案共用會變成獨立讀寫檔案共用。
    抄寫頻率 將游標移至資訊圖示上方,以查看 Cron 抄寫排程的說明。
    狀態 抄寫狀態; 例如,suspendedavailable
    前次同步開始時間 前次抄寫開始的日期和時間。
    前次同步完成時間 上次複製作業結束的日期與時間。
    傳送速率 它顯示在前次同步期間,將資料從來源檔案共用複製到其抄本的速度。
    轉帳金額 在前次同步期間從來源檔案共用複製到其抄本的資料量。
    抄寫角色 來源或抄本檔案共用。
    檔案共用名稱 按一下檔案共用名稱以查看其詳細資料。
    位置 它會顯示檔案共用的區域資訊。
    狀態 它會顯示檔案共用的生命週期狀態。 預期為 status Stable
    • 快照- 在「快照」索引標籤中,您可以查看與所有快照相關的摘要,以及針對該檔案共用所建立的快照清單。

      • 快照摘要提供快照數量、快照中擷取的整體資料量、複製角色等資訊。
      • 快照清單顯示檔案共用的快照。 您可以看到名稱、拍攝快照時檔案共用的大小,以及快照的狀態。 您可以點擊 “建立” 來捕獲新快照。 點選 行動圖示 操作圖示 以顯示“操作”功能表。 操作選單有 2 個選項:恢復和刪除。
    • 監控- 在監控索引標籤上,您可以看到共用使用、總頻寬和總 IOPS 的三個圖表。 即使沒有IBM Cloud Monitoring實例,您也可以免費使用這些圖表。 您可以自訂日期範圍以查看一段時間內的資料。

      監控這些利用率指標可以幫助您確定應用程式或工作負載完成了多少工作。 您可以使用此資訊來確定是否需要調整 IOPS 值。 監視共享的可用容量可以幫助您確定是否需要更多存儲,以免空間不足導致將資料寫入共享或複製時出現問題。 查看這些指標可以幫助您預測計費週期結束時費用的任何變化。

      這些指標不會即時更新。 新檔案共用的資料可能需要一小時或一小時 15 分鐘才會出現在主控台的圖表中。 使用情況的變化可能需要 15 到 30 分鐘才能反映在圖表中。

      如果您有 IBM Cloud Monitoring 服務的實例,請按一下啟動監控,開啟 Sysdig Web UI,以使用那裡的度量指標儀表板。 有關如何設定IBM Cloud Monitoring實例的更多信息,請參閱 監控File Storage for VPC的指標

在主控台中檢視 VPC 的所有檔案共用

您可以透過檢視 VPC 詳細資料頁面,來查看具有 VPC 裝載目標的所有檔案共用。

  1. 移至 VPC:

    1. 檔案共用詳細資料頁面 中,按一下裝載目標清單中的 VPC 鏈結。
    2. 在 UI 中,按一下導航選單圖示選單圖示> 基礎架構VPC 圖示> 網路 > VPC。 按一下清單中的 VPC 名稱。
  2. 在 VPC 詳細資料頁面上,捲動至 此 VPC 中的檔案共用

在主控台中檢視掛載目標詳細資訊

  1. 跳至所有檔案共用的清單。 從 IBM Cloud 主控台,按一下「導航功能表 圖示 > Infrastructure VPC 圖示 > 儲存 > 檔案儲存共用
  2. 按一下檔案共用的名稱以查看詳細資料頁面。
  3. 捲動至裝載目標區段,以查看裝載目標清單。 此清單包含裝載目標的名稱及狀態,以及裝載目標所屬的 VPC。
  4. 按一下 動作 圖示 「動作」圖示,以顯示「動作」功能表。 「動作」功能表有 3 個選項:「重新命名」、「檢視路徑」和「刪除」。
  5. 按一下 檢視路徑,以查看您可以在裝載指令中複製並貼上的裝載路徑資訊。

從 CLI 檢視檔案共用、共用連結及裝載目標

在使用 CLI 之前,您必須先安裝「IBM Cloud」CLI 以及 VPC CLI 外掛程式。 如需相關資訊,請參閱 CLI 必要條件

從 CLI 檢視所有檔案共用

您可以使用 ibmcloud is shares 指令來列出地區中的所有檔案共用。

ibmcloud is shares
Listing shares in all resource groups and region us-south under account Test Account as user test.user@ibm.com...
ID                                          Name                     Lifecycle state   Zone         Profile   Size(GB)   Resource group   Replication role   Accessor binding role   Snapshot count   Snapshot size   Allowed Access Protocols   Availability Mode   Bandwidth(Mbps)   Storage Generation
r006-6cedac18-ffe5-4a89-9e7a-5c8683d17279   my-regional-file-share   stable            -            rfs       1000        defaults         none               none                    0                0               -                          regional            1500              2
r006-e4acfa9b-88b0-4f90-9320-537e6fa3482a   my-source-file-share     stable            us-south-2   dp2       10         defaults         source             none                    2                1               -                          zonal               -                 1
r006-455b601c-8fc1-4476-8771-4708c49c8ef7   my-replica-file-share    stable            us-south-1   dp2       10         defaults         replica            none                    2                1               -                          zonal               -                 1
r006-ee1f6fc0-6fa3-4821-ad70-f6589e30c566   my-accessor-share        stable            -           rfs        3000         defaults         none               accessor                0                0               -                          regional            1                 2
r006-fdd5774c-fe8a-41f4-9088-eafc89f58c09   my-origin-share          stable            -           rfs        3000        defaults         none               origin                  0                0               -                          regional            1                 2

如需指令選項的相關資訊,請參閱 ibmcloud is shares。 如需 lifecycle state 的相關資訊,請參閱預期的 檔案共用狀態Stable

從 CLI 檢視檔案共用的詳細資料

若要查看檔案共用的詳細資料,請執行 ibmcloud is share 指令,並依 ID 或名稱指定檔案共用。

下列範例依 ID 識別檔案共用。 此共用是基於 dp2 設定檔的抄本,並且使用安全群組授與對共用的存取權。 輸出也會提供來源檔案共用及抄寫詳細資料的相關資訊。

ibmcloud is share r006-455b601c-8fc1-4476-8771-4708c49c8ef7
Getting file share r006-455b601c-8fc1-4476-8771-4708c49c8ef7 under account Test Account as user test.user@ibm.com...
ID                                 r006-455b601c-8fc1-4476-8771-4708c49c8ef7
Name                               my-replica-file-share
CRN                                crn:v1:bluemix:public:is:us-south-1:a/a1234567::share:r006-455b601c-8fc1-4476-8771-4708c49c8ef7
Lifecycle state                    stable
Access control mode                security_group
Accessor binding role              none
Allowed transit encryption modes   none,ipsec
Zone                               us-south-1
Profile                            dp2
Size(GB)                           10
IOPS                               100
Encryption                         provider_managed
Mount Targets                      ID                          Name
                                   No mounted targets found.
Resource group                     ID                                 Name
                                   6edefe513d934fdd872e78ee6a8e73ef   defaults
Created                            2025-04-04T09:19:27+00:00
Latest job                         Job status   Job status reasons
                                   succeeded    -
Latest Sync                        Completed At                Data Transferred   Started At
                                   2025-04-18T21:00:04+00:00   3560               2025-04-18T21:00:00+00:00
Replication cron spec              00 * * * *
Replication role                   replica
Replication status                 active
Replication status reasons         Status code   Status message
                                   -             -
Source share                       ID                                          Name                    Resource type
                                   r006-e4acfa9b-88b0-4f90-9320-537e6fa3482a   my-source-file-share    share
Snapshot count                     0
Snapshot size                      0
Source snapshot                    -
Allowed Access Protocols           nfs4
Availability Mode                  zonal
Bandwidth(Mbps)                    1
Storage Generation                 1

您可以使用來源共用的名稱來擷取其詳細資料。 請參閱下列範例。

ibmcloud is share my-source-file-share
Getting file share my-source-file-share under account Test Account as user test.user@ibm.com...
ID                               r006-e4acfa9b-88b0-4f90-9320-537e6fa3482a
Name                             my-source-file-share
CRN                              crn:v1:bluemix:public:is:us-south-2:a/a1234567b::share:r006-e4acfa9b-88b0-4f90-9320-537e6fa3482a
Lifecycle state                  stable
Access control mode              security_group
Accessor binding role            origin
Allowed transit encryption modes ipsec,none
Zone                             us-south-2
Profile                          dp2
Size(GB)                         10
IOPS                             100
User Tags                        env:dev
Encryption                       provider_managed
Mount Targets                    ID                                          Name
                                 r006-fdbffc45-618c-49f1-bb08-ec530d7be378   my-source-mount-target
Resource group                   ID                                 Name
                                 6edefe513d934fdd872e78ee6a8e73ef   defaults
Created                          2024-06-25T15:42:53+00:00
Latest job                       Job status   Job status reasons
                                 succeeded    -
Replication share                ID                                          Name                    Resource type
                                 r006-455b601c-8fc1-4476-8771-4708c49c8ef7   my-replica-file-share   share
Replication role                 source
Replication status               active
Replication status reasons       Status code   Status message
                                 -             -
Snapshot count                   0
Snapshot size                    0
Source snapshot                  -
Allowed Access Protocols         nfs4
Availability Mode                zonal
Bandwidth(Mbps)                  1
Storage Generation               1

以下範例顯示 ibmcloud is share 指令在擷取地區檔案共用資訊時所傳回的資訊。

ibmcloud is share my-regional-file-share
Getting file share my-file-share under account Test Account as user test.user@ibm.com...
ID                                 r006-6cedac18-ffe5-4a89-9e7a-5c8683d17279
Name                               my-regional-file-share
CRN                                crn:v1:bluemix:public:is:us-south-2:a/a1234567::share:r006-6cedac18-ffe5-4a89-9e7a-5c8683d17279
Lifecycle state                    stable
Access control mode                security_group
Accessor binding role              none
Allowed transit encryption modes   stunnel,none
Zone                               -
Profile                            rfs
Size(GB)                           1000
IOPS                               35000
Encryption                         provider_managed
Mount Targets                      ID                       Name
                                   No mounted targets found
Resource group                     ID                                 Name
                                   db8e8d865a83e0aae03f25a492c5b39e   Default
Created                            2025-07-22T22:15:15+00:00
Replication role                   none
Replication status                 none
Replication status reasons         Status code   Status message
                                   -             -
Snapshot count                     0
Snapshot size                      0
Source snapshot                    -
Allowed Access Protocols           nsf4
Availability Mode                  regional
Bandwidth(Mbps)                    125
Storage Generation                 2

如需指令選項的相關資訊,請參閱 ibmcloud is share

從 CLI 檢視檔案共用的共用連結

若要從 CLI 查看連結到原始共享的訪客共享綁定,請使用 ibmcloud is share-accessor-bindings 命令。 請參閱下列範例。

ibmcloud is share-accessor-bindings my-origin-share
Listing accessor bindings for the share ID my-origin-share under account Test Account as user test.user@ibm.com...
ID                                          Lifecycle state   Created at                  Accessor CRN                                                                                                    Accessor resource type
r006-b5707b7b-1ac7-48c9-8fc3-4ba65b91e36f   stable            2025-08-26T21:03:40+00:00   crn:v1:bluemix:public:is::a/a1234567::share:r006-fdd5774c-fe8a-41f4-9088-eafc89f58c09   share
Viktoria_Muirhead@cloudshell:~$

從 CLI 檢視檔案共用的特定共用連結

若要從 CLI 查看連結到原始共享的特定訪客共享綁定,請使用 ibmcloud is share-accessor-binding 命令。 請參閱下列範例。

ibmcloud is share-accessor-binding my-origin-share r006-b5707b7b-1ac7-48c9-8fc3-4ba65b91e36f
Get accessor binding r006-b5707b7b-1ac7-48c9-8fc3-4ba65b91e36f for the share ID my-origin-share under account Test Account as user test.user@ibm.com...
ID                r006-b5707b7b-1ac7-48c9-8fc3-4ba65b91e36f
Created           2025-08-26T21:03:40+00:00
Href              https://us-south.iaas.cloud.ibm.com/v1/shares/r006-fdd5774c-fe8a-41f4-9088-eafc89f58c09/accessor_bindings/r006-b5707b7b-1ac7-48c9-8fc3-4ba65b91e36f
Resource type     share_accessor_binding
Lifecycle state   stable
Accessor          Resource type   CRN                                                                                                             Name
                  share           crn:v1:bluemix:public:is::a/a1234567::share:r006-fdd5774c-fe8a-41f4-9088-eafc89f58c09      my-accessor-share

從 CLI 檢視檔案共用的裝載目標

若要查看為檔案共用建立的所有裝載目標,請執行 ibmcloud is share-mount-targets 指令並指定檔案共用 ID。

ibmcloud is share-mount-targets r006-e1a89008-f23b-42f8-8e44-5b31ddf0aac7
Listing share mount target of r006-e4acfa9b-88b0-4f90-9320-537e6fa3482a in all resource groups and region us-south under account Test Account as user test.user@ibm.com...
ID                                          Name                     VPC      Lifecycle state   Transit Encryption
r006-fdbffc45-618c-49f1-bb08-ec530d7be378   my-source-mount-target   my-vpc   stable            none

如需指令選項的相關資訊,請參閱 ibmcloud is share-mount-targets

從 CLI 檢視裝載目標詳細資料

若要檢視裝載目標的更詳細資訊,請執行 ibmcloud is share-mount-target 指令,並使用裝載目標名稱或 ID 指定共用 ID 或名稱。 請參閱下列範例。

ibmcloud is share-mount-target  r006-e4acfa9b-88b0-4f90-9320-537e6fa3482a my-source-mount-target
Getting mount target ID my-source-mount-target for share ID r006-e4acfa9b-88b0-4f90-9320-537e6fa3482a under account Test Account as user test.user@ibm.com...
ID                          r006-fdbffc45-618c-49f1-bb08-ec530d7be378
Name                        my-source-mount-target
VPC                         ID                                          Name
                            r006-6e8fb140-5668-45b8-b98a-d5cb0e0bf39b   my-vpc
Access control mode         security_group
Resource type               share_mount_target
Virtual network interface   ID                                          Name
                            r006-3b0c00fa-0ce3-4ff8-9a5d-c7a645fbe530   my-source-vni
Lifecycle state             stable
Mount path                  10.240.64.6:/5975a795_e5e7_474c_82d3_46c1d4159c6a
Transit Encryption          none
Created                     2023-10-19T15:42:54+00:00

如需指令選項的相關資訊,請參閱 ibmcloud is share-mount-target

使用 API 檢視檔案共用、共用連結及裝載目標

您可以透過在 VPC API 中呼叫 /shares 方法,以程式化方式檢視共用及裝載目標,如下列範例要求中所示。

您必須提供 generation 參數並指定 generation=2。 如需更多資訊,請參閱《 虛擬私有雲 API 參考手冊 》中的「生成」章節。

使用 API 檢視抄寫狀態及生命週期狀態

  • lifecycle_state
    • 此內容透過 擷取檔案共用 方法提供資源的現行狀態。 lifecycle_state 所提供的值屬於通用性質,旨在適用於各種資源,而不僅限於檔案共用。lifecycle_state 表示檔案共用目前處於穩定、更新中、刪除中或暫停狀態。預期值為 Stable。 如需相關資訊,請參閱 檔案共用狀態
  • replication_status

使用 API 檢視所有檔案共用

提出 GET /shares 要求,以列出區域的所有檔案共用。

curl -X GET "$vpc_api_endpoint/v1/shares?version=2023-07-18?limit=50&generation=2" -H "Authorization: Bearer $iam_token"

成功的回應如下例所示。

{
  "first": {
    "href": "https://us-south.iaas.cloud.ibm.com/v1/shares?limit=50"
  },
  "limit": 50,
  "shares": [
    {
      "access_control_mode": "vpc",
      "created_at": "2023-07-18T13:02:17Z",
      "crn": "crn:[...]",
      "encryption": "provider_managed",
      "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/51bba578-0dce-4f8a-aa6e-f06c899e2c8e",
      "id": "51bba578-0dce-4f8a-aa6e-f06c899e2c8e",
      "iops": 3000,
      "lifecycle_state": "stable",
      "name": "share-name1",
      "profile": {
        "family": "tiered",
        "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/tier-10iops",
        "name": "tier-10iops",
        "resource_type": "share_profile"
      },
      "resource_group": {
        "crn": "crn:[...]",
        "href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/60fc731a-1794-4f5d-ba51-ea24b5357207",
        "id": "60fc731a-1794-4f5d-ba51-ea24b5357207",
        "name": "Default"
      },
      "resource_type": "share",
      "size": 40,
      "mount_targets": [
        {
          "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/51bba578-0dce-4f8a-aa6e-f06c899e2c8e/mount_targets/d5fd8173-f519-4ff7-8f63-0ead23ecf1f4",
          "id": "d5fd8173-f519-4ff7-8f63-0ead23ecf1f4",
          "name": "mount-target-name1",
          "resource_type": "share_target",
          "vpc": {
            "crn": "crn:[...]",
            "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/c2d941de-27f5-432c-b4d0-37a8491c3216",
            "id": "c2d941de-27f5-432c-b4d0-37a8491c3216",
            "name": "vpc-name1",
            "resource_type": "vpc"
          }
        }
      ],
      "zone": {
        "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1",
        "name": "us-south-1"
      }
    }
  ]
}

在範例中,limit 查詢參數指定 50 個檔案共用的限制,儘管範例回應僅包含一個。 access_control_mode 內容值為 vpc,表示檔案共用可以裝載在 VPC 中的所有虛擬伺服器實例上。 此存取控制模式已被廢棄。 按照 移轉指南 將您的共用存取控制模式更新為 security-group

使用 API 檢視單一檔案共用

提出 GET /shares/{share_id} 要求,以取得單一檔案共用的詳細資料。

curl -X GET \
"$vpc_api_endpoint/v1/shares/$share_id?version=2025-04-01&generation=2"\
-H "Authorization: Bearer $iam_token"

成功的回應如下例所示。 在此範例中,共用是使用 dp2 設定檔建立的。 access_ control_mode 內容值為 security_group,表示共用的存取權由安全群組的規則決定。

{
  "access_control_mode": "security_group",
  "accessor_binding_role": "none",
  "accessor_bindings": [],
  "allowed_access_protocol": "nsf4",
  "allowed_transit_encryption_modes": [
      "none",
      "ipsec"
  ],
  "availability_mode": "zonal",
  "bandwidth": 100,
  "created_at": "2025-04-04T09:17:14.000Z",
  "crn": "crn:v1:bluemix:public:is:us-south-2:a/a1234567::share:r006-4dadac27-cd17-42df-a5fe-1388705d33e0",
  "encryption": "provider_managed",
  "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-4dadac27-cd17-42df-a5fe-1388705d33e0",
  "id": "r006-4dadac27-cd17-42df-a5fe-1388705d33e0",
  "iops": 100,
  "latest_job": {
      "status": "succeeded",
      "status_reasons": [],
      "type": "replication_init"
  },
  "lifecycle_reasons": [],
  "lifecycle_state": "stable",
  "mount_targets": [],
  "name": "my-source-share-dal-2",
  "profile": {
      "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/dp2",
      "name": "dp2",
      "resource_type": "share_profile"
  },
  "replica_share": {
      "crn": "crn:v1:bluemix:public:is:us-south-1:a/a1234567::share:r006-455b601c-8fc1-4476-8771-4708c49c8ef7",
      "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-455b601c-8fc1-4476-8771-4708c49c8ef7",
      "id": "r006-455b601c-8fc1-4476-8771-4708c49c8ef7",
      "name": "my-replica-share-dal-1",
      "resource_type": "share"
  },
  "replication_role": "source",
  "replication_status": "active",
  "replication_status_reasons": [],
  "resource_group": {
      "href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/6edefe513d934fdd872e78ee6a8e73ef",
      "id": "6edefe513d934fdd872e78ee6a8e73ef",
      "name": "defaults"
  },
  "resource_type": "share",
  "size": 10,
  "snapshot_count": 0,
  "snapshot_size": 0,
  "storage_generation": 1,
  "user_tags": [],
  "zone": {
      "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-2",
      "name": "us-south-2"
  }
}

以下範例顯示使用 API 擷取區域檔案資訊時所傳回的回應。

curl -X GET \
"$vpc_api_endpoint/v1/shares/$share_id?version=2025-07-23&generation=2"\
-H "Authorization: Bearer $iam_token"

成功的回應如下例所示:

{
  "access_control_mode": "security_group",
  "accessor_binding_role": "none",
  "accessor_bindings": [],
  "allowed_access_protocol": "nsf4",
  "allowed_transit_encryption_modes": [
      "none",
      "stunnel"
  ],
  "availability_mode": "regional",
  "bandwidth": 100,
  "created_at": "2025-06-24T09:17:14.000Z",
  "crn": "crn:v1:bluemix:public:is:us-south:a/a1234567::share:r006-4dadac27-cd17-42df-a5fe-1388705d33f1",
  "encryption": "provider_managed",
  "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-4dadac27-cd17-42df-a5fe-1388705d33e0",
  "id": "r006-4dadac27-cd17-42df-a5fe-1388705d33ef1",
  "iops": 100,
  "latest_job": {
      "status": "succeeded",
      "status_reasons": [],
      "type": "replication_init"
  },
  "lifecycle_reasons": [],
  "lifecycle_state": "stable",
  "mount_targets": [],
  "name": "my-regional-share-us-south",
  "profile": {
      "family": "defined_performance",
      "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/rfs",
      "name": "rfs",
      "resource_type": "share_profile"
    },
    "resource_group": {
        "href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/6edefe513d934fdd872e78ee6a8e73ef",
        "id": "6edefe513d934fdd872e78ee6a8e73ef",
        "name": "defaults"
    },
    "resource_type": "share",
    "size": 100,
    "snapshot_count": 0,
    "snapshot_size": 0,
    "storage_generation": 2,
    "user_tags": []
}

列出與 API 共用之檔案的共用連結

發出 GET /shares/{id}/bindings 要求,以取得單一檔案共用的連結清單。 要求會列出共用的所有連結。 建立存取元共用時,會隱含地建立每一個連結。

curl -X GET "$vpc_api_endpoint/v1/shares/$share_id/bindings?version=2024-03-20&generation=2"\
-H "Authorization: Bearer $iam_token"

成功的回應如下例所示。

{
  "bindings": [
    {
      "accessor": {
        "crn": "crn:[...]",
        "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-f64efe74-a5a2-45c7-b37d-5071d2dd6339",
        "id": "r006-f64efe74-a5a2-45c7-b37d-5071d2dd6339",
        "name": "my-accessor-share",
        "resource_type": "share"
      },
      "account": {
        "id": "a0000000000000000000000000000001",
        "resource_type": "account"
      },
      "created_at": "2022-01-07T16:56:54Z",
      "crn": "crn:[...]",
      "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-f64efe74-a5a2-45c7-b37d-5071d2dd6339/bindings/r006-df760133-3513-47e7-b980-26cca666561b",
      "id": "r006-df760133-3513-47e7-b980-26cca666561b",
      "lifecycle_state": "stable",
      "name": "my-share-bind",
      "resource_type": "share_binding"
    }
  ],
  "first": {
    "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-65f30e48-3074-4eb0-9ec4-51ce2ec968eb/bindings?limit=20"
  },
  "limit": 50,
  "total_count": 1
}

使用 API 檢視檔案共用的特定連結

提出 GET /shares/{share_id}/bindings/{binding_id} 要求,以取得檔案共用之特定連結的資訊。 此請求檢索由URL中的識別碼指定的單一綁定。

curl -X GET "$vpc_api_endpoint/v1/shares/$share_id/bindings/$binding_id?version=2024-03-20&generation=2"\
-H "Authorization: Bearer $iam_token"

成功的回應如下例所示。

{
  "accessor": {
    "crn": "crn:[...]",
    "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-f64efe74-a5a2-45c7-b37d-5071d2dd6339",
    "id": "r006-f64efe74-a5a2-45c7-b37d-5071d2dd6339",
    "name": "my-accessor-share",
    "resource_type": "share"
  },
  "account": {
    "id": "a0000000000000000000000000000001",
    "resource_type": "account"
  },
  "created_at": "2022-01-07T16:56:54Z",
  "crn": "crn:[...]",
  "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/r006-f64efe74-a5a2-45c7-b37d-5071d2dd6339/bindings/r006-df760133-3513-47e7-b980-26cca666561b",
  "id": "r006-df760133-3513-47e7-b980-26cca666561b",
  "lifecycle_state": "stable",
  "name": "my-share-bind",
  "resource_type": "share_binding"
}

列出與 API 共用檔案的所有裝載目標

提出 GET /shares/{share_id}/mount_targets 要求,以列出檔案共用的所有裝載目標。

請參閱下列範例。

curl -X GET \
"$vpc_api_endpoint/v1/shares/$share_id/mount_targets?version=2023-07-18?limit=50&generation=2"\
-H "Authorization: Bearer $iam_token"

成功的回應如下例所示:

{
  "first": {
    "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/199d78ec-b971-4a5c-a904-8f37ae710c63/mount_targets?limit=50"
  },
  "limit": 50,
  "mount_targets": [
    {
      "access_control_mode": "security_group",
      "created_at": "2023-07-18T01:59:46.000Z",
      "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/199d78ec-b971-4a5c-a904-8f37ae710c63/mount_targets/r006-1b5571cb-536d-48d0-8452-81c05c6f7b80",
      "id": "r006-1b5571cb-536d-48d0-8452-81c05c6f7b80",
      "lifecycle_reasons": [],
      "lifecycle_state": "stable",
      "mount_path": "fsf-dal1099a-fz.adn.networklayer.com:/nxg_s_voll_mz0716_a4cc07a3_4425_4adf_aed6_0d7e142bee0c",
      "name": "my-target",
      "primary_ip": {
        "address": "192.0.2.0",
        "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/35984145-9c3a-4626-8ee7-52c7a8742752/reserved_ips/0716-6fd4925d-7774-4e87-829e-7e5765d454ad",
        "id": "0716-6fd4925d-7774-4e87-829e-7e5765d454ad",
        "name": "my-reserved-ip",
        "resource_type": "subnet_reserved_ip"
      },
      "resource_type": "share_mount_target",
      "security_groups": [
        {
          "crn": "crn:[...]",
          "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/r006-1dfeccef-3ad6-4760-8653-a202bc795db4",
          "id": "r006-1dfeccef-3ad6-4760-8653-a202bc795db4",
          "name": "my-security-group",
          "resource_type": "security_group"
        }
      ],
      "subnet": {
        "crn": "crn:[...]",
        "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/35984145-9c3a-4626-8ee7-52c7a8742752",
        "id": "35984145-9c3a-4626-8ee7-52c7a8742752",
        "name": "my-subnet",
        "resource_type": "subnet"
      },
      "transit_encryption": "none",
      "virtual_network_interface": {
        "crn": "crn:[...]",
        "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/388f01db-41bb-42aa-b5cd-34ba41288d47",
        "id": "388f01db-41bb-42aa-b5cd-34ba41288d47",
        "name": "my-virtual-network-interface",
        "resource_type": "virtual_network_interface"
      },
      "vpc": {
        "crn": "crn:[...]",
        "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4c0bb0df-5ca2-43ca-a3de-a4f86010a906",
        "id": "4c0bb0df-5ca2-43ca-a3de-a4f86010a906",
        "name": "my-vpc",
        "resource_type": "vpc"
      }
    }
  ],
  "total_count": 1
}

使用 API 檢視單一裝載目標

對檔案共用的單一裝載目標資訊提出 GET /shares/{share_id}/mount_targets/{mount_target_id} 要求。 此呼叫包括裝載路徑資訊。 使用裝載路徑將檔案共用連接至實例。

請參閱下列範例

curl -X GET \
"$vpc_api_endpoint/v1/shares/$share_id/mount_targets/$mount_target_id?version=2023-07-18&generation=2"\
-H "Authorization: Bearer $iam_token"

成功的回應如下例所示。 在此範例中,已啟用 傳輸中的資料加密

{
    "access_control_mode": "security_group",
    "created_at": "2023-07-18T01:59:46.000Z",
    "href": "https://us-south.iaas.cloud.ibm.com/v1/shares//199d78ec-b971-4a5c-a904-8f37ae710c63/mount_targets/d5fd8173-f519-4ff7-8f63-0ead23ecf1f4",
    "id": "d5fd8173-f519-4ff7-8f63-0ead23ecf1f4",
    "lifecycle_reasons": [],
    "lifecycle_state": "stable",
    "mount_path": "fsf-dal1099a-fz.adn.networklayer.com:/nxg_s_vol_xyz_2891fd0a_64ea_4deb_9ed5_1159e37cb5aa",
    "name": "my-mount-target2",
    "primary_ip": {
      "address": "192.0.2.0",
      "href": "https://us-south.iaas.cloud.ibm.com/subnets/c2338e66-dcb5-4e9b-b572-108d47ca479a/reserved_ips/b96d456e-88f7-42a7-b02d-450a6d758534",
      "id": "b96d456e-88f7-42a7-b02d-450a6d758534",
      "name": "my-reserved-ip",
      "resource_type": "subnet_reserved_ip"
    },
    "resource_type": "share_mount_target",
    "security_groups": [
      {
        "crn": "crn:[...]",
        "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/b79365be-f626-45d4-94ae-83f16fa4edd3",
        "id": "b79365be-f626-45d4-94ae-83f16fa4edd3",
        "name": "my-security-group",
        "resource_type": "security_group"
      }
    ],
    "subnet": {
      "crn": "crn:[...]",
      "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/c2338e66-dcb5-4e9b-b572-108d47ca479a",
      "id": "c2338e66-dcb5-4e9b-b572-108d47ca479a",
      "name": "my-subnet",
      "resource_type": "subnet"
    },
    "transit_encryption": "ipsec",
    "virtual_network_interface": {
      "crn": "crn:[...]",
      "href": "https://us-south.iaas.cloud.ibm.com/v1/virtual_network_interfaces/4551a68d-b45d-4443-b6b3-aba7a4a18c98",
      "id": "4551a68d-b45d-4443-b6b3-aba7a4a18c98",
      "name": "my-virtual-network-interface",
      "resource_type": "virtual_network_interface"
    },
    "vpc": {
      "crn": "crn:[...]",
      "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/5821d0c4-a089-4957-b5fa-03b7ac636c15",
      "id": "5821d0c4-a089-4957-b5fa-03b7ac636c15",
      "name": "my-vpc",
      "resource_type": "vpc"
    }
  }

使用 API 檢視抄本檔案共用的原始檔共用

提出 GET /shares/{replica_id}/source 要求並指定抄本共用 ID,以擷取來源檔案共用詳細資料。

curl -X GET \
"$vpc_api_endpoint/v1/shares/$replica_id/source?version=2023-07-18&generation=2"\
-H "Authorization: Bearer $iam_token"\

成功的回應提供來源檔案共用的詳細資料。 請注意,抄寫角色是 source

{
    "access_control_mode": "security_group",
    "created_at": "2023-07-18T22:58:49.000Z",
    "crn": "crn:[...]",
    "encryption": "none",
    "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/207721a9-aff9-4b16-9823-fe68096aeac3",
    "id": "207721a9-aff9-4b16-9823-fe68096aeac3",
    "iops": 14400,
    "lifecycle_state": "stable",
    "mount_targets": [
      {
        "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/207721a9-aff9-4b16-9823-fe68096aeac3/mount_targets/ce244454-0919-45e2-b14b-f4285afcd856",
        "id": "ce244454-0919-45e2-b14b-f4285afcd856",
        "name": "my-share-mount-target",
        "resource_type": "share_mount_target",
        "vpc": {
          "crn": "crn:[...]",
          "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/c8b8fa2d-ccf7-4f42-9d38-df6d123c867d",
          "id": "c8b8fa2d-ccf7-4f42-9d38-df6d123c867d",
          "name": "my-vpc",
          "resource_type": "vpc"
        }
      }
    ],
    "name": "my-share-3",
    "profile": {
      "family": "defined-performance",
      "href": "https://us-south.iaas.cloud.ibm.com/v1/share/profiles/dp2",
      "name": "dp2",
      "resource_type": "share_profile"
    },
    "replication_role": "source",
    "replication_status": "active",
    "replication_status_reasons": [],
    "resource_group": {
      "crn": "crn:[...]",
      "href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/678523bcbe2b4eada915d32640909956",
      "id": "678523bcbe2b4eada915d32640909956",
      "name": "Default"
    },
    "resource_type": "share",
    "size": 4800,
    "snapshot_count": 10,
    "snapshot_size": 10,
    "user_tags": [],
    "zone": {
      "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1",
      "name": "us-south-1",
      "resource_type": "zone"
    }
  }

使用 Terraform 檢視檔案共用及裝載目標

您可以使用 Terraform 來檢視檔案共用及裝載目標的相關資訊。

要使用 Terraform,請下載 Terraform CLI 並配置 IBM Cloud Provider 外掛程式。 如需相關資訊,請參閱 Terraform 入門

VPC 基礎架構服務使用特定的地區端點,依預設會以 us-south 為目標。 如果您的 VPC 建立在另一個地區中,請確保將 provider.tf 檔案中提供者區塊中的適當地區設為目標。

請參閱下列以非預設 us-south 地區為目標的範例。

provider "ibm" {
  region = "eu-de"
}

使用 Terraform 檢視所有檔案共用

將屬於帳戶的檔案共用清單匯入為唯讀資料來源。 您可以依共用名稱或資源群組 ID 來過濾。

data "ibm_is_shares" "example" {
}

匯出的屬性包括共用總數及共用清單。 巢狀屬性包括共用 ID、名稱、建立日期、大小、IOPS、CRN、存取標籤、加密類型及金鑰、生命週期狀態、抄寫角色及狀態、裝載目標及其他屬性。

如需相關資訊,請參閱 ibm_is_shares

使用 Terraform 檢視檔案共用資訊

將檔案共用的詳細資料匯入為唯讀資料來源。 您必須依 ID 或名稱來識別共用。

data "ibm_is_share" "example" {
  share = ibm_is_share.example.id
}
data "ibm_is_share" "example" {
  name = ibm_is_share.example.name
}

匯出的屬性包括 ID、名稱、建立日期、大小、IOPS、CRN、存取標籤、加密類型、加密金鑰、生命週期狀態、抄寫角色及狀態、裝載目標及其他屬性。

如需相關資訊,請參閱 ibm_is_share

檢視與 Terraform 的檔案共用相關聯的裝載目標

將與檔案共用相關聯的裝載目標清單匯入為唯讀資料來源。 依檔案共用的 ID 來識別檔案共用。

data "ibm_is_share_mount_targets" "example" {
  share = ibm_is_share.example.id
}

匯出的屬性包括掛載目標清單及其 ID、名稱、建立日期、掛載路徑以及子網資訊。

如需詳細資訊,請參閱 ibm_is_share_ mount _targets。

使用 Terraform 檢視裝載目標資訊

將裝載目標的詳細資料匯入為唯讀資料來源。 透過指定共用 ID 和裝載目標 ID 來識別裝載目標。 這兩個引數都是必要的。

data "ibm_is_share_mount_target" "example" {
  share        = ibm_is_share.example.id
  mount_target = ibm_is_share_mount_target.example.mount_target
}

匯出的屬性包括 ID、名稱、建立日期、裝載路徑、子網路資訊及其他屬性。

如需詳細資訊,請參閱 ibm_is_ share _mount_target。

下一步

裝載檔案共用。 掛載是伺服器作業系統使儲存裝置上的檔案和目錄可供使用者透過伺服器檔案系統存取的過程。 如需相關資訊,請參閱下列主題:

管理您的檔案共用及資料。

  • 管理檔案共用。 您可以重新命名檔案共用。 您可以增加其容量並修改其 IOPS。 您可以將裝載目標新增至檔案共用。 您可以重新命名或刪除裝載目標。 當您不再需要某個檔案共用時,即可將其刪除。
  • 建立與抄寫的檔案共用。 使用抄寫特性,您可以將檔案共用的唯讀副本保留在另一個區域中。 根據您指定的排程,從來源共用更新抄本共用。 當資料變成無法存取或應用程式失敗時,抄寫可讓您從主要站台上的發生事件回復。 抄寫也可以用於地理擴充。