|
| 1 | +# Resource Reservation Exceeds Quota |
| 2 | + |
| 3 | +## Severity: Info |
| 4 | + |
| 5 | +## Impact |
| 6 | + |
| 7 | +Knowledge of over requested resources will allow the user to adjust the nominal quota or resources requested by a workload. |
| 8 | + |
| 9 | +## Summary |
| 10 | + |
| 11 | +This alert is triggered when resource reservation is 10 times the available nominal quota in a cluster queue. |
| 12 | + |
| 13 | +## Steps |
| 14 | + |
| 15 | +1. Check current resource reservation for the cluster queue and ensure that the nominal quota for the resource in question is correctly configured. Update the cluster-queue-name in the script below to describe the cluster queue. |
| 16 | +```bash |
| 17 | +cluster_queue=< cluster-queue-name > |
| 18 | +oc describe clusterqueue $cluster_queue |
| 19 | +``` |
| 20 | + |
| 21 | + - If you would just like to view the Flavors Reservation and Flavors Usage you can use the following command: |
| 22 | +```bash |
| 23 | +oc describe clusterqueue $cluster_queue | awk '/Flavors Reservation:/,/^$/' |
| 24 | +``` |
| 25 | + |
| 26 | +2. Review the workloads that are linked with the cluster queue to see if the requested resources are required. |
| 27 | +```bash |
| 28 | +# Find local queues linked to the cluster queue |
| 29 | +local_queues=$(oc get localqueues --all-namespaces -o json | jq -r --arg clusterQueue "$cluster_queue" '.items[] | select(.spec.clusterQueue == $clusterQueue) | "\(.metadata.namespace)/\(.metadata.name)"') |
| 30 | + |
| 31 | +# Find workloads linked to the local queues |
| 32 | +for local_queue in $local_queues; do |
| 33 | + namespace=$(echo $local_queue | cut -d '/' -f 1) |
| 34 | + queue_name=$(echo $local_queue | cut -d '/' -f 2) |
| 35 | + |
| 36 | + echo "Checking workloads linked to local queue $queue_name in namespace $namespace..." |
| 37 | + |
| 38 | + oc get workloads --namespace $namespace -o json | jq -r --arg queueName "$queue_name" '.items[] | select(.spec.queueName == $queueName) | "\(.metadata.namespace)/\(.metadata.name)"' |
| 39 | +done |
| 40 | +``` |
| 41 | + |
| 42 | +3. Review individual workloads. Update the namespace and workload-name in the script below to view details of the workload. |
| 43 | +```bash |
| 44 | +namespace=< namespace > |
| 45 | +workload_name=< workload-name > |
| 46 | +oc describe workload -n $namespace $workload_name |
| 47 | +``` |
| 48 | + |
| 49 | +4. Consider increasing the cluster queue nominal quota. |
| 50 | +You can patch the clusterqueue using the following command. Note that you must change the values to refer to the exact resource you want to change. |
| 51 | +This will change the nominal quota for cpu to 10, in the first flavor referenced in the named cluster queue resource: |
| 52 | +```bash |
| 53 | +oc patch clusterqueue $cluster_queue --type='json' -p='[{"op": "replace", "path": "/spec/resourceGroups/0/flavors/0/resources/0/nominalQuota", "value": "10"}]' |
| 54 | +``` |
| 55 | + |
| 56 | +5. Alternatively consider altering the resources requested in the pending workloads, if possible. |
0 commit comments