IBM Cloud Docs
管理文件共享,存取器共享绑定和安装目标

管理文件共享,存取器共享绑定和安装目标

管理您创建的文件共享。 您可以重命名文件共享。 您可以增加其容量并修改其性能特征。 可以将安装目标添加到文件共享,并使用安装路径从虚拟服务器实例安装文件共享。 您可以重命名或删除安装目标。 或者,如果不再需要文件共享,那么可以将其删除。

File Storage for VPC 服务需要 IAM 许可权以进行基于角色的访问控制。 例如,要创建文件共享,您至少需要具有编辑者许可权。 有关详细信息,请参阅 为文件共享管理 VPC 基础架构服务的 IAM 访问

处理正常文件共享和存取器共享时的差异

以下部分包含用于修改和更新文件共享和安装目标的各种属性的指示信息。 由于存取器共享的性质,无法更改某些属性 (例如,文件共享概要文件,访问控制方式或允许的传输加密方式)。 这些属性继承自源共享。 对于可修改的存取器共享属性,这些步骤与更新正常共享的步骤相同。 虽然无法创建访问者共享的快照,但如果源共享有快照,则可以访问 .snapshot 目录中的快照。 该目录只读。

在控制台中管理文件共享、访问器共享绑定和挂载目标

在控制台中,您可以:

在控制台中,您可以管理正常文件共享和存取器共享。 只有共享所有者才能修改诸如访问控制方式,IOPS 和概要文件之类的属性。 存取器帐户无法编辑源共享,并且可以修改存取器共享的一组较小的属性。

只有将安全组作为访问控制模式的共享才支持快照。 除非删除共享的所有快照,否则无法将访问控制模式更改为 VPC。

在控制台中重命名文件共享

  1. 在“文件共享详细信息”页面上,单击文件共享名称旁边的 编辑图标 "编辑" 图标

  2. 为文件共享提供一个新名称。

有效的文件共享名称可包括小写字母数字字符(a-z,0-9)和连字符 (-) 的组合,最多 63 个字符。 文件共享名称必须以小写字母开头。

在控制台中重命名文件共享的挂载目标

  1. 转至 文件共享详细信息 页面。
  2. 单击“操作”图标 "操作" 图标
  3. 选择 重命名
  4. 输入新名称,然后单击“重命名”。

有效的挂载目标名称可包括小写字母数字字符(a-z,0-9)和连字符(-)的组合,最多 63 个字符。 安装目标名称必须以小写字母开头。

在控制台中更新文件共享配置文件

这些指示信息适用于上一代文件共享概要文件 (通用,5-iops,10-iops 或 custom)。 要访问当前功能,必须将共享的 IOPS 配置文件更改为 dp2。 使用 dp2 配置文件创建的文件共享的配置文件无法更改。

您可以将文件共享的概要文件从当前概要文件更改为另一个 IOPS 层 概要文件,更改为 定制 概要文件或更改为高性能 dp2 概要文件。 您的账单会根据您选择的配置文件进行调整。

  1. 转至 文件共享详细信息 页面。
  2. 单击当前概要文件旁边的 编辑图标 "编辑" 图标,或者使用 操作 菜单 "操作" 图标 并选择 编辑 IOPS 概要文件。 侧面板显示当前概要文件,文件共享大小和最大 IOPS。
  3. 对于 新建概要文件,单击向下箭头。 您可以选择新的 IOPS 层,定制概要文件或 dp2。 对于 定制 IOPSdp2,请根据文件共享大小指定新的最大 IOPS。 根据您的选择自动计算文件股价。
  4. 单击保存并继续

更新控制台中允许的传输加密模式

共享的所有者可以更改允许的传输加密模式。 但是,必须先删除所有绑定,然后才能更改此属性。 删除绑定将切断源文件共享和存取器共享之间的网络路径,并使连接到存取器共享的安装目标处于失败状态。 有关更多信息,请参阅 从其他帐户除去对文件共享的访问权

  1. 文件共享列表 中选择文件共享。
  2. 在“文件共享详细信息”页面上,找到允许的传输加密方式。
  3. 单击 编辑图标 "编辑" 图标 以更改当前值。

从 CLI 管理文件共享,存取器共享绑定和安装目标

通过使用 CLI,您可以:

只有将安全组作为访问控制模式的共享才支持快照。 除非删除共享的所有快照,否则无法将访问控制模式更改为 VPC。

从 CLI 重命名文件共享

  1. 通过使用 ibmcloud is shares 命令列出区域中的文件共享,找到要重命名的文件共享。 记下文件共享的名称和 ID。

    $ 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   
    r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03   my-file-share           stable            us-south-2   dp2        10         defaults         none               none                    0                0   
    r006-aaf4bfe9-358c-4faa-a4ec-0b955090b940   my-file-share-2         stable            us-south-2   dp2        10         defaults         none               none                    0                0   
    r006-a60bfa90-a893-40ad-be34-28ab51a963f9   replica-dal-2           stable            us-south-2   dp2        10         defaults         replica            none                    0                0   
    r006-3f21e3c3-e12d-425f-ab77-810cabfde8df   source-dal-1            stable            us-south-1   dp2        10         defaults         source             none                    0                0   
    r006-455b601c-8fc1-4476-8771-4708c49c8ef7   my-replica-share-dal-1  stable            us-south-1   dp2        10         defaults         replica            none                    0                0   
    r006-4dadac27-cd17-42df-a5fe-1388705d33e0   my-source-share-dal-2   stable            us-south-2   dp2        10         defaults         source             none                    0                0   
    r006-cc7ab6a0-bb71-4e03-8ef7-dcffca43717f   my-old-file-share       stable            us-south-1   tier-3iops 40         defaults         none               -                       -                -
    
  2. 运行 ibmcloud is share-update 命令并使用 --name 选项指定新的文件共享名称。

    ibmcloud is share-update r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03 --name my-renamed-share
    Updating file share r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03 under account Test Account as user test.user@ibm.com...
    
    ID                           r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03
    Name                         my-renamed-share
    CRN                          crn:v1:bluemix:public:is:us-south-2:a/a1234567::share:r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03
    Lifecycle state              stable
    Access control mode          vpc
    Zone                         us-south-2
    Profile                      dp2
    Size(GB)                     100
    IOPS                         100
    Encryption                   user_managed   
    Mount Targets                ID                          Name
                                 No mounted targets found.
    
    Resource group               ID                                 Name
                                 6edefe513d934fdd872e78ee6a8e73ef   defaults
    
    Created                      2023-08-01T17:02:01+00:00
    Encryption key               crn:v1:bluemix:public:kms:eu-de:a/a1234567:key:f602ae93-b915-49bc-a0e1-af29c73e7788
    Latest job                   Job status   Job status reasons
                                 -            -
    
    Replication cron spec        00 11 * * 0
    Replication role             replica
    Replication status           none
    Replication status reasons   Status code   Status message
                                 -             -
    
    Snapshot count               0
    Snapshot size                0   
    Source snapshot              -  
    

有效的文件共享名称可包括小写字母数字字符(a-z,0-9)和连字符 (-) 的组合,最多 63 个字符。 文件共享名称必须以小写字母开头。

有关命令选项的更多信息,请参阅 ibmcloud is share-update

从 CLI 重命名文件共享的安装目标

  1. 使用 ibmcloud is shares 命令列出区域中的文件共享。 记下具有要重命名的安装目标的文件共享的名称和标识。

  2. 通过 ibmcloud is share-mount-targets 命令使用共享的名称或标识来查找其安装目标。

    $ ibmcloud is share-mount-targets r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03
    Listing share mount target of r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03 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
    
  3. 要重命名安装目标,请运行带有文件共享名称或标识以及安装目标名称的 share-mount-target-update 命令。 使用 --name 选项指定新的安装目标名称。

    ibmcloud is share-mount-target-update r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03 r006-fdbffc45-618c-49f1-bb08-ec530d7be378 --name my-renamed-mount-target
    

有效的挂载目标名称可包括小写字母数字字符(a-z,0-9)和连字符(-)的组合,最多 63 个字符。 安装目标名称必须以小写字母开头。

有关命令选项的更多信息,请参阅 ibmcloud is share-mount-target-update

在 CLI 中更新文件共享概要文件

这些指示信息适用于上一代文件共享概要文件 (通用,5-iops,10-iops 或 custom)。 要访问当前功能,必须将共享的 IOPS 配置文件更改为 dp2。 使用 dp2 配置文件创建的文件共享的配置文件无法更改。

  1. 通过使用 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   
    r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03   my-file-share           stable            us-south-2   dp2        10         defaults         none               none                    0                0   
    r006-aaf4bfe9-358c-4faa-a4ec-0b955090b940   my-file-share-2         stable            us-south-2   dp2        10         defaults         none               none                    0                0   
    r006-a60bfa90-a893-40ad-be34-28ab51a963f9   replica-dal-2           stable            us-south-2   dp2        10         defaults         replica            none                    0                0   
    r006-3f21e3c3-e12d-425f-ab77-810cabfde8df   source-dal-1            stable            us-south-1   dp2        10         defaults         source             none                    0                0   
    r006-455b601c-8fc1-4476-8771-4708c49c8ef7   my-replica-share-dal-1  stable            us-south-1   dp2        10         defaults         replica            none                    0                0   
    r006-4dadac27-cd17-42df-a5fe-1388705d33e0   my-source-share-dal-2   stable            us-south-2   dp2        10         defaults         source             none                    0                0   
    r006-cc7ab6a0-bb71-4e03-8ef7-dcffca43717f   my-old-file-share       stable            us-south-1   tier-3iops 40         defaults         none               -                       -                -
    
  2. share-update 命令与 --profile 参数配合使用,以按名称指示新的文件共享概要文件。

    $ ibmcloud is share-update my-old-file-share --profile dp2 --size 1000 --iops 3000
    Updating file share my-file-share-8 under account Test Account as user test.user@ibm.com...
    
    ID                           r006-cc7ab6a0-bb71-4e03-8ef7-dcffca43717f
    Name                         my-old-file-share
    CRN                          crn:v1:bluemix:public:is:us-south-1:a/a1234567::share:r006-cc7ab6a0-bb71-4e03-8ef7-dcffca43717f
    Lifecycle state              updating
    Access control mode          vpc
    Zone                         us-south-1
    Profile                      dp2
    Size(GB)                     1000
    IOPS                         3000
    User Tags                    env:dev,env:prod
    Encryption                   provider_managed   
    Mount Targets                ID                                          Name
                                 r006-c9d82a15-7ead-4388-abc8-88e81c12ed28   my-target121
    
    Resource group               ID                                 Name
                                 6edefe513d934fdd872e78ee6a8e73ef   defaults
    
    Created                      2023-03-27T20:43:36+00:00
    Replication role             none
    Replication status           none
    Replication status reasons   Status code   Status message
                                 -             -
    
    Snapshot count               0
    Snapshot size                0   
    Source snapshot              -
    

有关命令选项的更多信息,请参阅 ibmcloud is share-update

通过 CLI 更新允许的传输加密模式

共享所有者可将允许的传输加密模式类型更改为“user_managed,noneuser_managed 或”none

但是,在更改此属性之前,必须删除所有绑定和挂载目标。 删除绑定将切断源文件共享和存取器共享之间的网络路径,并使连接到存取器共享的安装目标处于失败状态。 有关更多信息,请参阅 从其他账户删除对文件共享的访问权限

$ ibmcloud is share-update my-origin-share --allowed-transit-encryption-modes user_managed
Updating file share my-file-share under account Test Account as user test.user@ibm.com...

ID                               r006-b696742a-92ee-4f6a-bfd7-921d6ddf8fa6
Name                             my-origin-share
CRN                              crn:v1:bluemix:public:is:us-south-2:a/1234567::share:r006-b696742a-92ee-4f6a-bfd7-921d6ddf8fa6
Lifecycle state                  stable
Access control mode              security_group
Accessor binding role            origin
Allowed transit encryption modes user_managed
Origin share CRN                                                                                             Name            Remote account  Remote region
                                 crn:v1:bluemix:public:is:us-south-2:a/7654321::share:r006-d73v40a6-e08f-4d07-99e1-d28cbf2188ed  my-origin-share a7654321        -
Zone                             us-south-2
Profile                          dp2
Size(GB)                         1000
IOPS                             1000
Encryption                       provider_managed
Mount Targets                    ID                          Name
                                 No mounted targets found.

Resource group                   ID                                 Name
                                 db8e8d865a83e0aae03f25a492c5b39e   Default

Created                          2024-06-25T22:15:15+00:00
Replication role                 none
Replication status               none
Replication status reasons       Status code   Status message
                                 -             -

使用 API 管理文件共享,存取器共享绑定和安装目标

通过使用 API,您可以:

要查看有关 File Storage for VPC API 方法的信息,请参阅 API 参考 中的以下部分。

只有将安全组作为访问控制模式的共享才支持快照。 除非删除共享的所有快照,否则无法将访问控制模式更改为 VPC。

使用 API 重命名文件共享

发出 PATCH /shares/$share_id 调用以重命名特定文件共享。 请参阅以下示例。

curl -X PATCH \
"$vpc_api_endpoint/v1/shares/$share_id?version=2023-08-08&generation=2"\
  -H "Authorization: Bearer ${API_TOKEN}"\
  -d '{"name": "share-renamed1"}'

成功回复的示例如下

{
  "access_control_mode": "vpc",
  "created_at": "2023-07-17T23:31:59Z",
  "crn": "crn:[...]",
  "encryption": "provider_managed",
  "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0995b8c6-c323-4e59-9ea9-fa14dd66bba8",
  "id": "0995b8c6-c323-4e59-9ea9-fa14dd66bba8",
  "iops": 3000,
  "lifecycle_state": "stable",
  "name": "share-renamed1",
  "profile": {
    "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/bfb4a7c7-00d8-400b-98ba-5a67e5851970",
    "id": "bfb4a7c7-00d8-400b-98ba-5a67e5851970",
    "name": "Default"
  },
  "resource_type": "share",
  "size": 100,
  "mount_targets": [],
  "zone": {
    "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1",
    "name": "us-south-1"
  }
}

有效的文件共享名称可包括小写字母数字字符(a-z,0-9)和连字符 (-) 的组合,最多 63 个字符。 文件共享名称必须以小写字母开头。

使用 API 重命名文件共享的安装目标

发出 PATCH /shares/$share_id/mount_targets/$target_id 调用以重命名文件共享的安装目标。 请参阅以下示例。

curl -X PATCH \
"$vpc_api_endpoint/v1/shares/$share_id/mount_targets/$target_id?version=2023-08-08&generation=2"\
  -H "Authorization: Bearer ${API_TOKEN}" \
  -d '{"name": "target-renamed1"}

成功回复的示例如下

{
  "access_control_mode": "vpc",
  "created_at": "2023-07-18T23:31:59Z",
  "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0995b8c6-c323-4e59-9ea9-fa14dd66bba8/mount_targets/9fdf4438-f5b4-4b6f-8bca-602494fd6c31",
  "id": "9fdf4438-f5b4-4b6f-8bca-602494fd6c31",
  "lifecycle_state": "stable",
  "mount_path": "domain.com:/vol_xyz_2891fd0a_64ea_4deb_9ed5_1159e37cb5aa",
  "name": "target-renamed1",
  "resource_type": "share_target",
  "transit_encryption": "none",
  "vpc": {
    "crn": "crn:[...]",
    "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs8c95b3c1-fe3c-45c-97a6-e43d14088287",
    "id": "82a7b841-9586-43b4-85dc-c0ab5e8b1c7a",
    "name": "vpc-name1",
    "resource_type": "vpc"
  }
}

有效的挂载目标名称可包括小写字母数字字符(a-z,0-9)和连字符(-)的组合,最多 63 个字符。 安装目标名称必须以小写字母开头。

使用 API 更新文件共享概要文件

这些指示信息适用于上一代文件共享概要文件 (通用,5-iops,10-iops 或 custom)。 要访问当前功能,必须将共享的 IOPS 配置文件更改为 dp2。 使用 dp2 配置文件创建的文件共享的配置文件无法更改。

发出 PATCH /shares/{share_ID} 调用并在 profile 属性中指定概要文件名称。 以下示例将概要文件更改为 dp2 概要文件。

curl -X PATCH "$vpc_api_endpoint/v1/shares/432f1a4d-4aac-4ba1-922c-76fdbcbeb1e3?version=2023-08-08&generation=2"\
-H "Authorization: $iam_token"\
-d '{"profile": {"name": "dp2"}}'

使用 API 更新允许的传输加密方式

共享所有者可将允许的传输加密模式类型更改为“user_managed,noneuser_managed 或”none

不过,在更改该属性之前,必须先删除所有绑定和挂载目标。 删除绑定将切断源文件共享和存取器共享之间的网络路径,并使连接到存取器共享的安装目标处于失败状态。 有关更多信息,请参阅 从其他帐户除去对文件共享的访问权

curl -X PATCH \
"$vpc_api_endpoint/v1/shares/$share_id?version=2023-08-08&generation=2"\
  -H "Authorization: Bearer ${API_TOKEN}"
  -d '{"allowed_transit_encryption_modes": "user-managed"}'

使用 Terraform 管理文件共享,存取器共享绑定和安装目标

通过 Terraform,您可以:

使用 Terraform 更新文件共享的属性

更新 ibm_is_share 资源以更改文件共享的任何属性,例如名称,大小,概要文件和标记。 应用时,以下示例会将共享的名称更新为 new_name

resource "ibm_is_share" "example" {
  name    = "new_name"
  size    = 300
  iops    = 5000
  profile = "dp2"
  zone    = "us-south-2"
}

有效的文件共享和安装目标名称可以包含小写字母数字字符 (a-z,0-9) 和连字符 (-) 的组合,最多 63 个字符。 文件共享名称必须以小写字母开头。

对于存取器共享,某些属性 (例如,概要文件,安装目标访问方式,允许的传输加密方式和静态加密) 不可编辑。

共享所有者可将允许的传输加密模式类型更改为“user_managed,noneuser_managed 或”none

但是,在更改此属性之前,必须删除所有绑定和挂载目标。 删除绑定将切断源文件共享和存取器共享之间的网络路径,并使连接到存取器共享的安装目标处于失败状态。 有关更多信息,请参阅 从其他账户删除对文件共享的访问权限

有关自变量和属性的更多信息,请参阅 ibm_is_share

使用 Terraform 更新安装目标的属性

更新 is_share_target 资源以更改安装目标的名称。 应用后,以下资源会将安装目标的名称更改为 my-new-share-target

resource "is_share_target" "is_share_target" {
  share = is_share.is_share.id
  subnet = ibm_is_subnet.example.id
  name = "my-new-share-target"
}`

有关自变量和属性的更多信息,请参阅 ibm_is_share_target

向文件共享添加用户标记

您可以使用 UI,CLI,API 和 Terraform 向新的或现有文件共享添加用户标记,修改和删除文件共享的标记。 您可以通过按资源列表中的标记进行过滤来查看整个帐户中的标记。 您还可以向副本文件共享添加用户标记。

在同一操作中最多可以附加或拆离 100 个标记。 编辑标记时,新标记将覆盖现有标记。 要使标记可管理,请仅创建有效处理资源所需的用户标记数。

您可以使用 全局标记 API 在 IBM Cloud 中管理标记。 通过此 API,您可以创建,删除,搜索,附加或拆离标记。 有关管理帐户的标记的更多信息,请参阅 使用标记

在控制台中为文件共享添加用户标签

您可以在控制台中为文件共享添加用户标记。

  1. 转至文件共享列表。 在 IBM Cloud 控制台中,单击导航菜单图标菜单图标 > 基础架构 VPC 图标 > 存储 > 文件存储共享
  2. 选择文件共享以查看其详细信息。
  3. 在文件共享详细信息页面上,用户标记显示在文件共享名称旁边。 单击 编辑图标 "编辑" 图标 以编辑标记。
  4. 在“编辑标记”窗口中,在“用户标记”文本框中输入标记。
  5. 单击保存

从 CLI 添加或修改文件共享用户标记

在使用 CLI 之前,您必须安装 IBM Cloud CLI 和 VPC CLI 插件。 有关更多信息,请参阅 CLI 先决条件

使用 ibmcloud is share-create 命令供应文件共享时,可以添加标记。 --user-tags 选项指定文件共享的标记。 有关更多信息,请参阅 从 CLI 创建与安装目标的文件共享

使用 ibmcloud is share-update 命令更新文件共享时,可以添加和除去标记。

  1. 通过使用 ibmcloud is shares 命令列出区域中的文件共享,在 CLI 中找到您的共享。

    $ 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   
    r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03   my-file-share           stable            us-south-2   dp2       10         defaults         none               none                    0                0   
    r006-aaf4bfe9-358c-4faa-a4ec-0b955090b940   my-file-share-2         stable            us-south-2   dp2       10         defaults         none               none                    0                0   
    r006-a60bfa90-a893-40ad-be34-28ab51a963f9   replica-dal-2           stable            us-south-2   dp2       10         defaults         replica            none                    0                0   
    r006-3f21e3c3-e12d-425f-ab77-810cabfde8df   source-dal-1            stable            us-south-1   dp2       10         defaults         source             none                    0                0   
    r006-455b601c-8fc1-4476-8771-4708c49c8ef7   my-replica-share-dal-1  stable            us-south-1   dp2       10         defaults         replica            none                    0                0   
    r006-4dadac27-cd17-42df-a5fe-1388705d33e0   my-source-share-dal-2   stable            us-south-2   dp2       10         defaults         source             none                    0                0   
    
  2. 使用 ibmcloud is share 命令检索文件共享的详细信息。

    $ ibmcloud is share my-file-share
    Getting file share my-file-share under account Test Account as user test.user@ibm.com...
    
    ID                           r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03
    Name                         my-file-share
    CRN                          crn:v1:bluemix:public:is:us-south-2:a/a1234567::share:r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03
    Lifecycle state              stable
    Access control mode          security_group
    Accessor binding role        none
    Zone                         us-south-2
    Profile                      dp2
    Size(GB)                     1000
    IOPS                         1000
    Encryption                   provider_managed   
    Mount Targets                ID                                          Name
                                 r006-dd497561-c7c9-4dfb-af0a-c84eeee78b61   my-cli-share-mount-target
    
    Resource group               ID                                 Name
                                 db8e8d865a83e0aae03f25a492c5b39e   Default
    
    Created                      2023-10-18T22: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              -   
    
  3. 使用带有 --user-tags 选项的 ibmcloud is share-update 命令将标记添加到文件共享。 如果文件共享先前具有标记,那么这些标记将被命令中指定的标记覆盖。

下面的示例为文件共享添加了两个用户标记。

ibmcloud is share-update my-file-share --user-tags daily-backup-plan,docs:test
Updating file share my-file-share under account Test Account as user test.user@ibm.com...

ID                           r006-b696742a-92ee-4f6a-bfd7-921d6ddf8fa6
Name                         my-file-share
CRN                          crn:v1:bluemix:public:is:us-south-2:a/a1234567::share:r006-b696742a-92ee-4f6a-bfd7-921d6ddf8fa6
Lifecycle state              stable
Access control mode          security_group
Accessor binding role        none
Zone                         us-south-2
Profile                      dp2
Size(GB)                     1500
IOPS                         2000
User Tags                    daily-backup-plan,docs:test
Encryption                   provider_managed
Mount Targets                ID                                          Name
                             r006-dd497561-c7c9-4dfb-af0a-c84eeee78b61   my-cli-share-mount-target-1

Resource group               ID                                 Name
                             db8e8d865a83e0aae03f25a492c5b39e   Default

Created                      2023-10-18T22: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              -  

使用 API 添加或修改文件共享用户标签

使用 API 时,必须提供 generation 参数并指定 generation=2。 有关详细信息,请参阅 虚拟私有云 API 参考资料 中的生成

创建文件共享时添加用户标记

发出 POST /shares 请求并指定 user_tags 属性。 此示例创建具有三个用户标记 env:test1env:test2env:prod 的共享。

curl -X POST \
"$vpc_api_endpoint/v1/shares?version=2023-08-08&generation=2"\
    -H "Authorization: Bearer $iam_token"\
    -H 'Content-Type: application/json'\
    -d '{
        "name": "share-name1",
        "size": 2300,
        "iops": 6000,
        "profile": {"name": "dp2"},
        "user_tags": [
           "env:test1",
           "env:test2",
           "env:prod"
        ],
        "zone": {"name": "us-south-1"}
      }'

修改现有文件共享的用户标记

通过发出 PATCH /shares 请求并在 user_tags 属性中指定用户标记,将新的用户标记添加到现有文件共享。 如果文件共享没有任何标记,那么将添加请求中的新标记。 如果文件共享先前有标记,那么新标记将覆盖先前的标记。

下面的示例修改了一个用 ID 标识的文件共享。 重新命名共享并添加用户标签。

curl -X PATCH\
"$vpc_api_endpoint/v1/shares/432f1a4d-4aac-4ba1-922c-76fdbcbeb1e3?version=2023-08-08&generation=2"\
-H "Authorization: $iam_token" \
-d '{
    "name": "myshare-patch-1",
    "user_tags": [
      "ut8",
      "ut9"
    ],
  }'

成功回复的示例如下

{
    "access_control_mode": "vpc",
    "created_at": "2023-01-28T22:31:50Z",
    "crn": "crn:[...]",
    "encryption": "provider_managed",
    "href": "https://us-south-1.cloud.ibm.com/v1/shares/432f1a4d-4aac-4ba1-922c-76fdbcbeb1e3",
    "id": "432f1a4d-4aac-4ba1-922c-76fdbcbeb1e3",
    "initial_owner": {
      "gid": 0,
      "uid": 0
    },
    "iops": 3000,
    "lifecycle_state": "stable",
    "name": "myshare-patch-1",
    "profile": {
      "href": "https://us-south-1.cloud.ibm.com/v1/share/profiles/tier-3iops",
      "name": "tier-3iops",
      "resource_type": "share_profile"
    },
    "replication_role": "none",
    "replication_status": "none",
    "replication_status_reasons": [],
    "resource_group": {
      "crn": "crn": "crn:[...]",
      "href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/86ccf0a1315646d4bc719fe34ff4d1e3",
      "id": "86ccf0a1315646d4bc719fe34ff4d1e3",
      "name": "Default"
    },
    "resource_type": "share",
    "size": 100,
    "mount_targets": [],
    "user_tags": [
      "ut8",
      "ut9"
    ],
    "zone": {
      "href": "https://us-south-1.cloud.ibm.com/v1/regions/us-south/zones/us-south-1",
      "name": "us-south-1"
    }
  }

通过 ETag 验证修改文件共享用户标记

要确保对文件共享的更新有效,您可以获取 ETag 散列字符串值,并在 PATCH /shares/{share_id} 调用的 If-Match 头中指定该值。 这将确认上次观察到的状态与 PATCH 调用时的状态之间的共享对象未发生任何更改。

要修改添加到文件共享的现有用户标记,请首先进行 GET /shares/{share_id} 调用,并从响应头中的 ETag 属性复制散列值。 然后,通过在 PATCH /shares/{share_id} 请求中使用 If-Match 头来发送 ETag 值。 指定 Etag 值可确保在 If-Match 值与文件共享的当前 Etag 不匹配时,文件共享的任何更新或删除都将失败。 执行以下步骤:

  1. 发送 GET /shares/{share_id} 请求,并将 ETag 属性中的哈希字符串复制到响应标头中。 在 PATCH /shares/{share_id} 请求中指定 If-Match 时使用哈希字符串值,以便在步骤 2 中修改共享的用户标记。

    curl -sSL -D GET\ "https://us-south.cloud.ibm.com/v1/shares/{share_id}?version=2023-08-08&generation=2"\
    -H "Authorization: Bearer $TOKEN" -o /dev/null
    

    响应标头与下面的示例相似:

    HTTP/2 200
    date: Mon, 09 January 2023 17:48:03 GMT
    content-type: application/json; charset=utf-8
    content-length: 1049
    cf-ray: 69903d250c4966ef-DFW
    cache-control: max-age=0, no-cache, no-store, must-revalidate
    expires: -1
    strict-transport-security: max-age=31536000; includeSubDomains
    cf-cache-status: DYNAMIC
    expect-ct: max-age=604800, report-uri="[uri...]"
    pragma: no-cache
    x-content-type-options: nosniff
    x-request-id: 1fbe2384-6828-4503-ae7d-050426d1b11b
    x-xss-protection: 1; mode=block
    server: cloudflare
    etag: W/xxxyyyzzz123
    
  2. 发出 PATCH /shares/{share_id} 请求。 在头中指定 If-Match 属性的 ETag 散列字符串。 在 user_tags 属性中指定用户标记。

    此示例将文件共享用户标记更新为 env:testenv:prod。 您从 ETag 属性 (W/xxxyyyzzz123) 获取的散列字符串值在调用中的 If-Match 头中指定。

    curl -X PATCH\
    "$vpc_api_endpoint/v1/shares/50fda9c3-eecd-4152-b473-a98018ccfb10?version=2023-08-08&generation=2"\
       -H "Authorization: Bearer"\
       -H "If-Match: W/xxxyyyzzz123"\
       -d `{
          "user_tags": [
             "env:test2",
             "env:prod2"
          ]
       }'
    

使用 Terraform 添加或修改文件共享用户标签

要对文件共享应用用户标记,请使用“ibm_is_share 资源在”main.tf 文件中创建一个参数。 下面的示例指定了共享“my-new-share 和附加到共享的标记”dev:test。 应用时,标签会添加到共享中。

resource "ibm_is_share" "example" {
  name    = "my-new-share"
  size    = 200
  iops    = 5000
  profile = "dp2"
  zone    = "us-south-2"
  tags    = ["dev:test"]
}

向文件共享添加访问管理标记

访问管理标记是可以添加到文件共享以帮助组织访问控制资源关系的元数据。 首先创建标记,然后将其添加到现有文件共享或创建文件共享时。 您可以将同一访问管理标记应用于多个文件共享。 您可以在 Cloud Identity and Access Management (IAM) 中分配对该标记的访问权。 (可选) 您可以创建 IAM 访问组并管理用户。

步骤 1 - 在控制台的 IAM 中创建访问管理标签

在控制台中:

  1. 转到“管理”>“账户”,然后选择“标签”。
  2. 单击 访问管理标记 选项卡。 在字段中添加标记名称。 访问管理标记需要 key:value 格式。
  3. 单击 创建标记

步骤 1 - 从 CLI 创建 IAM 访问管理标签

在命令行中输入 "ibmcloud resource tag-create 命令,在账户中创建一个访问管理标签。 下面的示例创建了一个名为 "project:myproject 的标记:

```sh {: codeblock}
ibmcloud resource tag-create --tag-names project:myproject
```

更多信息,请参阅 "ibmcloud resource 命令参考

第 1 步 - 使用应用程序接口创建 IAM 访问管理标签

使用 全局搜索和标记 API,提出 "POST/ tags 请求,创建访问管理标记。 在 "tag_names 属性中指定标签。 有关示例,请参阅 使用 API 创建访问管理标记

步骤 1 - 使用 Terraform 创建 IAM 访问管理标签

在 "main.tf 文件中创建一个参数。 下面的示例创建了访问管理标记 "ibm_tag,并将其添加到资源 ID "ibm_is_share.example.crn 的 "ibm 资源中。

resource "ibm_resource" "ibm" {
resource_id = ibm_is_share.example.crn
tags        = [ "ibm_tag" ]
}

步骤 2-向文件共享添加访问权管理标记

向现有文件共享添加访问权管理标记,或者在 创建文件共享 时添加访问权管理标记。 对于现有文件共享:

  1. IBM Cloud 控制台中,转至“资源”列表,然后选择 存储器 资源下的文件共享。
  2. 访问管理标记 字段中,输入先前创建的访问管理标记的名称。 该标记将在您输入时显示。
  3. 保存更改。

步骤 3-创建访问组并将访问权分配给用户

创建访问权管理标记并将其应用于文件共享后,请完成以下步骤以分配访问权并添加用户:

  1. 创建访问组。 访问组分配给授予该组成员角色和权限的策略。 分配对文件服务的特定访问权管理标记的访问权。 有关访问组的更多信息,请参阅 设置访问组
  2. 将访问策略分配给组
  3. 将用户添加到访问组

查看 VPC 基础结构的特定资源并指定 File Storage for VPC 作为资源类型时,可以看到文件服务的访问管理标记。

从其他帐户除去对文件共享的访问权

撤销对文件共享的访问权是一个 2 步骤的过程。

  1. 除去帐户之间的 IAM 授权。 除去 IAM 授权会阻止其他帐户或服务创建存取器共享和安装目标。

  2. 删除将源共享与存取器共享连接的共享绑定。 此操作会导致其他帐户的安装目标进入 failed 状态。

在虚拟服务器实例上安装和卸装文件共享

安装是一个过程,服务器的操作系统通过该过程使存储设备上的文件和目录可供用户通过服务器的文件系统进行访问。 要将文件共享安装到虚拟服务器实例,请 找到安装路径信息。 安装路径是在您为文件共享创建安装目标时创建的。 请参阅以下信息以在几个 Linux 操作系统上进行安装。 其他 Linux 发行版遵循类似的过程。

监控文件共享

您可以使用控制台、CLI 或 API 检查文件共享的状态和健康状态。 您可以在 IBM Cloud 控制台中随时监控共享的总吞吐量、总 IOPS、挂载目标数量和容量使用情况。 您可以使用 IBM Cloud® Activity Tracker Event Routing 配置如何路由文件共享的审计事件。 您还可以配置 IBM Cloud Logs Routing 来处理日志。 有关详细信息,请参阅 监控文件共享运行状态、生命周期状态和事件

文件共享可与 IBM Cloud® Monitoring 集成,以获得共享性能和健康状况的运行可见性。 在 Sysdig Web UI 中,您可以更详细地查看吞吐量、IOPS 和容量指标,自定义仪表盘,并设置警报。 有关详细信息,请参阅 Monitoring metrics for File Storage for VPC

删除文件共享、访问器共享绑定和挂载目标

删除文件共享前,请确保已从所有虚拟服务器实例中 卸载 该共享,并删除属于该文件共享的所有挂载目标。 如果您的文件共享与其他帐户共享,请先删除存取器绑定,然后再删除该共享。 此外,如果文件共享具有副本文件共享,那么必须除去复制关系。 有关更多信息,请参阅 在控制台中移除复制关系从 CLI 移除复制关系使用 API 移除复制关系使用 Terraform 移除复制关系

在控制台中删除文件共享、访问器共享绑定和挂载目标

以下说明可帮助您确保在尝试删除不再需要的文件共享之前删除共享绑定和挂载目标。

如果文件共享有快照,这些快照将与文件共享一起删除。

在控制台中删除文件共享的共享绑定

  1. 文件共享列表 中选择文件共享。
  2. 在“文件共享详细信息”页面上,滚动到“存取器共享绑定”部分以找到要删除的绑定。
  3. 在绑定行的末尾,单击 操作 图标 "操作" 图标,然后选择 删除

在控制台中删除文件共享的挂载目标

  1. 文件共享列表 中选择文件共享。
  2. 在“文件共享详细信息”页面上,选择要删除的安装目标。
  3. 单击“操作”图标 "操作" 图标,然后选择 删除

在控制台中删除文件共享

文件共享必须处于 stable 状态或 failed 状态。

  1. 文件共享列表 中选择文件共享。
  2. 单击行末尾的 操作 图标 "操作" 图标,然后选择 删除

从 CLI 删除文件共享,存取器共享绑定和安装目标

以下说明可帮助您确保在尝试删除不再需要的文件共享之前删除共享绑定和挂载目标。

  1. 通过使用 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   
    r006-a8d6af48-0c97-4c6b-bab1-fbefdc1e1e03   my-file-share           stable            us-south-2   dp2        10         defaults         none               none                    0                0   
    r006-aaf4bfe9-358c-4faa-a4ec-0b955090b940   my-file-share-2         stable            us-south-2   dp2        10         defaults         none               none                    0                0   
    r006-a60bfa90-a893-40ad-be34-28ab51a963f9   replica-dal-2           stable            us-south-2   dp2        10         defaults         replica            none                    0                0   
    r006-3f21e3c3-e12d-425f-ab77-810cabfde8df   source-dal-1            stable            us-south-1   dp2        10         defaults         source             none                    0                0   
    r006-455b601c-8fc1-4476-8771-4708c49c8ef7   my-replica-share-dal-1  stable            us-south-1   dp2        10         defaults         replica            none                    0                0   
    r006-4dadac27-cd17-42df-a5fe-1388705d33e0   my-source-share-dal-2   stable            us-south-2   dp2        10         defaults         source             none                    0                0   
    r006-cc7ab6a0-bb71-4e03-8ef7-dcffca43717f   my-old-file-share       stable            us-south-1    dp2        40         defaults         none               -                       -                -
    
  2. 使用 ibmcloud is share 命令检索文件共享详细信息以查看附加的安装目标和复制信息。

    $ ibmcloud is share my-file-share-2
    Getting file share my-file-share-2 under account Test Account as user test.user@ibm.com...
    
    ID                           r006-aaf4bfe9-358c-4faa-a4ec-0b955090b940
    Name                         my-file-share-2
    CRN                          crn:v1:bluemix:public:is:us-south-1:a/a1234567::share:r006-aaf4bfe9-358c-4faa-a4ec-0b955090b940
    Lifecycle state              stable
    Access control mode          vpc
    Zone                         us-south-1
    Profile                      dp2
    Size(GB)                     40
    IOPS                         2000
    User Tags                    env:dev,env:prod
    Encryption                   provider_managed   
    Mount Targets                ID                                          Name
                                 r006-36d67ada-ca83-44be-adad-dc58e7c38dc5   my-new-mount-target
    
    Resource group               ID                                 Name
                                 db8e8d865a83e0aae03f25a492c5b39e   Default
    
    Created                      2023-10-18T23:52:45+00:00
    Replication role             none
    Replication status           none
    Replication status reasons   Status code   Status message
                                 -             -
    
    Snapshot count               0
    Snapshot size                0   
    Source snapshot              -
    

从 CLI 删除文件共享的共享绑定

运行 share-binding-delete 命令,并按其名称或标识指定源文件共享和绑定。 提示时输入 y。 如果将多个绑定附加到文件共享,请重复此步骤,直到删除所有绑定为止。 请参阅以下示例。

$ ibmcloud is share-bindings-delete my-origin-share r-006-c2e53b1b-3b15-4792-8d96-c9c035fd65c3
This will delete accessor binding r-006-c2e53b1b-3b15-4792-8d96-c9c035fd65c3 for share ID my-origin-share and cannot be undone. Continue [y/N] ?> y
Deleting binding r-006-c2e53b1b-3b15-4792-8d96-c9c035fd65c3 for share ID my-origin-share under account Test Account as user test.user@ibm.com...
OK
Binding r-006-c2e53b1b-3b15-4792-8d96-c9c035fd65c3 is deleted.

从 CLI 删除文件共享的安装目标

运行 share-mount-target-delete 命令并按其名称或标识指定文件共享和安装目标。 提示时输入 y。 如果将多个安装目标附加到文件共享,请重复此步骤,直到删除所有安装目标为止。

$ ibmcloud is share-mount-target-delete my-file-share-2 my-new-mount-target
This will delete mounted target my-new-mount-target for share ID my-file-share-2 and cannot be undone. Continue [y/N] ?> y
Deleting mounted target my-new-mount-target for share ID my-file-share-2 under account Test Account as user test.user@ibm.com...
OK
Share mount target my-new-mount-target is deleted.

有关命令选项的更多信息,请参阅 ibmcloud is share-mount-target-delete

从 CLI 删除文件共享

文件共享必须处于 stablefailed 状态。 要删除文件共享,请运行 share_delete 命令并按其名称或标识指定文件共享。

$ ibmcloud is share-delete my-file-share-2
This will delete file share my-file-share-2 and cannot be undone. Continue [y/N] ?> y
Deleting file share my-file-share-2 under account Test Account as user test.user@ibm.com...
OK
File share my-file-share-2 is deleted.

有关命令选项的更多信息,请参阅 ibmcloud is share-delete

如果文件共享有快照,这些快照将与文件共享一起删除。

使用 API 删除文件共享,存取器共享绑定和安装目标

以下说明可帮助您确保在尝试删除不再需要的文件共享之前删除共享绑定和挂载目标。

使用 API 删除文件共享的共享绑定

您可以通过在 VPC API 中调用 /shares 方法来以编程方式删除共享绑定,如以下样本请求中所示。

curl -X DELETE "$vpc_api_endpoint/v1/shares/v1/shares/$share_id/bindings/$binding_id?version=2024-06-21&generation=2"

使用 API 删除文件共享的安装目标

发出 DELETE /shares/{share_ID}/mount_targets/{target_id} 调用以删除文件共享的安装目标。 文件共享必须处于 stable 状态。 如果现有安装目标与该文件共享相关联,或者如果正在执行副本操作,那么无法删除文件共享。

请参阅以下示例。

curl -X DELETE \
"$vpc_api_endpoint/v1/shares/$share_id/mount_targets/$target_id?version=2023-08-08&generation=2"\
  -H "Authorization: Bearer ${API_TOKEN}"

成功响应具有确认接受删除以及包含目标信息的响应。

下面的示例显示了一个挂载目标,其中“access_control_mode 为”security_group。 响应显示安全组和子网。 您可以在 "primary_ip 部分看到挂载目标的虚拟网络接口所使用的保留 IP 地址的具体信息。 缺省情况下,删除安装目标时,会将虚拟网络接口与安装目标一起删除。 挂载目标的状态显示正在删除,而删除正在进行中。

{
  "access_control_mode": "security_group",
  "created_at": "2022-08-08T01:59:46.000Z",
  "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0995b8c6-c323-4e59-9ea9-fa14dd66bba8/mount_targets/9fdf4438-f5b4-4b6f-8bca-602494fd6c31",
  "id": "9fdf4438-f5b4-4b6f-8bca-602494fd6c31",
  "lifecycle_reasons": [],
  "lifecycle_state": "deleting",
  "mount_path": "domain.com:/vol_xyz_2891fd0a_63aa_4deb_9ed5_1159e37cb5aa",
  "name": "target-name1",
  "primary_ip": {
    "address": "10.10.12.64",
    "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5/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/2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5",
    "id": "2302-ea5fe79f-52c3-4f05-86ae-9540a10489f5",
    "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/4727d842-f94f-4a2d-824a-9bc9b02c523b",
    "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b",
    "name": "my-virtual-network-interface",
    "resource_type": "virtual_network_interface"
  },
  "vpc": {
  "crn": "crn:[...]",
  "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8c95b3c1-fe3c-45c-97a6-e43d14088287",
  "id": "82a7b841-9586-43b4-85dc-c0ab5e8b1c7a",
  "name": "vpc-name1",
  "resource_type": "vpc"
  }
}

将在后台删除安装目标。 通过尝试查看安装目标信息来确认删除。 如果收到 404 Not Found 错误,那么已成功删除安装目标。

在 API 中删除文件共享

文件共享必须处于 stablefailed 状态。

发出 DELETE /shares/$share_id 调用以删除文件共享。 文件共享必须处于 stable 状态或 failed 状态 (即,供应失败时)。 如果现有安装目标与该文件共享相关联,或者如果正在执行副本操作,那么无法删除文件共享。

请参阅以下示例。

curl -X DELETE \
"$vpc_api_endpoint/v1/shares/$share_id?version=2023-08-08&generation=2"\
  -H "Authorization: Bearer ${API_TOKEN}"

成功的响应确认接受删除并显示文件共享信息。 文件共享的状态将更新为 pending_删除。 请参阅以下示例:

{
  "access_control_mode": "vpc",
  "created_at": "2022-08-08T23:31:59Z",
  "crn": "crn:[...]",
  "encryption": "provider_managed",
  "href": "https://us-south.iaas.cloud.ibm.com/v1/shares/0995b8c6-c323-4e59-9ea9-fa14dd66bba8",
  "id": "0995b8c6-c323-4e59-9ea9-fa14dd66bba8",
  "iops": 3000,
  "lifecycle_state": "pending_deletion",
  "name": "share-name1",
  "profile": {
    "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/bfb4a7c7-00d8-400b-98ba-5a67e5851970",
    "id": "bfb4a7c7-00d8-400b-98ba-5a67e5851970",
    "name": "Default"
  },
  "resource_type": "share",
  "size": 100,
  "snapshot_count": 10,
  "snapshot_size": 10,
  "user_tags": [],
  "mount_targets": [],
  "zone": {
    "href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1",
    "name": "us-south-1"
  }
}

在后台删除文件共享。 通过尝试查看安装目标信息来确认删除。 如果收到 404 Not Found 错误,那么将成功删除安装目标。 如果文件共享有快照,这些快照将与文件共享一起删除。

DELETE /shares/$share_id 调用可以选择包含用于指定 ETag 散列字符串的 If-Match 头。 发出 GET /shares/{share_id} 调用并从响应头复制 ETag 散列字符串。 有关更多信息,请参阅 文件共享的用户标记

使用 Terraform 删除文件共享,存取器共享绑定或安装目标

使用 terraform destroy 命令可以方便地删除远程对象,例如文件共享。 以下示例显示了用于删除共享的语法。 将共享的实际标识替换为 ibm_is_share.example.id。 要删除挂载目标或共享绑定,请使用相同的命令和ID。

terraform destroy --target ibm_is_share.example.id

如果文件共享有快照,这些快照将与文件共享一起删除。

有关更多信息,请参阅 terraform destroy