Dell EMC Unity UEMCLI Commands: Manage from the CLI - 夜莺博客

Dell EMC Unity UEMCLI Commands: Manage from the CLI

Dell EMC Unity arrays can be managed through the Unisphere GUI, the REST API or the Unisphere CLI (UEMCLI) — and for scripting, monitoring and quick diagnostics, UEMCLI is the fastest path. This guide covers everything from installing the CLI and enabling SSH to the object-path command syntax that makes uemcli so powerful, straight from the official Dell knowledge base article.

If you have ever clicked through Unisphere to answer a single question — how full is the pool, which host owns that LUN, did last night's snapshot run — UEMCLI is the answer. One command replaces a dozen clicks, and that same command drops into a monitoring check or a change script with no screen scraping. Everything Unisphere can do, the CLI can do, and the CLI is the only interface that scales past one array.

Getting UEMCLI: Install or Use SSH

Two methods: install the Unisphere CLI tool on your management station, or enable SSH on the array (Unisphere > System > Service > Service Tasks > Enable SSH) and run UEMCLI directly in the SSH session with the service account — no installation needed. Both require the management station to be on the same management network as the Storage Processors.

uemcli.exe -d 192.168.1.10 -u admin -p password /stor/config/pool show

The -d flag identifies the array by management address, -u and -p supply credentials, and everything after that is the object path plus the action. On Linux and macOS the binary is simply uemcli without the extension and the arguments are identical, so a script written against one platform ports to the others unchanged. The installers are published per platform on the Dell support site alongside the array firmware.

The SSH route is the one to remember for emergencies. When the Unisphere GUI is unresponsive or the management certificate is in a bad state, an SSH session to a storage processor still gives you a working UEMCLI — often enough to diagnose and recover the array without a service call. The SSH service is disabled by default and enabled per storage processor, so it is worth confirming both SPs have it available before you need it.

In production, keep credentials out of the command line. Anything passed with -p lands in shell history and in the output of ps, and it is visible to every other user on the host:

export UEMHOST=192.168.1.10
export UEMUSER=admin
uemcli -d "$UEMHOST" -u "$UEMUSER" -p "$UEMPASS" /stor/config/pool show

UEMCLI also accepts a password read from a file or an interactive prompt, which is the safer pattern for scheduled jobs and shared jump hosts.

Object-Path Syntax: The Key to UEMCLI

Every UEMCLI command needs an object path plus an action. To display storage pools:

uemcli /stor/config/pool show

/stor/config/pool is the object path; show is the action applied to all objects under that path. Discover the hierarchy with uemcli / --help (all object paths) and drill into actions with uemcli <object path> --help. Everything — pools, LUNs, hosts, snapshots, replication — follows the same pattern, which makes it trivial to script.

The useful mental model is a virtual filesystem that mirrors the GUI. /stor is block storage, /stor/config holds pools and RAID groups, /stor/prov holds provisioning objects such as LUNs, consistency groups and file systems, /remote covers replication sessions and interfaces, /net covers network interfaces, routes and NAS servers, and /sys covers system-level settings. Within any directory, show lists everything underneath it, and appending an ID targets a single object:

uemcli /stor/config/pool show -detail
uemcli /stor/config/pool/pool_1 show
uemcli /stor/prov/luns/lun show -detail
uemcli /stor/prov/luns/lun/lun_12 show

IDs are the other half of the trick. Every object returned by show carries an identifier of the form pool_1, lun_12 or host_3, and that ID is accepted anywhere the object is expected. Capture it once in a script and every subsequent command can be built from it rather than from a name that a human might rename next week.

Adding -detail to any show expands the output from the summary columns to every attribute the object has. When you are unsure which field you need, start with -detail and narrow afterwards.

Filters, Output Formats and Batch Scripting

Default output is a readable table meant for humans. For automation you want structured output plus server-side filtering so you never parse text that changes shape between firmware releases:

uemcli -d 192.168.1.10 -u admin /stor/config/pool show -output csv
uemcli /stor/config/pool show -filter "name=Pool00"
uemcli /stor/prov/luns/lun show -output csv -filter "pool=pool_1"
uemcli /sys/general show -output json

-output accepts csv, tab, xml and json depending on release, all of which are far friendlier to downstream tooling than the default table. -filter takes a field, an operator and a value; it is evaluated by the array, so a pool with ten thousand LUNs returns only the ones you asked for instead of transferring the whole inventory.

Because every object follows the same contract, a polling script is short and has no vendor-specific parsing in it:

#!/bin/bash
ARRAY=192.168.1.10
uemcli -d "$ARRAY" -u monitor -p "$UEMPASS" \
  /stor/config/pool show -output csv |
while IFS= read -r line; do
  echo "$(date -Is) pool: $line"
done

Redirect that to a log file and you have a pool-utilization history that took ten minutes to build and needs no agent on the array. The same skeleton works for LUN inventory, host lists, snapshot schedules and replication state — only the object path changes.

Everyday Commands Worth Memorizing

These cover the questions that arrive most often in a Unity environment:

uemcli /stor/config/pool show -detail
uemcli /stor/prov/luns/lun show
uemcli /stor/prov/luns/group show
uemcli /remote/host show -detail
uemcli /stor/prov/fs show
uemcli /stor/config/ssd show
uemcli /sys/general show
uemcli /sys/alert show

The alert command in particular deserves a place in daily operations: it returns the array's current fault list in a form that is easy to grep and easy to forward to a ticketing system, without anyone logging into Unisphere to read it.

Common UEMCLI Errors and What They Mean

Most failures fall into three buckets, and each is diagnosable from the message alone. A connection or timeout error means the management station cannot reach the storage processor — check the management VLAN, the route, and whether the SP has failed over. An authentication error means the account is locked, the password has expired, or you are using a local account that does not exist on the peer SP. An "object not found" error means the path is valid but the ID or name you passed is wrong, which usually happens when a script caches an ID from an array that has since been re-provisioned.

One behavior catches people out: UEMCLI connects to a single storage processor, so if that SP is rebooting or in a failed-over state, commands fail even though the array is healthy. The array's management address follows the owner SP, which is why a script that worked yesterday can fail during a non-disruptive upgrade window. Retrying after the SP comes back is normally all that is required.

Reading the Output: The Fields That Matter

Three fields in /stor/config/pool show -detail answer the questions that actually get asked. Size is the raw capacity; Size Used is what thin provisioning has actually consumed; and Subscribed is the total capacity that has been handed to LUNs, which can exceed the physical size in a thin-provisioned design. A pool is only in trouble when Size Used approaches Size, not when Subscribed does. Confusing the two produces unnecessary capacity purchases and, occasionally, an outage nobody planned for.

For LUNs, watch the Health and SP columns. A LUN owned by an SP that is currently failed over will still report a name and a size while refusing to serve I/O, and the CLI shows that state before the GUI usually surfaces it. Polling these fields on a schedule turns a class of surprise incidents into a graph.

Automation and Scripting Patterns

Because the syntax is uniform, UEMCLI slides into shell scripts and cron jobs: collect pool utilization every hour, export host inventory, or trigger snapshot creation before maintenance. Pair it with Dell PowerStore best practices for a broader Dell storage strategy, and review 3PAR health-check workflows for a vendor-neutral comparison of storage CLI triage.

Three habits make UEMCLI automation survivable. First, always pin the array with -d rather than relying on a default, so a script can never run against the wrong system. Second, prefer -output csv over scraping the human table, because column widths change between releases. Third, check the exit code: UEMCLI returns a non-zero status on failure, which is far more reliable than grepping for the word "error" in a localized message.

if ! uemcli -d "$ARRAY" -u admin /stor/config/pool show -output csv > /tmp/pools.csv; then
  echo "UEMCLI query failed, check connectivity to $ARRAY" >&2
  exit 1
fi

Treat the CLI as a read-only tool until you are comfortable with it. Every show is safe, but create, set and delete act immediately on a live array with no confirmation prompt — there is no equivalent of a diff or a dry run. The safe production pattern is to build the command in a lab, verify the object path with --help, and only then run it against the array, capturing the output for change records.

Where UEMCLI Fits Beside the REST API

Unity exposes a REST API on the same management address, and UEMCLI is effectively a wrapper around it. Use the CLI when a human or a shell script is driving; use the API directly when a configuration-management tool or an application is doing the work and needs long-lived sessions, structured JSON and proper error semantics. Both reach the same objects, so the object-path vocabulary you learn for UEMCLI transfers straight across to API URLs. Storage-side context for planning either integration is in our FC versus iSCSI SAN comparison and the ONTAP network configuration best practices, which mirror the management-interface considerations on Unity almost one for one.

原文链接:https://www.dell.com/support/kbdoc/en-us/000205901/dell-emc-unity-how-to-use-unisphere-cli-uemcli-commands