« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
XML

Neat blogs

Navigation

Editing

Powered by Roller Weblogger.

statcounter.com

clustrmaps.com

Locations of visitors to this page

technorati.com

20090308 Sunday March 08, 2009
Taking the simulator out for a run

Okay, I took the Sun Unified Storage Simulator out for a light walk the other day. And I made sure to avoid the documentation. Now I want to see what I can do with the documentation!

Fun Fact #1: Did you know that the CLI supports tab completion? Way cool.

So, what do I need to do to see all of the network interfaces?

snarky:> configuration
snarky:configuration> net
snarky:configuration net> interfaces show
Interfaces:

  INTERFACE STATE  CLASS LINKS       ADDRS                  LABEL
    e1000g0 up     ip    e1000g0     192.168.111.128/24     Untitled Interface
    e1000g1 up     ip    e1000g1     192.168.2.139/24       outbound

Too long, can we do better?

snarky:> configuration net interfaces show
Interfaces:

  INTERFACE STATE  CLASS LINKS       ADDRS                  LABEL
    e1000g0 up     ip    e1000g0     192.168.111.128/24     Untitled Interface
    e1000g1 up     ip    e1000g1     192.168.2.139/24       outbound

I tried to do this with slashes first, like a path, but I should have known better because we use a 'show' command, not a 'dir' like in the LOM interfaces.

Now, we get to see some of the power of this CLI! First, we can add ssh keys.

snarky:> configuration preferences keys
snarky:configuration preferences keys>

I was able to tab complete my way with each sub-context.

snarky:configuration preferences keys> create
snarky:configuration preferences key (uncommitted)> set type=DSA
                          type = DSA (uncommitted)
snarky:configuration preferences key (uncommitted)> set key="copy from your id_dsa.pub"
                           key = copy from your id_dsa.pub (uncommitted)
snarky:configuration preferences key (uncommitted)> set comment="thud-key1"
                       comment = thud-key1 (uncommitted)
snarky:configuration preferences key (uncommitted)> commit
error: An unanticipated system error occurred: Illegal character in key: ' '

This may be due to transient failure, or a software defect. If this problem
persists, contact your service provider.
snarky:configuration preferences key (uncommitted)> set key="copy-from-your-id_dsa.pub"
                           key = copy-from-your-id_dsa.pub (uncommitted)
snarky:configuration preferences key (uncommitted)> commit

The CLI will deny a command if it has invalid input. This feature really drove me to understand what was going on.

Anyway, the biggest stumbling block I had here was in what went into the 'key' property. Sometimes I am guilty of being too terse and connecting all of the dots in my head. I think the documentation here has done that as well. I really worked my way around the CLI and the BUI (Browser User Interface) trying to figure this one out. Along the way, I found that as I learned the CLI interface, the BUI interface started to make more sense. And that in turn made the CLI more natural. I liked the positive feedback loop here.

The BUI finally clued me in on what to do here:

ssh public key

I needed to be entering the contents of my 'id_dsa.pub' file, which I previously I had generated with 'ssh-keygen'. Once I figured that out, and that it was easier to enter with the CLI (using a browser to add a long key is normally error prone because of automatic insertion of spaces), I was good to go:

[thud@adept ~]> ssh root@snarky configuration net interfaces show
Interfaces:

  INTERFACE STATE  CLASS LINKS       ADDRS                  LABEL
    e1000g0 up     ip    e1000g0     192.168.111.128/24     Untitled Interface
    e1000g1 up     ip    e1000g1     192.168.2.139/24       outbound

And now, can I do the shares?

[thud@adept ~]> ssh root@snarky shares select default select jaloppy get sharenfs
                      sharenfs = rw,anon=braves,root=pseries.internal.excfb.com:adept.internal.excfb.com

I struggled for a bit on how to chain the 'select', I wanted to do something like a shell script '(cd dir1; ..)', but I did find this shining example on how to automate ssh scripts to our boxes: Snapshots with PostgreSQL and Sun Storage 7000 Unified Storage Systems.

I'll save for another day creating a script to drill down and get all of the NFS shares from a Sun Storage 7000 Unified Storage Systems.

The CLI for the Sun Storage 7000 Unified Storage System actually blows away my experience with the NetApp CLI!

  1. There is no telnet access - you have to use ssh.
  2. Command structure for CLI matches that for the BUI - learn one and the other will follow.
  3. The 'help' command is always available and always context sensitive.
  4. Stringing together complex commands is as easy as removing line returns. I.e., don't hit enter, just keep on typing!

Originally posted on Kool Aid Served Daily
Copyright (C) 2009, Kool Aid Served Daily

Trackback URL: http://blogs.sun.com/tdh/entry/taking_the_simulator_out_for
Comments:

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed