2

Is there a robust way of scripting (Unix shell) lun provisioning for an EMC Clariion? Navicli doesn't look very reliable, its output is not easy to parse (and just plain weird), and it does not look like it returns useful error codes.

I want something I could use like LVM, if that exists, e.g.:

if ! lvcreate -n $lunname -L $size $volumegroup 
then
    echo "Failed" >&2
    exit 1
fi

A consultant told me that EMC writes terrible software on purpose so that they can sell very expensive add-ons, but I can not believe it's true.

niXar
  • 2,043
  • 17
  • 23

2 Answers2

2

In this case, an interactive command automation tool like expect, expect-list, or pexpect might be the way to go. They can tame even the worst command line tools, including ones that require interactive input.

Alternately, you can use the old run but verify method - Run the command, then run a followup to verify creation of the LUN.

Paul Doom
  • 841
  • 6
  • 9
  • That's not necessary, the tool naviseccli can be used directly, even though it sucks. – niXar Mar 28 '11 at 10:57
  • I thought you needed to parse output, hence the suggestion. Yes, that is an ugly command line! Good work :) – Paul Doom Mar 29 '11 at 03:23
0

I finally managed to naviseccli to kind of do what I wanted:

/opt/Navisphere/bin/naviseccli -User "$user" -Password "$password" -Scope 0 \
    -Address "yoursan.example.com" \
    lun -create -capacity 50 -sq gb -poolName "$storagePoolName" -sp a \
    -name "$lunname"

... to create a 50 GB lun.

niXar
  • 2,043
  • 17
  • 23