Skip to content

Set directory quotas

When you finish, /home on the cluster holds at most 1 TiB, and Terraform reports how much of that it already uses.

Before you start

  • A Qumulo cluster whose REST API on port 8000 you can reach from this machine
  • An admin account on the cluster for the connection profile
  • Terraform 1.11 or later
  • Each directory you want to limit, already created on the cluster

1. Copy the configuration

Save this as main.tf in an empty directory.

terraform {
  required_version = ">= 1.11"
  required_providers {
    qumulo = {
      source  = "qumulo-terraform-registry.s3.us-east-1.amazonaws.com/qumulo/qumulo"
      version = "~> 1.0"
    }
  }
}

provider "qumulo" {
  connection_profiles = [
    {
      name                 = "cluster1"
      endpoint             = "https://cluster.example.com:8000" # <-- Replace with your cluster's REST API endpoint
      username             = "admin"
      password             = "YourClusterPassword123!" # <-- Replace with your admin password
      insecure_skip_verify = true
    },
  ]
}

resource "qumulo_directory_quota" "home" {
  connection_profile = "cluster1"

  directory_path = "/home"         # <-- Replace with an existing directory
  limit          = "1099511627776" # 1 TiB in bytes
}

output "home_quota_usage" {
  value = qumulo_directory_quota.home.capacity_usage
}

Replace the three values marked <-- Replace, and leave the rest as written. Delete insecure_skip_verify if the cluster's certificate is signed by a CA your machine trusts.

limit is a byte count written as a string, so 1 TiB is 1099511627776. To size a quota in GiB, write the arithmetic instead, such as limit = tostring(500 * 1073741824) for 500 GiB.

To limit more directories, copy the qumulo_directory_quota block with a new resource name and directory_path.

Warning

Changing directory_path later destroys the quota and creates a new one on the new directory.

2. Apply

terraform init -upgrade
terraform plan
terraform apply

The plan ends with Plan: 1 to add, 0 to change, 0 to destroy. The apply ends with Apply complete! Resources: 1 added, 0 changed, 0 destroyed., followed by the home_quota_usage output.

3. Check the cluster

Run terraform output home_quota_usage. It prints the bytes /home holds today, and every plan or apply reads the number fresh from the cluster.

Next

Share the directory with Export directories over NFS. If the apply reports Quota already exists, Troubleshoot cluster configuration shows how to import it, and the qumulo_directory_quota reference lists every attribute.

Quota concepts are in Qumulo's documentation.