Skip to main content
Version: 3.1

Create custom tags for cloud-drives

Custom tags for cloud drives provide a way to meaningfully organize and categorize files and documents based on specific criteria or attributes. These tags act as labels or metadata attached to your files, enabling easier searching, sorting, and filtering of content within your cloud storage. Following are some common use cases and benefits of using custom tags for cloud drives:

  • Enhanced organization: Custom tags allow you to create a personalized organizational system for your files, independent of folder structures. You can assign multiple tags to a single file, making it easier to locate and group related content across different folders.
  • Quick and intuitive searching: By assigning relevant tags to your files, you can quickly locate specific documents using tag-based searches. This eliminates the need to remember specific file names or navigate through complex folder hierarchies.
  • Cross-category classification: Custom tags can span across different categories or topics. For example, you can tag a document with multiple tags like "Project A", "Quarterly Report", and "Financials". This flexibility enables you to view files from different angles and find related documents across different contexts.
  • Collaborative organization: When collaborating with others on cloud drives, custom tags provide a shared labeling system that helps everyone involved find and categorize files consistently. Team members can apply relevant tags to files, simplifying collaboration and ensuring easy access to shared resources.
  • Automation and workflows: You can use custom tags as triggers or conditions for automating workflows. Cloud drive platforms often offer integration with automation tools or third-party services, allowing you to perform actions based on specific tags. For example, you can set up an automation rule to move files tagged as "Urgent" to a specific folder or notify team members when a file is tagged as "Needs Review".

You can add custom tags to cloud-drives during these two stages:

  • during fresh Portworx installation
  • while adding new disks using the pxctl sv drive add -s command
note

Currently, you can specify custom tags for cloud-drives provisioned on AWS, Azure, GCP and Oracle cloud platforms. vSphere, Pure, and IBM platforms do not support cloud-drive tags.

Custom tags format

You can specify custom tags as a key:value pair. Using a ; separator, you can specify more than one key:value pairs. For example, tags=tenant:fin;bu:finance;env:prod.

note
  • You can also specify only the key:, without a value.
  • You cannot specify a custom tag without a key.
  • A value cannot include :.

Add custom disk tags while installing Portworx

While installing Portworx, specify the custom tags in the StorageCluster device spec:

cloudStorage:
deviceSpecs:
-type=<device-type>,size=<volume-size>,tags=<custom-tags>

For example:

tags=tenant:fin;bu:finance;env:prod

Run the following command to view all the custom tags assigned to a cloud-drive:

pxctl cloud-drive inspect --node <node-id> 

In the output, locate the Labels field:

Drive Set Configuration
Number of drives in the Drive Set: 1
NodeID: <node-id>
NodeIndex: 3
InstanceID: <instance-id>
Zone: us-central1-a
State: In Use
Labels: -

Drive 0
ID: <drive-id>
Type: <URL>
Size: 150 Gi
Iops: 0
Path: <drive-location>
Used for: data
Labels: apps=px,bu=eng
note

The Lables field displays custom tags that you specify in the pxctl sv drive add -s "type=<custom-tags>" command. For example, pxctl sv drive add -s "type=apps=px,bu=eng"

Add custom tags during pool expansion

You can also add custom tags when expanding the storage pool, using the following command:

pxctl sv drive add -s

For example:

pxctl sv drive add -s "type=pd-ssd,size=150,tags=apps:px;bu:eng"

Run the pxctl sv pool show command to display the added drive and its configuration. Then, run the pxctl cloud-drive inspect --node <drive-UUID> to view the specified custom tags. Example output for the above commands:

pxctl sv drive add -s "type=pd-ssd,size=150,tags=apps:px;bu:eng"
Drive add done

pxctl sv pool show
PX drive configuration:
Pool ID: 0
Type: Default
UUID: <UUID>
IO Priority: MEDIUM
Labels:
Size: 147 GiB
Status: Online
Has metadata: Yes
Balanced: Yes
Drives:
1: <drive1-location>, Total size 147 GiB, Online
Cache Drives:
No Cache drives found in this pool
Journal Device:
1: <drive1-location>, STORAGE_MEDIUM_SSD

pxctl cloud-drive inspect --node <node-id>
Drive Set Configuration
Number of drives in the Drive Set: 1
NodeID: <node-id>
NodeIndex: 3
InstanceID: <instance-id>
Zone: us-central1-a
State: In Use
Labels: -

Drive 0
ID: <drive-id>
Type: <URL>
Size: 150 Gi
Iops: 0
Path: <drive0-location>
Used for: data
Labels: apps=px,bu=eng
note

During pool expansion, following is the behavior of custom tags:

  • resize-drive option: the disk will continue to include existing custom disk tags.
  • add-drive option: the new disk will inherit common custom tags from existing disks of the storage pool.

Each individual data disk, kvdb disk, metadata disk, journal disk can have their own set of custom tags. Any node failures and subsequent node restarts does not have an impact on the custom tags.

Unsupported custom disk tag formats:

You cannot specify the following keys, Portworx reserves them for internal use.

  • name
  • pwx_cluster_id
  • pxtype
  • portworx.io/flasharray-name
  • portworx.io/flasharray-id
  • portworx.io/flasharray-management-endpoint
  • sc
Was this page helpful?