--- title: "VAST Cluster User Quota Management" slug: "vast-cluster-user-quota-management" description: "Manage VAST cluster user quotas effortlessly using vastpy-tool and direct API calls; step-by-step guide included." updated: 2026-10-30T18:47:16Z published: 2026-10-30T18:47:16Z canonical: "docs.vastdata.com/vast-cluster-user-quota-management" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.vastdata.com/llms.txt > Use this file to discover all available pages before exploring further. # VAST Cluster User Quota Management ## Overview This wiki page provides a complete guide for managing user quotas on VAST clusters using two approaches: - The command-line tool: **vastpy-cli.** - Direct **curl** API requests. Included are installation instructions, examples for listing and patching quotas, and reusable shell commands to automate operations. ## Prerequisites Before running the script, ensure that: - Python 3.6+ is installed - You have network access to the VAST Cluster API (https://) - You possess API credentials (admin username and password) - `pip` is installed ## Install vastpy and vastpy-cli ```plaintext pip install vastpy ``` This installs both the Python SDK and `vastpy-cli` tool. ## Authentication Set the following environment variables: ```plaintext export VMS_USER=admin export VMS_PASSWORD=your_password export VMS_ADDRESS=VMS_IP ``` --- ## 1. Using vastpy-cli ### Create a User Quota #### Prerequisites - The directory quota must already exist. - You have the username and identifier type. #### Step 1: Create a Directory Quota ```plaintext vastpy-cli post quotas path=/quota-test-2 name=quota-test-2 is_user_quota=true ``` #### Step 2: Identify the Directory Quota (quota_id) ```plaintext vastpy-cli get quotas page_size=0 fields=entity_identifier,path,soft_limit,hard_limit,id ``` #### Step 3: Create User Quota > [!NOTE] > ℹ️ Info > > In this example, I used quota_user_2 ```plaintext vastpy-cli post userquotas quota_id=8 identifier_type=username identifier=quota_user_2 \  soft_limit=161061273600 hard_limit=214748364800 is_group=false grace_period="1 00:00:00" ``` #### Optional: Create the JSON Payload ```plaintext {  "quota_id": 8,  "identifier_type": "username",  "identifier": "quota_user_2",  "is_group": false,  "soft_limit": 161061273600,  "hard_limit": 214748364800,  "grace_period": "1 00:00:00" } ``` ```plaintext vastpy-cli post userquotas --file-input new_user_quota.json ``` #### Verify Quota Creation ```plaintext vastpy-cli get userquotas page_size=0 fields=entity_identifier,path,soft_limit,hard_limit,id ``` ### List User Quotas ```plaintext vastpy-cli get userquotas page_size=0 fields=entity_identifier,path,soft_limit,hard_limit,id ``` > [!NOTE] > ℹ️ Info > > For optional ways to query user/group quota, see the [examples](/kb/docs/vast-cluster-user-quota-management#appendix-extended-quota-listing-script) in the appendix at the end of the article. ### Update User Quotas Option A: One-liner Update ```plaintext vastpy-cli patch userquotas/50 soft_limit=161061273600 hard_limit=214748364800 ``` #### Option B: Patch via File ```plaintext export NEW_SOFT_GB=160 export NEW_HARD_GB=200 cat < quota_update.json {  "soft_limit": $((NEW_SOFT_GB * 1073741824)),  "hard_limit": $((NEW_HARD_GB * 1073741824)),  "grace_period": "1 00:00:00" } EOF vastpy-cli patch userquotas/ID --file-input quota_update.json ``` ### Delete User Quota ```plaintext vastpy-cli delete userquotas/ ``` --- ## 2. Using curl ### Authentication ```plaintext export VMS_IP=your_vms_ip export VMS_USER=admin export VMS_PASSWORD=your_password export ACCESS_TOKEN=$(curl -sk -X POST https://$VMS_IP/api/v5/token/ \  -H "Content-Type: application/json" \  -d '{"username": "$VMS_USER", "password": "$VMS_PASSWORD"}' | jq -r '.access') ``` ### List User Quotas ```plaintext curl -sk -X GET https://$VMS_IP/api/userquotas \  -H "Authorization: Bearer $ACCESS_TOKEN" \  -H "Accept: application/json" | jq '.results[] | {id, entity_identifier, path}' ``` ### Update User Quotas - Step-by-Step with All Variables ```plaintext # === CONFIG === export VMS_IP=VMS_IP export VMS_USER=admin export VMS_PASSWORD=PASSWORD export USER_QUOTA_ID=QUOTA_ID # Set limits in GB export SOFT_LIMIT_GB=150 export HARD_LIMIT_GB=200 # Convert limits to bytes and export as strings export SOFT_LIMIT_BYTES=$(($SOFT_LIMIT_GB * 1024 * 1024 * 1024)) export HARD_LIMIT_BYTES=$(($HARD_LIMIT_GB * 1024 * 1024 * 1024)) # Optional inodes and grace export SOFT_INODES=0 export HARD_INODES=0 export GRACE_PERIOD="1d" # === LOGIN AND TOKEN EXTRACTION === export ACCESS_TOKEN=$(curl -sk -X POST https://$VMS_IP/api/v5/token/ \  -H "Content-Type: application/json" \  -d "{\"username\": \"$VMS_USER\", \"password\": \"$VMS_PASSWORD\"}" | jq -r '.access') # Check if token is valid if [[ "$ACCESS_TOKEN" == "null" || -z "$ACCESS_TOKEN" ]]; then  echo "Failed to retrieve access token"  exit 1 fi # === PATCH USER QUOTA === curl -sk -X PATCH https://$VMS_IP/api/v5/userquotas/$USER_QUOTA_ID/ \  -H "Content-Type: application/json" \  -H "Authorization: Bearer $ACCESS_TOKEN" \  -d "{    \"soft_limit\": \"$SOFT_LIMIT_BYTES\",    \"hard_limit\": \"$HARD_LIMIT_BYTES\",    \"soft_limit_inodes\": $SOFT_INODES,    \"hard_limit_inodes\": $HARD_INODES,    \"grace_period\": \"$GRACE_PERIOD\"  }" ``` ### Delete User Quotas ```plaintext curl -sk -X DELETE https://$VMS_IP/api/userquotas/ \  -H "Authorization: Bearer $ACCESS_TOKEN" \  -H "Accept: application/json" ``` --- ## Reference All commands are based on the official VAST API documentation: - https://VMS_IP/DOCS - [VASTPY](https://github.com/vast-data/vastpy) ## Appendix: Extended Quota Listing Script ```plaintext vastpy-cli get userquotas --json | jq -r '  (["ID", "Identifier", "Type", "IsGroup", "Path", "SoftLimit_GB", "HardLimit_GB"]),  (.results[] | [    .id,    (.entity.identifier // "N/A"),    (.entity.identifier_type // "N/A"),    (.entity.is_group // false),    (.path // "N/A"),    ((.soft_limit // 0) / 1073741824 | tostring + " GB"),    ((.hard_limit // 0) / 1073741824 | tostring + " GB")  ]) | @tsv' | column -t -s $'\t' ``` Sample Output: ```plaintext ID  Identifier    Type       IsGroup  Path        SoftLimit_GB          HardLimit_GB 84  quota_user_1  username   false    /prodquota  93.13225746154785 GB  111.75870895385742 GB 85  0             uid        false    /prodquota  0 GB                  0 GB 86  root          groupname  true     /prodquota  0 GB                  0 GB 87  quotagrp-1    groupname  true     /prodquota  93.13225746154785 GB  186.2645149230957 GB ```