The object of setting quotas is to provide cloud services on demand to users without exhausting host resources that support these services. A well planned quota strikes a balance between overly restricting capacity and exceeding it to the point of causing service disruptions.
Setting a quota can be a challenge that entails some trial and error. Formulas are not reliable because every cloud is unique. The best approach is to base quotas on statistics of usage against capacity over time.
Not only does this allow you to observe how usage fluctuates, but when. Knowing that certain recurring business operations cause usage spikes at different times, you can either set quotas to absorb those spikes or adjust quotas when you anticipate them.
Another reason to monitor usage regularly is that Metacloud does not generate alerts when quotas are close to being exceeded, although some quota-sensitive operations in the Dashboard, such as launching an instance, show resource use against capacity:
Metacloud generates errors or prohibits operations when quotas are met to prevent quotas from being exceeded. For example, if your project contains 10 instances, which matches the quota, the Dashboard indicates that capacity has been reached and disables the the launch feature as long as usage is at capacity.
If you try to create an instance that would exceed your quota, the CLI returns an error:
$ openstack server create server11 --flavor <FLAVOR_ID> --image <IMAGE_ID> --nic net-id=<NETWORK_ID> Quota exceeded for instances: Requested 1, but already used 10 of 10 instances (HTTP 403) (Request-ID: req-<request_id>)
Managing Interdependent Quotas
Monitoring usage is especially beneficial when managing quotas for interdependent resources, such as snapshots and disk space. Although a snapshot is a virtual construct and, as such, a limitless resource, disk space is not.
For example, each snapshot of a volume multiplies the amount of disk space consumed. If an original volume consumes 10GB, each snapshot also consumes 10GB. A project with 10 snapshots consumes 110 GB of total volume.
Heavy demand for snapshots might warrant a high snapshot quota, but if storage capacity is met, snapshot creation fails, even if the snapshot quota has not been met. If you are tracking disk space consumption, you can anticipate and prevent these failures, by working with your team to suspend snapshot creation until snapshots that are no longer needed are deleted.
Metacloud provides several ways to monitor disk space consumption. Each time you create a snapshot of a volume in the Dashboard, you can view remaining available disk space and snapshots:
cinder quota-usage <PROJECT_ID> +------------------------+--------+----------+-------+ | Type | In_use | Reserved | Limit | +------------------------+--------+----------+-------+ | gigabytes | 20 | 0 | 1000 | | gigabytes_SolidFire | 10 | 0 | -1 | | gigabytes_cinder-AZ_1 | 10 | 0 | -1 | | snapshots | 0 | 0 | 10 | | snapshots_SolidFire | 0 | 0 | -1 | | snapshots_cinder-AZ_1 | 0 | 0 | -1 | | volumes | 2 | 0 | 10 | | volumes_SolidFire | 1 | 0 | -1 | | volumes_cinder-AZ_1 | 1 | 0 | -1 | +------------------------+--------+----------+-------+
Tip: A quota with a value of -1 signifies no limit.
You can view disk usage in Grafana. If your cloud has Ceph-backed storage, Grafana provides additional Ceph metrics. See Expanding Your View of Cloud Usage with Grafana.