Tuesday Dec 23, 2008

Scripting storage (amber road aka fishworks)

Most people have taken the next two weeks off; I've decided to get a few things done that I don't get a chance to do... Like working with new hardware, trying out some software development, etc.

I recently got several Amber Road (fishworks) boxes, and I've developed a couple of rather simplistic (crude) scripts just to understand the capabilities of the boxes.

It's pretty amazing; with very little documentation, I hacked out a couple of rather useful scripts. One creates a new project, one creates a LUN in a given project and hands back the IQN (iSCSI Qualified Name). I was working on another to clone a LUN and drop it in another project.

Why you ask? Well, we're beginning to shift to using xVM for some of our hosting projects. xVM gives us the ability to dynamically move between front ends, expand the footprint for a particular app, etc. And running all this off iscsi based on ZFS really makes sense. We can install once, make a "gold master" and then just clone that as many times as we want. Really fast, really easy and efficient use of disk.

So, for your edification, two simple scripts for amber road. Use them at your own risk; I don't guarantee that they work on anything other than my own personal machine.

create-project.ksh
#!/usr/bin/ksh
#
# Create a project named $1
#
SERVER="root@amberroad.yourdomain.com"

if [ x"$1" = x ]; then
	echo "ERROR: You must specify a project name"
	exit 1
fi

#
# create the project with the defaults
# 	set shareiscsi=on
#	set sharenfs=off
#

ssh -T $SERVER <<EOF
script
	try {
		run('shares project $1');
	} catch (err) {
		if (err.code == EAKSH_NAS_BADPROJECTNAME) {
			printf('Error! "$1" is an invalid project name!\\n');
			exit(1);
		}
		if (err.code == EAKSH_ENTITY_EXISTS) {
			printf('Error! "$1" already exists!\\n');
			exit(1);
		}
		throw(err);
	}
	run('set shareiscsi=on');
	run('set sharenfs=off');
	run('commit');
EOF


ssh -T $SERVER <<EOF
script
	run('shares');
	projects = list();
	printf("Projects:\\n");
	for (i=0; i<projects.length; i++) {
		printf("\\t%s\\n", projects[i]);
	}
EOF

And the other script - create a LUN in a project for use as iscsi target

create-lun.ksh
#!/usr/bin/ksh
#
# Create a LUN in a given PROJECT
# USAGE: create-lun.ksh   []
#
SERVER="root@amberroad.yourdomain.com"

if [ x"$1" = x ]; then
	echo "Invalid argument!"
	echo "usage: $0   []"
	exit 1
fi
if [ x"$2" = x ]; then
	echo "Invalid argument!"
	echo "usage: $0   []"
	exit 1
fi
if [ x"$3" = x ]; then
	SIZE="1G"
else
	SIZE="$3G"
fi
echo "Creating LUN $2 in PROJECT $1 of size $SIZE"

ssh -T $SERVER <<EOF
script
	run('shares select $1');
	try {
		run('lun $2');
	} catch (err) {
		if (err.code == EAKSH_NAS_BADLUNNAME) {
			printf("%s: bad LUN name\\n", $2);
			exit(1);
		} 
		if (err.code == EAKSH_NAS_LUNEXISTS) {
			printf('Error! "$2" already exists!\\n');
			exit(1);
		}
		if (err.code == EAKSH_ENTITY_BADSELECT) {
			printf('Error! "PROJECT $1 is invalid!\\n');
			exit(1);
		}
		throw(err);
	}
	run('set volsize=$SIZE');
	run('set sparse=true');
	run('commit');
EOF

echo "Created $2 ($SIZE) in $1"
# don't know why it takes a while to assign an IQN, but if you don't wait you get an error!
echo "Waiting for IQN to be assigned..."
sleep 10
ssh -T $SERVER <<EOF
script
	run('shares select $1');
	run('select $2');
	printf("IQN: %s\\n", get('iqn'));
	run ('cd ../../..');
EOF

        
    

Thursday Nov 13, 2008

First Look at Amber Road (Sun 7000 unified storage system)

I received two amber road (Sun 7000 Unified Storage Systems) today and hooked them up in record time. I can't begin to tell you how impressive the install was. Simple, to the point, minimum necessary to get the boxes running and it \*just worked\*.


I've installed lots of different kinds of hardware here at Sun - and frankly this was almost un-Sun like in it's simplicity. Don't confuse folks, don't make it hard. Default to the right thing. 5 minutes and I have a usable \*system\*.


Stunning. And the performance from the tests I've run is just incredible. I thought I made a mistake in my calculations, and no, it was \*that freaking fast\*.


If you've not had the pleasure, take the time and try out the box. What can you lose other than a few hours trying out some really great hardware and software - it is after all Fully Integrated Software and Hardware (fishworks!)



Monday Nov 10, 2008

Sun Storage 7000 Unified Storage Systems...

Wow, that's a mouthful - Sun's naming alone should scare you off. Ok, if you're not scared off, let me tell you a little story about the 7000 series storage devices. I like the name Amber Road better, but I like Fishworks even better. Gah. If you can figure out our naming, then good for you!


I've known about the 7000 series for a while now - and my staff have seen demos from  Bryan Cantrill. It was a great idea then, and now you get to see it too. I've had access to demo systems for the past week, and my devices start landing this week - frankly my staff and I can't wait (you know I'm a hardware junkie, right?)


So there are many good reasons why the 7000 series is cool - the integrated flash devices, the hardware itself, blah, blah blah. Here's the amazing part - the hardware isn't even the coolest feature. It's the software. The ability to \*in real time\* drop in new tracing events to see what's really happening on the device is just unbelievable.


How many times have you seen your NAS devices suddenly "go slow"? And you have \*no clue\* as to why. I can tell you it happens often when running big infrastructure. You dig around for a while and maybe you can figure out that it's one machine and if you're particularly good you can figure out one user on one machine and slap their hands. With the 7000 you get the ability in real time to dig into whats being done using which protocol by user, by file, but whatever you want. It's stunning to see, and incredibly useful in managing the infrastructure. For a mostly detailed overview of the capabilities, check out Bryan Cantrill's presentation on analytics.


I'm deploying 7000 series boxes into my infrastructure next week - and I can't wait. It's great kit, but it's even \*better\* software.


So check out the 7000 series storage systems. Heck, Try 'em out - what have you got to lose - they're \*free\* to try!



About

I run the engineering group responsible for Sun.com and the high volume websites at Sun.

Will Snow
Sr. Engineering Director

Search

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