搜索

6.7. 更改共享文件系统服务中的默认配额

download PDF

为防止系统容量在没有通知的情况下耗尽,云管理员可以配置配额。配额是操作限制。共享文件系统服务(manila)默认强制执行一些可行的限制。这些限制称为默认配额。云管理员可覆盖默认配额,以便单个项目具有不同的消耗限制。

6.7.1. 更新项目、用户和共享类型的配额

作为云管理员,您可以使用 manila quota-show 命令列出项目或用户的配额。

您可以为项目中的所有用户或特定项目用户更新配额,或者项目用户使用的共享类型。您可以为您选择的目标更新以下配额:

  • 共享 :您可以创建的共享数。
  • 快照 :您可以创建的快照数。
  • gigabytes :您可以为所有共享分配的总大小(以 GB 为单位)。
  • snapshot-gigabytes :您可以为所有共享快照分配的总大小(以 GB 为单位)。
  • share-networks :您可以创建的共享网络总数。
  • share_groups :您可以创建的共享组总数。
  • share_group_snapshots :您可以创建的共享组快照总数。
  • share-replicas :您可以创建的共享副本数。
  • replica-gigabytes :您可以在所有共享副本间分配的总大小(以 GB 为单位)。
注意

您只能在项目级别指定 共享类型 配额。您不能 为特定项目用户设置共享类型 配额。

重要

在以下步骤中,仔细输入值。共享文件系统服务不会检测或报告不正确的值。

流程

  1. 您可以使用以下命令来查看配额。如果包含 --user 选项,您可以在指定项目中查看特定用户的配额。如果省略 --user 选项,您可以查看应用到指定项目的所有用户的配额。

    同样,如果您包含可选的 --share-type,您可以查看特定共享类型的配额,因为它与项目相关。--user--share-type 选项是互斥的。

    $ manila quota-show
    • 项目示例:

      $ 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 \
        --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 \
        --share-type dhss_false
      +---------------------+----------------------------------+
      | Property            | Value                            |
      +---------------------+----------------------------------+
      | gigabytes           | 1000                             |
      | id                  | af2838436f3f4cf6896399dd97c4c050 |
      | replica_gigabytes   | 1000                             |
      | share_replicas      | 100                              |
      | shares              | 15                               |
      | snapshot_gigabytes  | 1000                             |
      | snapshots           | 50                               |
      +---------------------+----------------------------------+
  2. 使用 manila quota-update 命令更新配额。您可以为所有项目用户、特定项目用户或项目中的共享类型更新配额:

    • 为项目中的所有用户更新配额:

      $ manila quota-update <id> \
        [--shares <share_quota> \
        --gigabytes <share_gigabytes_quota> \
        …]

      将 & lt;id& gt; 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。

    • 为项目中的特定用户更新配额:

      $ manila quota-update <id> \
        --user <user_id> \
        [--shares <new_share_quota> \
        --gigabytes <new_share_gigabytes_quota> \
        …]
      • 将 & lt;id& gt; 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。
      • <user_id& gt; 替换为用户 ID。该值必须是用户 ID,而不是用户名。
    • 为使用特定共享类型的所有用户更新配额:

      $ manila quota-update <id> \
        --share-type <share_type> \
        [--shares <new_share_quota>30
        --gigabytes <new-share_gigabytes_quota> \
        …]
      • 将 & lt;id& gt; 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。
      • 将 < share_type > 替换为您要将配额应用到的共享类型的名称或 ID。

验证

  • quota-update 命令不会生成任何输出。使用 quota-show 命令验证配额是否已成功更新。

6.7.2. 为项目、用户和共享类型重置配额

您可以删除配额覆盖,将配额返回到默认值。目标实体受默认配额限制,适用于所有没有覆盖的项目。

流程

  • 使用 manila quota-delete 命令将配额返回到默认值。您可以将配额返回到所有项目用户、特定项目用户或项目中的共享类型的默认值:

    • 重置项目配额:

      $ manila quota-delete --project <id>

      将 & lt;id& gt; 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。

    • 为特定用户重置配额:

      $ manila quota-delete --project <id> --user <user_id>
      • 将 & lt;id& gt; 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。
      • <user_id& gt; 替换为用户 ID。该值必须是用户 ID,而不是用户名。
    • 为项目用户使用的共享类型重置配额:

      $ manila quota-delete --project <id> --share-type <share_type>
      • 将 & lt;id& gt; 替换为项目 ID。这个值必须是项目 ID,而不是项目名称。
      • <share_type > 替换为必须重置配额的共享类型的名称或 ID。

验证

  1. quota-delete 命令不会生成任何输出。使用 quota-show 命令来验证配额是否已成功重置。
  2. 列出所有项目的默认配额。默认配额应用到没有覆盖的项目。

    $ manila quota-class-show default

6.7.3. 更新共享文件系统服务项目的默认配额值

作为云管理员,您可以更新应用到尚未有配额覆盖的所有项目的默认配额。

流程

  1. 查看 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>
    注意

    参数 & lt;class_name > 是一个位置参数。它标识设置配额的配额类。将此参数设置为 default。不支持其他配额类。

    您可以为以下任何可选参数更新值:

    • --shares <shares > 为 共享 配额添加新值。
    • --snapshots <snapshots > 为 快照 配额添加新值。
    • --gigabytes <gigabytes> 添加一个新的 gigabytes 配额。
    • --snapshot-gigabytes <snapshot_gigabytes& gt ; 或 --snapshot_gigabytes <snapshot_gigabytes > 为 snapshot_gigabytes 配额添加一个新值。
    • --share-networks <share_networks& gt ; 或 --share_networks <share_networks > 为 share_networks 配额添加一个新值。
    • --share-replicas <share_replicas& gt ; , --share_replicas <share_replicas &gt ; 或 --replicas <share_replicas > 为 share_replicas 配额添加一个新的值。
    • --replica-gigabytes <replica_gigabytes& gt ; 或 --replica_gigabytes <replica_gigabytes > 为 replica_gigabytes 配额添加一个新的值。
  2. 使用 usage 语句中的信息来更新默认配额。以下示例为 sharesgigabytes 更新默认配额:

    $ 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      |
    +-----------------------+---------+
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.