6.7. 更改共享文件系统服务中的默认配额
为防止系统容量在没有通知的情况下耗尽,云管理员可以配置配额。配额是操作限制。共享文件系统服务(manila)默认强制执行一些可行的限制。这些限制称为默认配额。云管理员可覆盖默认配额,以便单个项目具有不同的消耗限制。
6.7.1. 更新项目、用户和共享类型的配额 复制链接链接已复制到粘贴板!
作为云管理员,您可以使用 manila quota-show 命令列出项目或用户的配额。
您可以为项目中的所有用户或特定项目用户更新配额,或者项目用户使用的共享类型。您可以为您选择的目标更新以下配额:
-
共享:您可以创建的共享数。 -
快照:您可以创建的快照数。 -
gigabytes:您可以为所有共享分配的总大小(以 GB 为单位)。 -
snapshot-gigabytes:您可以为所有共享快照分配的总大小(以 GB 为单位)。 -
share-networks:您可以创建的共享网络总数。 -
share_groups:您可以创建的共享组总数。 -
share_group_snapshots:您可以创建的共享组快照总数。 -
share-replicas:您可以创建的共享副本数。 -
replica-gigabytes:您可以在所有共享副本间分配的总大小(以 GB 为单位)。
您只能在项目级别指定 共享类型 配额。您不能 为特定项目用户设置共享类型 配额。
在以下步骤中,仔细输入值。共享文件系统服务不会检测或报告不正确的值。
流程
您可以使用以下命令来查看配额。如果包含
--user选项,您可以在指定项目中查看特定用户的配额。如果省略--user选项,您可以查看应用到指定项目的所有用户的配额。同样,如果您包含可选的
--share-type,您可以查看特定共享类型的配额,因为它与项目相关。--user和--share-type选项是互斥的。manila quota-show
$ manila quota-showCopy to Clipboard Copied! Toggle word wrap Toggle overflow 项目示例:
manila quota-show \ --project af2838436f3f4cf6896399dd97c4c050 +-----------------------+----------------------------------+ | Property | Value | +-----------------------+----------------------------------+ | gigabytes | 1000 | | id | af2838436f3f4cf6896399dd97c4c050 | | replica_gigabytes | 1000 | | share_group_snapshots | 50 | | share_groups | 49 | | share_networks | 10 | | share_replicas | 100 | | shares | 50 | | snapshot_gigabytes | 1000 | | snapshots | 50 | +-----------------------+----------------------------------+
$ manila quota-show \ --project af2838436f3f4cf6896399dd97c4c050 +-----------------------+----------------------------------+ | Property | Value | +-----------------------+----------------------------------+ | gigabytes | 1000 | | id | af2838436f3f4cf6896399dd97c4c050 | | replica_gigabytes | 1000 | | share_group_snapshots | 50 | | share_groups | 49 | | share_networks | 10 | | share_replicas | 100 | | shares | 50 | | snapshot_gigabytes | 1000 | | snapshots | 50 | +-----------------------+----------------------------------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow 项目用户示例:
manila quota-show \ --project af2838436f3f4cf6896399dd97c4c050 \ --user 81ebb491dd0e4c2aae0775dd564e76d1 +-----------------------+----------------------------------+ | Property | Value | +-----------------------+----------------------------------+ | gigabytes | 500 | | id | af2838436f3f4cf6896399dd97c4c050 | | replica_gigabytes | 1000 | | share_group_snapshots | 50 | | share_groups | 49 | | share_networks | 10 | | share_replicas | 100 | | shares | 25 | | snapshot_gigabytes | 1000 | | snapshots | 50 | +-----------------------+----------------------------------+
$ manila quota-show \ --project af2838436f3f4cf6896399dd97c4c050 \ --user 81ebb491dd0e4c2aae0775dd564e76d1 +-----------------------+----------------------------------+ | Property | Value | +-----------------------+----------------------------------+ | gigabytes | 500 | | id | af2838436f3f4cf6896399dd97c4c050 | | replica_gigabytes | 1000 | | share_group_snapshots | 50 | | share_groups | 49 | | share_networks | 10 | | share_replicas | 100 | | shares | 25 | | snapshot_gigabytes | 1000 | | snapshots | 50 | +-----------------------+----------------------------------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow 特定共享类型的项目示例:
manila quota-show \ --project af2838436f3f4cf6896399dd97c4c050 \ --share-type dhss_false +---------------------+----------------------------------+ | Property | Value | +---------------------+----------------------------------+ | gigabytes | 1000 | | id | af2838436f3f4cf6896399dd97c4c050 | | replica_gigabytes | 1000 | | share_replicas | 100 | | shares | 15 | | snapshot_gigabytes | 1000 | | snapshots | 50 | +---------------------+----------------------------------+
$ manila quota-show \ --project af2838436f3f4cf6896399dd97c4c050 \ --share-type dhss_false +---------------------+----------------------------------+ | Property | Value | +---------------------+----------------------------------+ | gigabytes | 1000 | | id | af2838436f3f4cf6896399dd97c4c050 | | replica_gigabytes | 1000 | | share_replicas | 100 | | shares | 15 | | snapshot_gigabytes | 1000 | | snapshots | 50 | +---------------------+----------------------------------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow
使用
manila quota-update命令更新配额。您可以为所有项目用户、特定项目用户或项目中的共享类型更新配额:为项目中的所有用户更新配额:
manila quota-update <id> \ [--shares <share_quota> \ --gigabytes <share_gigabytes_quota> \ …]
$ manila quota-update <id> \ [--shares <share_quota> \ --gigabytes <share_gigabytes_quota> \ …]Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将 &
lt;id> 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。为项目中的特定用户更新配额:
manila quota-update <id> \ --user <user_id> \ [--shares <new_share_quota> \ --gigabytes <new_share_gigabytes_quota> \ …]
$ manila quota-update <id> \ --user <user_id> \ [--shares <new_share_quota> \ --gigabytes <new_share_gigabytes_quota> \ …]Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
将 &
lt;id> 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。 -
将
<user_id> 替换为用户 ID。该值必须是用户 ID,而不是用户名。
-
将 &
为使用特定共享类型的所有用户更新配额:
manila quota-update <id> \ --share-type <share_type> \ [--shares <new_share_quota>30 --gigabytes <new-share_gigabytes_quota> \ …]
$ manila quota-update <id> \ --share-type <share_type> \ [--shares <new_share_quota>30 --gigabytes <new-share_gigabytes_quota> \ …]Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
将 &
lt;id> 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。 -
将 <
share_type> 替换为您要将配额应用到的共享类型的名称或 ID。
-
将 &
验证
-
quota-update命令不会生成任何输出。使用quota-show命令验证配额是否已成功更新。
6.7.2. 为项目、用户和共享类型重置配额 复制链接链接已复制到粘贴板!
您可以删除配额覆盖,将配额返回到默认值。目标实体受默认配额限制,适用于所有没有覆盖的项目。
流程
使用
manila quota-delete命令将配额返回到默认值。您可以将配额返回到所有项目用户、特定项目用户或项目中的共享类型的默认值:重置项目配额:
manila quota-delete --project <id>
$ manila quota-delete --project <id>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将 &
lt;id> 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。为特定用户重置配额:
manila quota-delete --project <id> --user <user_id>
$ manila quota-delete --project <id> --user <user_id>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
将 &
lt;id> 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。 -
将
<user_id> 替换为用户 ID。该值必须是用户 ID,而不是用户名。
-
将 &
为项目用户使用的共享类型重置配额:
manila quota-delete --project <id> --share-type <share_type>
$ manila quota-delete --project <id> --share-type <share_type>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
将 &
lt;id> 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。 -
将
<share_type> 替换为必须重置配额的共享类型的名称或 ID。
-
将 &
验证
-
quota-delete命令不会生成任何输出。使用quota-show命令来验证配额是否已成功重置。 列出所有项目的默认配额。默认配额应用到没有覆盖的项目。
manila quota-class-show default
$ manila quota-class-show defaultCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.7.3. 更新共享文件系统服务项目的默认配额值 复制链接链接已复制到粘贴板!
作为云管理员,您可以更新应用到尚未有配额覆盖的所有项目的默认配额。
流程
查看
manila quota-class-update命令的 usage 语句:manila help quota-class-update usage: manila quota-class-update [--shares <shares>] [--snapshots <snapshots>] [--gigabytes <gigabytes>] [--snapshot-gigabytes <snapshot_gigabytes>] [--share-networks <share_networks>] [--share-replicas <share_replicas>] [--replica-gigabytes <replica_gigabytes>] <class_name>$ manila help quota-class-update usage: manila quota-class-update [--shares <shares>] [--snapshots <snapshots>] [--gigabytes <gigabytes>] [--snapshot-gigabytes <snapshot_gigabytes>] [--share-networks <share_networks>] [--share-replicas <share_replicas>] [--replica-gigabytes <replica_gigabytes>] <class_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意参数 &
lt;class_name> 是一个位置参数。它标识设置配额的配额类。将此参数设置为default。不支持其他配额类。您可以为以下任何可选参数更新值:
-
--shares <shares> 为共享配额添加新值。 -
--snapshots <snapshots> 为快照配额添加新值。 -
--gigabytes <gigabytes>添加一个新的gigabytes配额。 -
--snapshot-gigabytes <snapshot_gigabytes> 或 --snapshot_gigabytes <snapshot_gigabytes> 为snapshot_gigabytes配额添加一个新值。 -
--share-networks <share_networks> 或 --share_networks <share_networks> 为share_networks配额添加一个新值。 -
--share-replicas <share_replicas> , --share_replicas <share_replicas> 或 --replicas <share_replicas> 为share_replicas配额添加一个新的值。 -
--replica-gigabytes <replica_gigabytes> 或 --replica_gigabytes <replica_gigabytes> 为replica_gigabytes配额添加一个新的值。
-
使用 usage 语句中的信息来更新默认配额。以下示例为
shares和gigabytes更新默认配额:manila quota-class-update default \ --shares 30 \ --gigabytes 512 manila quota-class-show default +-----------------------+---------+ | Property | Value | +-----------------------+---------+ | gigabytes | 512 | | id | default | | replica_gigabytes | 1000 | | share_group_snapshots | 50 | | share_groups | 50 | | share_networks | 10 | | share_replicas | 100 | | shares | 30 | | snapshot_gigabytes | 1000 | | snapshots | 50 | +-----------------------+---------+
$ manila quota-class-update default \ --shares 30 \ --gigabytes 512 $ manila quota-class-show default +-----------------------+---------+ | Property | Value | +-----------------------+---------+ | gigabytes | 512 | | id | default | | replica_gigabytes | 1000 | | share_group_snapshots | 50 | | share_groups | 50 | | share_networks | 10 | | share_replicas | 100 | | shares | 30 | | snapshot_gigabytes | 1000 | | snapshots | 50 | +-----------------------+---------+Copy to Clipboard Copied! Toggle word wrap Toggle overflow