8.3. Configuring quotas for the Image service


You can configure quotas for the Image service (glance) in the glance template in your OpenStackControlPlane custom resource (CR) file.

Procedure

  1. Open your OpenStackControlPlane CR file, openstack_control_plane.yaml, and add the following parameters to the glance template to configure image quotas to apply to all glanceAPI instances:

    apiVersion: core.openstack.org/v1beta1
    kind: OpenStackControlPlane
    metadata:
      name: openstack
    spec:
      glance:
        template:
          ...
          quotas:
            imageSizeTotal: 1000
            imageStageTotal: 1000
            imageCountUpload: 1000
            imageCountTotal: 1000
    ...
    • Setting quota limits to 0 has different implications depending on the quota type, for example:

      • imageCountTotal: 0: Prevents users from creating any images
      • imageCountUpload: 0: Allows users to upload data to any image
  2. To ensure glance user access to image quotas that are registered in the Identity service, assign and verify reader role access.

    1. Access the remote shell for openstackclient:

      $ oc rsh openstackclient
    2. Assign reader role access to the glance user:

      $ openstack role add --user glance --system all reader
    3. Access the glance CLI:

      $ source /home/cloud-admin/cloudrc
    4. Verify glance user access to image quotas:

      $ glance usage
      +-----------------------+-------+-------+
      | Quota                 | Limit | Usage |
      +-----------------------+-------+-------+
      | image_size_total      | 10    | 0     |
      | image_stage_total     | 10    | 0     |
      | image_count_total     | 10    | 0     |
      | image_count_uploading | 10    | 0     |
      +-----------------------+-------+-------+
    5. Exit the openstackclient pod:

      $ exit
  3. Optional: Add the following parameter to the customServiceConfig section of the glance template to configure image_size_cap:

    apiVersion: core.openstack.org/v1beta1
    kind: OpenStackControlPlane
    metadata:
      name: openstack
    spec:
      glance:
        template:
          ...
          quotas:
            ...
          customServiceConfig |
            [DEFAULT]
            ...
            image_size_cap = 1099511627776
    ...
    • You can replace the default value of 1099511627776 (1 TB) with a value up to the maximum value of 9223372036854775808. Depending on the available back-end storage capacity, a low value might cause image upload failures, and a high value results in increased consumption of storage.
  4. Update the control plane:

    $ oc apply -f openstack_control_plane.yaml -n openstack
  5. Wait until RHOCP creates the resources related to the OpenStackControlPlane CR. Run the following command to check the status:

    $ oc get openstackcontrolplane -n openstack

    The OpenStackControlPlane resources are created when the status is "Setup complete".

    提示

    Append the -w option to the end of the get command to track deployment progress.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

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

让开源更具包容性

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

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部