Commands for managing volumes

Depending on whether you are an administrator or an individual user, the Ozone shell commands enable you to create, delete, view, list, and update volumes. Before running these commands, you must have configured the Ozone Service ID for your cluster from the Configuration tab of the Ozone service on Cloudera Manager.

Creating a volume

Only an administrator can create a volume and assign it to a user. You must assign administrator privileges to users before they can create volumes. For more information, see Assigning administrator privileges to users.

Command Syntax
ozone sh volume create --quota=<volumecapacity> --user=<username> URI
Purpose Creates a volume and assigns it to a user.
Arguments
  • -q, quota: Specifies the maximum size the volume can occupy in the cluster. This is an optional parameter.
  • -u, user: The name of the user who can use the volume. The designated user can create buckets and keys inside the particular volume. This is a mandatory parameter.
  • URI: The name of the volume to create in the <prefix>://<Service ID>/<volumename> format.
Example
ozone sh volume create --quota=2TB --user=usr1 o3://ozone1/vol1
This command creates a 2-TB volume named vol1 for user usr1. Here, ozone1 is the Ozone Service ID.

Deleting a volume

Command Syntax
ozone sh volume delete URI
Purpose Deletes the specified volume, which must be empty.
Arguments URI: The name of the volume to delete in the <prefix>://<Service ID>/<volumename> format.
Example
ozone sh volume delete o3://ozone1/vol2
This command deletes the empty volume vol2. Here, ozone1 is the Ozone Service ID.

Viewing volume information

Command Syntax
ozone sh volume info URI
Purpose Provides information about the specified volume.
Arguments URI: The name of the volume whose details you want to view, in the <prefix>://<Service ID>/<volumename> format.
Example
ozone sh volume info o3://ozone1/vol3
This command provides information about the volume vol3. Here, ozone1 is the Ozone Service ID.

Listing volumes

Command Syntax
ozone sh volume list --user <username> URI
Purpose Lists all the volumes owned by the specified user.
Arguments
  • -u, user: The name of the user whose volumes you want to list.
  • URI: The Service ID of the cluster in the <prefix>://<Service ID>/ format.
Example
ozone sh volume list --user usr2 o3://ozone1/
This command lists the volumes owned by user usr2. Here, ozone1 is the Ozone Service ID.

Updating a volume

Command Syntax
ozone sh volume setquota --namespace-quota <namespacecapacity> --space-quota <volumecapacity> URI 
Purpose Updates the quota of the specific volume.
Arguments
  • --namespace-quota <namespacecapacity>: Specifies the maximum number of buckets this volume can have.
  • --space-quota <volumecapacity>: Specifies the maximum size the volume can occupy in the cluster.
  • URI: The name of the volume to update in the <prefix>://<Service ID>/<volumename> format.
Example
ozone sh volume setquota --namespace-quota 1000 --space-quota 10GB /volume1
This command sets volume1 namespace quota to 1000 and space quota to 10GB.