# Workload Quotas

Trilio enables Openstack administrators to set Project Quotas against the usage of Trilio.

The following Quotas can be set:

* Number of Workloads a Project is allowed to have
* Number of Snapshots a Project is allowed to have
* Number of VMs a Project is allowed to protect
* Amount of Storage a Project is allowed to use on the Backup Target

## Work with Workload Quotas via Horizon

{% hint style="warning" %}
The Trilio Quota feature is available for all supported Openstack versions and distributions, but only Train and higher releases include the Horizon integration of the Quota feature.
{% endhint %}

Workload Quotas are managed like any other Project Quotas.

1. Login into Horizon as user with admin role
2. Navigate to Identity
3. Navigate to Projects
4. Identify the Project to modify or show the quotas on
5. Use the small arrow next to "Manage Members" to open the submenu
6. Choose "Modify Quotas"
7. Navigate to "Workload Manager"
8. Edit Quotas as desired
9. Click "Save"

![Screenshot of Horizon integration for Workload Manager Quotas](https://1689278081-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5g8HA7bXC7P2x2RbsH%2F-MSdJS8Q6x8IzIBz3ON9%2F-MSdJpVcdUIGOrkGrEQN%2Fimage.png?alt=media\&token=985b14f1-2a8d-4d36-87b9-b8f928972e95)

## Work with Workload Quotas via CLI

### List available Quota Types

Trilio is providing several different Quotas. The following command allows listing those.

{% hint style="danger" %}
Trilio 4.1 do not yet have the Quota Type Volume integrated.\
Using this will not generate any Quotas a Tenant has to apply to.
{% endhint %}

```
workloadmgr project-quota-type-list
```

### Show Quota Type Details

The following command will show the details of a provided Quota Type.

```
workloadmgr project-quota-type-show <quota_type_id>
```

* `<quota_type_id>` :arrow\_right:ID of the Quota Type to show

### Create a Quota

The following command will create a Quota for a given project and set the provided value.

```
workloadmgr project-allowed-quota-create --quota-type-id quota_type_id
                                         --allowed-value allowed_value 
                                         --high-watermark high_watermark 
                                         --project-id project_id
```

* `<quota_type_id>` :arrow\_right:ID of the Quota Type to be created
* `<allowed_value>`:arrow\_right: Value to set for this Quota Type
* `<high_watermark>`:arrow\_right: Value to set for High Watermark warnings
* `<project_id>`:arrow\_right: Project to assign the quota to

{% hint style="info" %}
The high watermark is automatically set to 80% of the allowed value when set via Horizon.
{% endhint %}

{% hint style="info" %}
A created Quota will generate an allowed\_quota\_object with its own ID. This is ID is needed when continuing to work with the created Quota.
{% endhint %}

### List allowed Quotas

The following command lists all Trilio Quotas set for a given project.

```
workloadmgr project-allowed-quota-list <project_id>
```

* `<project_id>`:arrow\_right: Project to list the Quotas from

### Show allowed Quota

The following command shows the details about a provided allowed Quota.

```
workloadmgr project-allowed-quota-show <allowed_quota_id>
```

* `<allowed_quota_id>` :arrow\_right:ID of the allowed Quota to show.

### Update allowed Quota

The following command shows how to update the value of an already existing allowed Quota.

```
workloadmgr project-allowed-quota-update [--allowed-value <allowed_value>]
                                         [--high-watermark <high_watermark>]
                                         [--project-id <project_id>]
                                         <allowed_quota_id>
```

* `<allowed_value>`:arrow\_right: Value to set for this Quota Type
* `<high_watermark>`:arrow\_right: Value to set for High Watermark warnings
* `<project_id>`:arrow\_right: Project to assign the quota to
* `<allowed_quota_id>` :arrow\_right:ID of the allowed Quota to update

### Delete allowed Quota

The following command will delete an allowed Quota and sets the value of the connected Quota Type back to unlimited for the affected project.

```
workloadmgr project-allowed-quota-delete <allowed_quota_id>
```

* `<allowed_quota_id>` :arrow\_right:ID of the allowed Quota to delete
