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
Open your
OpenStackControlPlaneCR file,openstack_control_plane.yaml, and add the following parameters to theglancetemplate to configure image quotas to apply to allglanceAPIinstances: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
-
To ensure
glanceuser access to image quotas that are registered in the Identity service, assign and verifyreaderrole access.Access the remote shell for
openstackclient:$ oc rsh openstackclientAssign
readerrole access to theglanceuser:$ openstack role add --user glance --system all readerAccess the
glanceCLI:$ source /home/cloud-admin/cloudrcVerify
glanceuser 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 | +-----------------------+-------+-------+Exit the
openstackclientpod:$ exit
Optional: Add the following parameter to the
customServiceConfigsection of theglancetemplate to configureimage_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.
Update the control plane:
$ oc apply -f openstack_control_plane.yaml -n openstackWait until RHOCP creates the resources related to the
OpenStackControlPlaneCR. Run the following command to check the status:$ oc get openstackcontrolplane -n openstackThe
OpenStackControlPlaneresources are created when the status is "Setup complete".提示Append the
-woption to the end of thegetcommand to track deployment progress.