Whether you are new to XtremIO or a community expert, this guide is for you! With the introduction of 4.0 code, the EMC XtremIO team introduced a new concept to manage your inventory called tagging. For those with prior 4.0 code experience, this new tagging feature replaces the folders for management concept and provides for more robust inventory management and reporting.
I worked with a customer recently who has well over 200+ volumes that were not tagged or grouped in any way. The ask of me was, how do they tag in bulk via CLI to accomplish this? This is fairly easy, but it does require a bit of trial and error as the XtremIO CLI does not provide code syntax examples as you may be familiar with on the VNX or other EMC storage arrays.
First, we need to define what we want to tag (volumes, initiator groups, etc.) Next, we see how the CLI structure/syntax is for tagging by simply issuing the create-tag command.
xmcli (admin)> create-tag
Description: Creates a new Tag object.
Usage: create-tag property=value listPROPERTY |MANDATORY |DESCRIPTION |VALUE
======== |========= |=========== |==================
entity |Yes |Entity |string
tag-name |Yes |Tag Name |full path tag name
Next, we need to see how do we declare a volume tag or an initiator group tag as the above shows us that the tag “entity” is a string value. To show you this, I did not complete the command and I used an incorrect string value of “volumes”.
xmcli (admin)> create-tag entity=”volumes”
Description: Creates a new Tag object.
Usage: create-tag property=value listPROPERTY |MANDATORY |DESCRIPTION |VALUE
======== |========= |=========== |==================
entity |Yes |Entity |string
tag-name |Yes |Tag Name |full path tag name** Error: Command Syntax Error: entity property must have one of the following values: [InfinibandSwitch, DAE, Initiator, BatteryBackupUnit, Scheduler, StorageController, DataProtectionGroup, X-Brick, Volume, Cluster, InitiatorGroup, SSD, SnapshotSet, ConsistencyGroup, Target]
Now, we are cooking with gas and have something work with here. I want to create a nested volume tag that is something like this: VMware ESXi Hosts > Production Cluster
The nested volume tag will help me to filter based on my VMware hosts to see all hosts and also I can group them by their VMware cluster name as well. The environment I am managing is a mixture of VMware ESXi, RHEL, and AIX so this nested tag is extremely helpful with this. Now, let’s create our tag.
xmcli (admin)> create-tag entity=”Volume” tag-name=”IBM AIX Hosts/Oracle”
Created Tag /Volume/IBM AIX Hosts/Oraclexmcli (admin)> create-tag entity=”Volume” tag-name=”VMware ESXi Hosts/Boot LUNs”
Created Tag /Volume/VMware ESXi Hosts/Boot LUNs
Now, I am ready to tag my volumes in bulk. I took a show-volumes dump from the XtremIO CLI, saved it to a text file, and imported it into Excel as text data fixed width. Using the volumes column and some Excel CONCATENATE magic, I have my script ready to tag all my volumes in bulk.
tag-object entity=”Volume” entity-details=”ATLNNAVPESXIP01_BOOT” tag-id=”/Volume/VMware ESXi Hosts/Boot LUNs”
As you will find out, the CLI isn’t exactly helpful with how the syntax should be. Think of tags like folders within a unix directory (the XMS is centOS after all).
I hope this has proved to be somewhat useful to you as I noticed that XtremIO CLI syntax questions is often a hot topic within the EMC Communities forum.