调整共享

对于大多数驱动程序,调整共享是一项安全的操作。如果您想确保数据的安全,可以通过创建其快照来备份共享。

您可以使用 openstack share resize 命令扩展和缩小共享,并指定新的大小不超过配额的共享。有关详细信息,请参阅 配额和限制。您也不能将共享大小缩小到 0 或大于当前共享大小的值。

注意

从 API 版本 2.53 开始,扩展一个复制的共享,manila 配额系统将为两个额外的配额预留和消耗资源:share_replicasreplica_gigabytes。如果扩展共享及其所有共享副本没有可用的配额,则此请求将失败。

在扩展过程中,共享具有 extending 状态。这意味着增加共享大小的请求已成功发出。

要扩展共享并检查结果,请运行

$ openstack share resize docs_resize 2
$ openstack share show docs_resize
+---------------------------------------+---------------------------------------+
| Property                              | Value                                 |
+---------------------------------------+---------------------------------------+
| id                                    | a3454cf1-bb1d-4e4d-a8e4-a3881c593720  |
| size                                  | 2                                     |
| availability_zone                     | manila-zone-0                         |
| created_at                            | 2024-09-26T14:53:18.153832            |
| status                                | extending                             |
| name                                  | docs_resize                           |
| description                           | None                                  |
| project_id                            | 1f31ee1c3e3c443bbf9aee5684456daa      |
| snapshot_id                           | None                                  |
| share_network_id                      | None                                  |
| share_proto                           | NFS                                   |
| metadata                              | {}                                    |
| share_type                            | 303f0a73-711e-4beb-a4f7-a60acc1d588e  |
| is_public                             | True                                  |
| snapshot_support                      | True                                  |
| task_state                            | None                                  |
| share_type_name                       | default                               |
| access_rules_status                   | active                                |
| replication_type                      | None                                  |
| has_replicas                          | False                                 |
| user_id                               | b47d81c8c8c74ea3a7c13461f30ad5ed      |
| create_share_from_snapshot_support    | True                                  |
| revert_to_snapshot_support            | False                                 |
| share_group_id                        | None                                  |
| source_share_group_snapshot_member_id | None                                  |
| mount_snapshot_support                | False                                 |
| progress                              | 100%                                  |
| is_soft_deleted                       | False                                 |
| scheduled_to_be_deleted_at            | None                                  |
| source_backup_id                      | None                                  |
| share_server_id                       | None                                  |
| host                                  | host@backend1#poolA                   |
+---------------------------------------+---------------------------------------+

在缩小过程中,共享具有 shrinking 状态。这意味着减少共享大小的请求已成功发出。要缩小共享并检查结果,请运行

$ openstack share resize docs_resize 1
$ openstack share show docs_resize
+---------------------------------------+---------------------------------------+
| Property                              | Value                                 |
+---------------------------------------+---------------------------------------+
| id                                    | a3454cf1-bb1d-4e4d-a8e4-a3881c593720  |
| size                                  | 1                                     |
| availability_zone                     | manila-zone-0                         |
| created_at                            | 2024-09-26T14:53:18.153832            |
| status                                | shrinking                             |
| name                                  | docs_resize                           |
| description                           | None                                  |
| project_id                            | 1f31ee1c3e3c443bbf9aee5684456daa      |
| snapshot_id                           | None                                  |
| share_network_id                      | None                                  |
| share_proto                           | NFS                                   |
| metadata                              | {'__mount_options': 'fs=cephfs'}      |
| share_type                            | 303f0a73-711e-4beb-a4f7-a60acc1d588e  |
| is_public                             | True                                  |
| snapshot_support                      | True                                  |
| task_state                            | None                                  |
| share_type_name                       | default                               |
| access_rules_status                   | active                                |
| replication_type                      | None                                  |
| has_replicas                          | False                                 |
| user_id                               | b47d81c8c8c74ea3a7c13461f30ad5ed      |
| create_share_from_snapshot_support    | True                                  |
| revert_to_snapshot_support            | False                                 |
| share_group_id                        | None                                  |
| source_share_group_snapshot_member_id | None                                  |
| mount_snapshot_support                | False                                 |
| progress                              | 100%                                  |
| is_soft_deleted                       | False                                 |
| scheduled_to_be_deleted_at            | None                                  |
| source_backup_id                      | None                                  |
| share_server_id                       | None                                  |
| host                                  | host@backend1#poolA                   |
+---------------------------------------+---------------------------------------+