Wednesday, May 22, 2013

cli to test internet speed, no flash needed

Never have to use flash to test your net speed, this one is simple and awesome.

Many thanks to @Sivel

First clone it:
[James-Cuffs-MacBook-Pro]$ git clone https://github.com/sivel/speedtest-cli.git
Cloning into 'speedtest-cli'...
remote: Counting objects: 106, done.
remote: Compressing objects: 100% (68/68), done.
remote: Total 106 (delta 50), reused 91 (delta 38)
Receiving objects: 100% (106/106), 24.50 KiB, done.
Resolving deltas: 100% (50/50), done.

Run it...
[James-Cuffs-MacBook-Pro]$ cd speedtest-cli/ && ./speedtest-cli
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from Verizon FiOS (173.x.x.x)...
Selecting best server based on ping...

Results! Look Ma - no Flash!
Hosted by Towerstream (Boston, MA) [9.58 km]: 64.135 ms

Testing download speed.................................
Download: 57.00 Mbit/s

Testing upload speed...................................
Upload: 30.27 Mbit/s

And that my friend is all she wrote...

Saturday, May 4, 2013

BREW up a cup of IRSSI... it really is that easy!

This post inspired by:

MacPorts is fun, but BREW is even more fun!

I wanted to restart my old IRSSI spell check script tonight to catch up with some old pals on a number of IRC servers. It is never cool to have spell check issues while typing away on IRC, and I remembered back in the day I wrote what I thought was a small one liner - see below for how you can teach IRSSI to catch typoes and assorted beverage errors with the tab key. But, anyway, I was on OSX, so I needed to poke around with pkg management some...

First up BREW:

bash-3.2$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1

Now to take a look at IRSSI:

http://graphicgraffiti.com.au/blog/2012/installing-irssi-with-proxy-on-mac-os-x/

bash-3.2$ brew install irssi --with-perl=yes --with-proxy
==> Downloading http://irssi.org/files/irssi-0.8.15.tar.bz2
######################################################################## 100.0%
==> Patching
patching file configure
Hunk #1 succeeded at 14050 (offset -13369 lines).
Hunk #2 succeeded at 14068 with fuzz 2 (offset -13369 lines).
patching file docs/irssi.1
==> ./configure --prefix=/usr/local/Cellar/irssi/0.8.15 --sysconfdir=/usr/local/etc --with-bot --with-proxy --
==> make
==> make install
/usr/local/Cellar/irssi/0.8.15: 288 files, 4.6M, built in 28 seconds

Oops! I hit up an issue with CPAN on OSX, which really slowed me down!
cpan[1]> o conf urllist unshift http://www.cpan.org
Please use 'o conf commit' to make the config permanent!

cpan[2]> o conf commit
commit: wrote '/System/Library/Perl/5.12/CPAN/Config.pm'

cpan[3]> install Bundle::CPAN
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
Reading '/var/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with LWP:
http://www.cpan.org/modules/02packages.details.txt.gz
Reading '/var/root/.cpan/sources/modules/02packages.details.txt.gz'
  Database was generated on Sun, 05 May 2013 00:07:17 GMT
............................................................................DONE
Fetching with LWP:
http://www.cpan.o

(MUCH, MUCH, MUCH SNIPPAGE LATER)

Phew all set! now we can finally get to:
cpan[5]> i /aspell/
Distribution    HANK/Text-Aspell-0.09.tar.gz
Module  < Meta::Tool::Aspell     (VELTZER/Meta-0.08.tar.gz)
Module  < Pod::Spelling::Aspell  (LGODDARD/Pod-Spelling-0.17.tar.gz)
Module  < Text::Aspell           (HANK/Text-Aspell-0.09.tar.gz)
4 items found                                                            

And then finally my old irssi script works:
/load spell.pl
22:51 -!- Irssi: Loaded script spell

Woot!

Here is the IRSSI script if you fancy tab complete spell check...
cat spell.pl 
# Usage:
# /load spell.pl
# 23:19 -!- Irssi: Loaded script spell

# As you type, if you hit *tab* it will complete the current word
# with the best suggestion, and print the top 5 matches in the 
# scroll buffer

use strict;
use vars qw($VERSION %IRSSI);
use Text::Aspell;
use Irssi;

$VERSION = '1.00';
%IRSSI = (
 authors     => 'core',
 contact     => 'core',
 name        => 'aspell spell check',
 description => 'spell checker',
 license     => 'Public Domain',
);

my $speller = Text::Aspell->new;

Irssi::signal_add_last 'complete word' => \&spell;

sub spell {
 my $out = "";
 my ($complist, $window, $word, $linestart, $want_space) = @_;
  if (!$speller->check($word)){
   my @suggestions = $speller->suggest($word);
    if (@suggestions){
    push @$complist, $suggestions[0];
    for (my $i=0;$i<8 data-blogger-escaped-.="" data-blogger-escaped-i="" data-blogger-escaped-out="" data-blogger-escaped-window-="">print("$out");
   }
  }
}

Saturday, April 27, 2013

openstack day - live blog...

Today some pals got together to play with openstack and generally hang out and have some nerdy fun. For those in the tl;dr crowd, I've put a summary of what we learned today right here. For brave souls feel free to read on, should also be hilarious for those that actually know what they are doing!

Things we learned today

- DevStack is awesome for single use single box dev
- Fedora16 images seem to be a bit busted
- Tim never backs up his shit ;-)
- PackStack for RHEL is pretty rad!
- PackStack does some sweet things with Puppet.
- We had our best luck with RHEL6.4, but that's because Tim was here! ;-)
- DNS it turns out is rather important
- Networking is hard
- Dominos build your own artisan pizza is teh epic!
- VMWare Fusion migration to VirtualBox is cake
- Ethernet name problems in Linux now look like Windows .reg hacks
- If we knew what we were doing we would be really dangerous!
- n+2 seems to be a bit of an issue
- You probably need trained professionals to help you!
- This thing called EC2 is actually pretty rad... #someoneelseproblem ;-)


12:25pm
Off we go... #openstackday starting at the crack of 12:30pm!


You can follow along with Tim here:

http://personalskynet.blogspot.com/2013/04/dr-openstack-or-how-i-learned-to-stop.html

I'm doing the Ubuntu track, Tim is on REL64, and Michele is on the Fedora style.

First up:

http://devstack.org/guides/single-vm.html

In theory this should all be simple enough... right?
#!/bin/sh
apt-get update
apt-get install -qqy git
git clone https://github.com/openstack-dev/devstack.git
cd devstack
echo ADMIN_PASSWORD=letmein > localrc
echo MYSQL_PASSWORD=letmein >> localrc
echo RABBIT_PASSWORD=letmein >> localrc
echo SERVICE_PASSWORD=letmein >> localrc
echo SERVICE_TOKEN=letmein >> localrc
./stack.sh

Rotroh!
top - 12:38:35 up 13 min,  4 users,  load average: 2.51, 2.92, 1.80
Tasks: 245 total,   1 running, 244 sleeping,   0 stopped,   0 zombie
%Cpu(s): 18.6 us, 32.4 sy,  0.0 ni, 45.1 id,  1.0 wa,  0.0 hi,  2.9 si,  0.0 st
KiB Mem:   1026896 total,   862920 used,   163976 free,    41364 buffers
KiB Swap:   522236 total,    55080 used,   467156 free,   144960 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND           
28145 rabbitmq  20   0 98.2m  22m 2204 S 249.4  2.2   0:02.93 beam.smp     

Looks like this is the problem...

http://lzone.de/Solving+100%25+CPU+usage+of+Chef

And sure enough...
jcuff@jcuff-virtualbox:/opt/stack$ sudo rabbitmqctl report | grep -A3 file_descriptors
 {file_descriptors,[{total_limit,924},
                    {total_used,924},
                    {sockets_limit,829},
                    {sockets_used,19}]},


jcuff@jcuff-virtualbox:/opt/stack$ sudo su -
root@jcuff-virtualbox:~# ulimit -n 10000
root@jcuff-virtualbox:~# /etc/init.d/rabbitmq-server restart
 * Restarting message broker rabbitmq-server                             [ OK ] 

root@jcuff-virtualbox:~# rabbitmqctl report | grep -A3 file_descriptors
 {file_descriptors,[{total_limit,9900},
                    {total_used,1033},
                    {sockets_limit,8908},
                    {sockets_used,7}]},

Then we got stuck here:
stack 31892 0.0 0.1 5216 1396 pts/2 S+ 12:44 0:00 bash
/opt/stack/devstack/tools/create_userrc.sh -PA --target-dir /opt/stack/devstack/accrc

Killed the process, tried to restart ./stack.sh... oops!



Ok clearly time for a new VM... this time I'm going to snapshot it before I start playing with ./stack.sh, as this vm has been seriously scribbled on :-)

Back later, once I make a new VM... doh! Pretty much everything was wrong with this setup!

1:08pm


Starting over again with 12.04.2 LTS 64bit Server version, and this time with enough disk space :-) So glad we have an epic fast network connection here, and this SSD drive on the laptop sure is helping out a lot!

1:22pm

Ok, new VM base created, I'm going to freeze this one so I don't ever have to do that part of the shenanigans again, if there are openstack folks looking on at this as we go try not to laugh too much, thus far it's all been a bit of a string of self inflicted PBKAC issues :-)
[James-Cuffs-MacBook-Pro]$ cd /Users/jcuff/VirtualBox\ VMs/
[James-Cuffs-MacBook-Pro]$ ls -ltra
total 0
drwx--x---+ 111 jcuff  staff  3774 Apr 26 14:05 ..
drwxr-xr-x    7 jcuff  staff   238 Apr 27 13:14 Ubuntu
drwxr-xr-x    4 jcuff  staff   136 Apr 27 13:14 .
drwxr-xr-x    6 jcuff  staff   204 Apr 27 13:25 OpenStack
[James-Cuffs-MacBook-Pro]$ du -sh OpenStack/
1.6G OpenStack/
[James-Cuffs-MacBook-Pro]$ cp -r OpenStack/ OpenStack.Golden
[James-Cuffs-MacBook-Pro]$ 

Ok, so that's going to help, not have to revisit that one! Time for a quick break, before going at stack.sh again :-) Ok, off we go again!

1:32pm
jcuff@openstack:~$ git clone git://github.com/openstack-dev/devstack.git
Cloning into 'devstack'...
remote: Counting objects: 9763, done.
remote: Compressing objects: 100% (3366/3366), done.
remote: Total 9763 (delta 6804), reused 9151 (delta 6305)
Receiving objects: 100% (9763/9763), 1.71 MiB | 2.12 MiB/s, done.
Resolving deltas: 100% (6804/6804), done.
jcuff@openstack:~$ cd devstack/
jcuff@openstack:~/devstack$ ./stack.sh

Good news, no 200% rabbitmq this time, that's great. So far so good! Lots of downloading to do now, may need another snapshot if this round of ./stack.sh succeeds.

Oh snap! Wrong MYSQL password... Doh!
An unexpected error prevented the server from fulfilling your request. (OperationalError) (1045, "Access denied for user 'root'@'localhost' (using password: YES)") None None (HTTP 500)
+ KEYSTONE_SERVICE=
Here we go again...
jcuff@openstack:~/devstack$ ./stack.sh
You are already running a stack.sh session.
To rejoin this session type 'screen -x stack'.
To destroy this session, type './unstack.sh'.

jcuff@openstack:~/devstack$ ./unstack.sh
* Stopping web server apache2
Volume group "stack-volumes" not found
Skipping volume group stack-volumes
Ok time to edit: jcuff@openstack:~/devstack$ vi localrc

And try again!

Holy shit! It worked!

1:46pm
Horizon is now available at http://10.0.1.12/
Keystone is serving at http://10.0.1.12:5000/v2.0/
Examples on using novaclient command line is in exercise.sh
The default users are: admin and demo
The password: letmein
This is your host ip: 10.0.1.12
stack.sh completed in 112 seconds.


Time for a well deserved cup of tea before the next steps!

Tea made, first image launched!!


Yup all good:
jcuff@openstack:~/devstack$ ssh cirros@10.0.0.2
cirros@10.0.0.2's password:

$ uname -a
Linux cirros 3.2.0-37-virtual #58-Ubuntu SMP Thu Jan 24 15:48:03 UTC 2013 x86_64 GNU/Linux

$ uptime
11:58:17 up 6 min, 2 users, load average: 0.07, 0.04, 0.03

$ cat /proc/meminfo | grep Mem
MemTotal: 503520 kB
MemFree: 473728 kB

$ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 2
model name : QEMU Virtual CPU version 1.0
stepping : 3
cpu MHz : 2212.096
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 4
wp : yes
flags : fpu pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm up nopl pni cx16 popcnt hypervisor lahf_lm svm abm sse4a
bogomips : 4424.19
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:

$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr FA:16:3E:18:60:30
inet addr:10.0.0.2 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::f816:3eff:fe18:6030/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1153 errors:0 dropped:0 overruns:0 frame:0
TX packets:699 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:118307 (115.5 KiB) TX bytes:116076 (113.3 KiB)

$ hostname
cirros

2:20pm

Ok, time to snap this install again... oh my have we grown!
jcuff@openstack:~/devstack$ sudo shutdown -h now

Broadcast message from jcuff@openstack
(/dev/pts/1) at 14:18 ...

The system is going down for halt NOW!
jcuff@openstack:~/devstack$ Connection to 10.0.1.12 closed by remote host.
Connection to 10.0.1.12 closed.

[James-Cuffs-MacBook-Pro]$ pwd
/Users/jcuff/VirtualBox VMs
[James-Cuffs-MacBook-Pro]$ rm -rf OpenStack.Golden/

[James-Cuffs-MacBook-Pro]$ time cp -r OpenStack/ OpenStack.Golden

real 0m20.886s
user 0m0.007s
sys 0m3.656s

[James-Cuffs-MacBook-Pro]$ du -sh OpenStack.Golden/
3.0G OpenStack.Golden/

Sure was a whole lot easier than the folsom guide looks!

https://github.com/mseknibilel/OpenStack-Folsom-Install-guide/blob/master/OpenStack_Folsom_Install_Guide_WebVersion.rst

Tim has also had success!

2:53pm
Sure is a whole lot going on in here!
/usr/bin/qemu-system-x86_64

-S 
-M pc-1.0 
-no-kvm 
-m 512 
-smp 1,sockets=1,cores=1,threads=1 
-name instance-00000001 
-uuid c9c91966-e460-4131-bcf8-9e830c7854f8

-smbios type=1,manufacturer=OpenStack Foundation,product=OpenStack Nova,version=2013.2,serial=245343e1-c87c-4c83-a08a-26bbd6d2756a,uuid=c9c91966-e460-4131-bcf8-9e830c7854f8 
-nodefconfig 
-nodefaults 
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/instance-00000001.monitor,server,nowait 
-mon chardev=charmonitor,id=monitor,mode=control 
-rtc base=utc 
-no-shutdown 

-kernel /opt/stack/data/nova/instances/c9c91966-e460-4131-bcf8-9e830c7854f8/kernel 
-initrd /opt/stack/data/nova/instances/c9c91966-e460-4131-bcf8-9e830c7854f8/ramdisk 
-append root=/dev/vda console=ttyS0 

-drive file=/dev/disk/by-path/ip-10.0.1.12:3260-iscsi-iqn.2010-10.org.openstack:volume-bc1a9e79-cf0d-4efe-9fe3-95da882f0277-lun-1,if=none,id=drive-virtio-disk0,format=raw,serial=bc1a9e79-cf0d-4efe-9fe3-95da882f0277,cache=none 

-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,fd=18,id=hostnet0 

-device virtio-net-pci,netdev=hostnet0,id=net0,mac=fa:16:3e:71:bb:de,bus=pci.0,addr=0x3 

-chardev file,id=charserial0,path=/opt/stack/data/nova/instances/c9c91966-e460-4131-bcf8-9e830c7854f8/console.log -device isa-serial,chardev=charserial0,id=serial0 -chardev pty,id=charserial1 -device isa-serial,chardev=charserial1,id=serial1 

-usb 
-device usb-tablet,id=input0 
-vnc 127.0.0.1:0 
-k en-us 
-vga cirrus 
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

But that's cake compared to the database structure we need ;-)
for i in cinder keystone glance nove ; do echo "show tables"|mysql -u root -pxxxxxx $i; done |wc -l

159

Some folks seemed to be concerned with HA. We will leave that for another day!

Anyhoo - now a fancy one, with new ssh keypairs working... look mom, no passwords!
jcuff@openstack:~/devstack$ ssh cirros@10.0.0.2
$ uname -a
Linux cirros 3.2.0-37-virtual #58-Ubuntu SMP Thu Jan 24 15:48:03 UTC 2013 x86_64 GNU/Linux

Cool, and this one is running off of block storage via iscsi!
-drive file=/dev/disk/by-path/ip-10.0.1.12:3260-iscsi-iqn.2010-10.org.openstack:volume-bc1a9e79-cf0d-4efe-9fe3-95da882f0277-lun-1

And yes, it really is iSCSI!
jcuff@openstack:~$ sudo iscsiadm -m discovery -t st -p 10.0.1.12
10.0.1.12:3260,1 iqn.2010-10.org.openstack:volume-bc1a9e79-cf0d-4efe-9fe3-95da882f0277

3:24pm
Time to get fancy with a real ubuntu install.
jcuff@openstack:~$ wget http://uec-images.ubuntu.com/raring/current/raring-server-cloudimg-amd64-disk1.img

2013-04-27 15:14:19 (3.50 MB/s) - `raring-server-cloudimg-amd64-disk1.img' saved [234618880/234618880]

jcuff@openstack:~$ file raring-server-cloudimg-amd64-disk1.img 
raring-server-cloudimg-amd64-disk1.img: QEMU QCOW Image (v2), 2147483648 bytes

Very cool that you can also load img files directly from the web...

Yay! This is awesome... we have a working real ubuntu inside openstack
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

3:34pm
This ssh chain is getting a little carried away...
[James-Cuffs-MacBook-Pro]$ ssh James-Cuffs-MacBook-Pro.local
Last login: Sat Apr 27 15:43:02 2013 from 10.0.1.2
[James-Cuffs-MacBook-Pro]$ ssh jcuff@10.0.1.12
Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.5.0-23-generic x86_64)

* Documentation:  https://help.ubuntu.com/

System information as of Sat Apr 27 15:43:59 EDT 2013

System load:  0.05               Processes:             197
Usage of /:   21.2% of 17.74GB   Users logged in:       1
Memory usage: 74%                IP address for virbr0: 192.168.122.1
Swap usage:   4%                 IP address for br100:  10.0.0.1

Graph this data and manage this system at https://landscape.canonical.com/

51 packages can be updated.
35 updates are security updates.

Last login: Sat Apr 27 15:40:38 2013 from 10.0.1.2
jcuff@openstack:~$ ssh ubuntu@10.0.0.3
Welcome to Ubuntu 13.04 (GNU/Linux 3.8.0-19-generic x86_64)

* Documentation:  https://help.ubuntu.com/

System information as of Sat Apr 27 19:44:13 UTC 2013

System load:  0.15              Processes:           73
Usage of /:   35.9% of 1.93GB   Users logged in:     1
Memory usage: 25%               IP address for eth0: 10.0.0.3
Swap usage:   0%

Graph this data and manage this system at https://landscape.canonical.com/

Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud

Use Juju to deploy your cloud instances and workloads:
https://juju.ubuntu.com/#cloud-raring

0 packages can be updated.
0 updates are security updates.

Last login: Sat Apr 27 19:41:01 2013 from 10.0.0.1
ubuntu@ubuntu:~$ 
OSX (physical) > Ubuntu 12.04.2 (virtual box) > Ubuntu 13.04 (openstack)

A cloud inside a cloud inside a cloud in a box :-)

3:50pm
Pizza arrives! If you look close Tim's laptop has lots of green [OK] going on!



Shockingly, discovered the openstack instigated VM can connect to the internet just fine!
ubuntu@ubuntu:~$ telnet www.google.com 80
Trying 74.125.26.104...
Connected to www.google.com.
Escape character is '^]'.
GET /
HTTP/1.0 200 OK
Date: Sat, 27 Apr 2013 19:47:54 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1

4:07pm

Starting some more fun with NOVA, and instance types:
jcuff@openstack:/opt/stack/nova$ ./bin/nova-manage flavor list

m1.medium: Memory: 4096MB, VCPUS: 2, Root: 40GB, Ephemeral: 0Gb,
FlavorID: 3, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}

m1.micro: Memory: 128MB, VCPUS: 1, Root: 0GB, Ephemeral: 0Gb,
FlavorID: 84, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}

m1.tiny: Memory: 512MB, VCPUS: 1, Root: 0GB, Ephemeral: 0Gb,
FlavorID: 1, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}

m1.large: Memory: 8192MB, VCPUS: 4, Root: 80GB, Ephemeral: 0Gb,
FlavorID: 4, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}

m1.nano: Memory: 64MB, VCPUS: 1, Root: 0GB, Ephemeral: 0Gb,
FlavorID: 42, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}

m1.small: Memory: 2048MB, VCPUS: 1, Root: 20GB, Ephemeral: 0Gb,
FlavorID: 2, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}

m1.xlarge: Memory: 16384MB, VCPUS: 8, Root: 160GB, Ephemeral: 0Gb,
FlavorID: 5, Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}

What is in the cli is in the gui... nice!

Ok, next up trying to turn one of Tim's laptop VMs into a nova compute engine, by end of day we would love to look something like this. Very much doubt that we will get there, but we will give it the good old college try :-)


4:23pm
While debugging noticed that a simple "screen -r" gets you to an awesome screen debug with 17 windows! Count em all if you can.



Pretty cool this, here you can see how it was set up:
jcuff@openstack:~/devstack$ cat stack-screenrc | grep tuff
/opt/stack/keystone/bin/keystone-all 
sudo tail -f /var/log/apache2/horizon_error.log
/opt/stack/glance/bin/glance-registry 
/opt/stack/glance/bin/glance-api 
/opt/stack/nova/bin/nova-api
/opt/stack/nova/bin/nova-conductor
sg libvirtd /opt/stack/nova/bin/nova-compute
/opt/stack/nova/bin/nova-cert
/opt/stack/nova/bin/nova-network
/opt/stack/nova/bin/nova-scheduler
/opt/stack/nova/bin/nova-novncproxy 
/opt/stack/nova/bin/nova-xvpvncproxy 
/opt/stack/nova/bin/nova-consoleauth
/opt/stack/nova/bin/nova-objectstore
/opt/stack/cinder/bin/cinder-api 
/opt/stack/cinder/bin/cinder-volume 
/opt/stack/cinder/bin/cinder-scheduler 

5:24pm
Update, lots of fannying about with Tim's laptop - was not configured with bridge and NAT sure makes it "interesting" to do computer to computer networking. While changing this we discovered that nova.conf and a whole pile of other things are all hard coded into the machine. Time to spin up fresh VMs rather than attempt to unpick this rats nest of static and hardcoded stuff. Even the fanciest of code seem to have a boatload of hardcoded links in it - this one even more than many others. Good job Tim is stella at the devops, onto bridged networking, we think we may even get a two membered set up going soon.

5:57pm
DevStack is great, but really only designed as we used it for single box runs. We wanted to do multiple boxes, and using automatic scripts to provision Ubuntu from RHEL was clearly a bad idea... ;-) Now copying Tim's RH64 version over so we can do multi compute images. Also now need to test out our Fusion to VirtualBox fu... this also should be a bit of a laugh! First up - go go gadget wifi!
[James-Cuffs-MacBook-Pro]$ pwd
/Users/jcuff/VirtualBox VMs

[James-Cuffs-MacBook-Pro]$ scp -r alaric@10.0.1.11:"/Users/alaric/Documents/Virtual\ Machines.localized/RH\ OS\ Lab\ -2\ .vmwarevm" ./RH64

RH OS Lab -2 .vmxf                           100%   3433   3.4KB/s   00:00    
Virtual Disk-s001.vmdk                       100%   58MB   8.3MB/s   00:07    
Virtual Disk-s002.vmdk                       100%  320KB 320.0KB/s   00:01    
Virtual Disk-s003.vmdk                       100% 1363MB   8.7MB/s   02:36    
Virtual Disk-s004.vmdk                       100%  442MB   8.7MB/s   00:51    
Virtual Disk-s005.vmdk                       100%  272MB   8.5MB/s   00:32    
Virtual Disk-s006.vmdk                       100%  391MB   8.5MB/s   00:46    
...

Update on Fedora, Michele tried a solid and eventually gave up, three downloads, corruption and other buckets of fail. She is now on the Ubuntu wagon!

In other news - oh my lord! Tim's copy to my laptop worked first time! Yay integration with virtualbox... I remember days when this was no way near as easy to do as this! Proof:

6:28pm
Oh my - RHEL bites us in the arse again! Be sure that you look at:
[paxindustria@localhost ~]$ cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.


# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:92:66:1e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:b1:87:64", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

Because we moved the instance to virtual box, and the packstack code expects to see "eth0", and "eth1".



Certainly gets very pissed if it happens to see "eth2" and "eth3"... le sigh. Anyhoo, chopped it out and now we are looking pretty awesome again! Tim is booting up the two laptop cluster as we speak.

Yay! Tim successfully got nova-compute installed on my laptop from his with packstack:
nova  4213  2.2  2.8 1117324 53948 ? Sl 15:38   0:01 /usr/bin/python /usr/bin/nova-compute --config-file /etc/nova/nova.conf --logfile /var/log/nova/compute.log

7:22pm
le sigh - clearly having network issues here, we have been bouncing firewalls and machines all over the place, google searches are turning up a few questions about this... still hacking away here, but starting to hit more roadblocks than we thought. Mind you it is always a problem with the network. hehehe!
2013-04-27 16:19:52.193 4047 TRACE nova.compute.manager [instance: 709c127a-0f8f-4751-a496-f47e05ac73be]     raise rpc_common.Timeout()
2013-04-27 16:19:52.193 4047 TRACE nova.compute.manager [instance: 709c127a-0f8f-4751-a496-f47e05ac73be] Timeout: Timeout while waiting on RPC response.
yep...

8:07pm Tim is running a fresh install now we have sorted out our DNS issues.

8:22pm And we have SUCCESS! We have a two node cluster running across the network!

Tada!!



And that my friends is what we call a WRAP! Here ends our inaugral #openstackday

Hope you enjoyed the journey as much as we did.

Saturday, April 20, 2013

little known technologies that helped save the human genome


What is that chunky wiring monstrosity?

That my friends, is the utter magic that happens when you have to get creative to solve problems as a team. Back in the day, there were no clouds, amazon was still selling books. There was also no "devops", I mean heck we hardly had functioning cell phones!

So we faced a problem.  We had no space, not enough kit, and a race to further inform the human genome. These were the days before "map reduce" or any of that clever stuff. We wanted to find a way to get DNA on multiple computer clusters in a real hurry. Tim Cutts on the team with Guy Coates came up with this epic system that in essence relies on that set of little wires you see above. 

We were using RLX Technologies blades which could stack 24 little motherboards into a 3U chassis! These were some interesting days as we stacked up 768 of these puppies in 2 racks - we used 52U monster racks back then, that needed a stepladder to get to the top blades! However, this did allow us to fit 16 chassis or 384 individual computers in a single rack! Each blade had two network ports that were presented out the back via a nifty RJ21 connection...




You can see that the networking could get very quickly out of hand... 12*4 wires is 48 ethernet connections out of a single box!


Yeah it got out of hand fast! To run the 768 machines we had purchased we would have needed a network switch with 1,536 ports.  Remember this is 2002, that would have been a crazy switch to buy... even today it would be pretty nuts to do it...

So enter Tim Cutts, and his magic wires!

Because we were basically doing a file system distribution and image run (we talked about it later here). We could effectively make a next to next to next network taking each node and hooking it up to his friend next door.  This way we had the ability to make a network that was perfect to distribute data from one end of the chain all the way to the end of the chain.

We called this a "Distribution Area Network".

We basically took Dolly as our inspiration:

     +--------+  Data   +----------+  Data  +----------+
     | Master |-------->| Client 1 |------->| Client 2 |
     +--------+         +----------+        +----------+
         ^                   |                   |
         | Data              | Data              | Data
         |                   V                   V
      +------+            +------+            +------+
      | Disk |            | Disk |            | Disk |
      +------+            +------+            +------+

We were using the local 2.5" disks as a software raid stripe of 2 x 40G disks so there were 1,536 little spindles (60TB total) in there, each with local copies of the human genome and analysis data needed to get our science out of the door.

This all kinda looks a bit like something released not that long ago eh?   Seeing these recent announcements of so called "high density CPU servers" reminds me of that phrase...

What was once old. Is new again. I guess?

As a foot note, which to me was even more staggering. Tim sent the folks over at the manufacturers what was basically an upgraded beer mat design. We, much like the world famous Dr. Birney also loved to design things at the pub :-) The first example "wire" came back we plugged it in on a test chassis, set up some IP addresses... sent some pings... crossed our fingers!

and the bloody thing went and worked the FIRST TIME!

I still so much remember laughing in our ISG portakabin.

p.s.
While researching this article, I stumbled across proof I also used Pine on Tru64 ;-)



Wednesday, April 17, 2013

IaaS services uptick in .edu


Great to stumble across and finally see this happening:

[James-MacBook-Pro]$ host huit.harvard.edu

huit.harvard.edu has address 50.17.51.113

huit.harvard.edu mail is handled by 20 alt2.aspmx.l.google.com.
huit.harvard.edu mail is handled by 20 alt1.aspmx.l.google.com.

for those wondering what "50.17.51.113" is, here it is...

[James-MacBook-Pro]$ nslookup 50.17.51.113
Server:  10.0.1.1
Address: 10.0.1.1#53

Non-authoritative answer:
113.51.17.50.in-addr.arpa name = ec2-50-17-51-113.compute-1.amazonaws.com.




Awesome to see a major .edu IT org using not one but three outsourced services!


Tuesday, April 16, 2013

you may want to consider utility supercomputing on the cloud when...


In my new gig I was trying to come up with a single, unified image to capture when you really should probably consider the cloud as an option for your high performance computing...


Aww Yeah! Totally Nailed It!!


With thx to slashgear ca. 2009 ;-)


Wednesday, March 27, 2013

parlor games: sizing AWS with "terrible math (tm)"

People have been playing this parlor game for years I wanted to follow up on my last post about potentially 3.7 million hosts to play a game to see how many there actually are. I borrowed from the great work over at www.ec2instances.info, many thanks to @powdahound for a quick flash of inspiration.

Caveat: this has absolutely *nothing* to do with my day job, it is all based on purely fictitious (and dubious) math.  The only parts here that are even slightly correct were lifted from random public sources.  Everything below is a pure construct for fun and pleasure only, do not use these numbers to advise your stock broker, set career goals, or make any decision about anything what so ever!

Enjoy :-)

NameDRAM (GB)STORAGE (GB)BITSAPI NAME/hour (linux)/hour (windows)
Micro0.6032/64-bitt1.micro$0.02$0.02
M1 Small1.716032/64-bitm1.small$0.06$0.12
M1 Medium3.7541032/64-bitm1.medium$0.12$0.23
High-CPU Medium1.735032/64-bitc1.medium$0.14$0.28
M1 Large7.585064-bitm1.large$0.24$0.46
High-Memory Extra Large17.142064-bitm2.xlarge$0.41$0.57
M1 Extra Large15169064-bitm1.xlarge$0.48$0.92
M3 Extra Large15064-bitm3.xlarge$0.50$0.98
High-CPU Extra Large7169064-bitc1.xlarge$0.58$1.14
High-Memory Double Extra Large34.285064-bitm2.2xlarge$0.82$1.14
M3 Double Extra Large30064-bitm3.2xlarge$1.00$1.96
Cluster Compute Quadruple Extra Large23169064-bitcc1.4xlarge$1.30$1.61
High-Memory Quadruple Extra Large68.4169064-bitm2.4xlarge$1.64$2.28
Cluster GPU Quadruple Extra Large22169064-bitcg1.4xlarge$2.10$2.60
Cluster Compute Eight Extra Large60.5337064-bitcc2.8xlarge$2.40$2.97
High I/O Quadruple Extra Large60.5204864-bithi1.4xlarge$3.10$3.58
High Memory Cluster Eight Extra Large24424064-bitcr1.8xlarge$3.50$3.83
High Storage Eight Extra Large117480064-biths1.8xlarge$4.60$4.93
(ref: http://www.ec2instances.info/)

Makes for a nice picture, M3 double extra has a bit of what I've decided to call a "redmond bump", but you can see the server/complexity price performance model pretty well here. Although I do prefer me some straight lines for financial models... heh



So if we take the following averages over all instances, with application of "bad math", but not yet patent pending "terrible math (tm)", we are working up to a new level of "awesome sums" shortly, pay attention that bit comes next and is loaded with "awesome" ;-):

                        Linux   Windows
Ave. inst. cost         $1.28   $1.65
Median inst. cost       $0.70   $1.14

And think daft thoughts, assuming a 1:1 mapping of all public space based on a total number of hosts based of 3,702,664 from my previous epic one liner... also assuming a 1:1 mapping of all private to public hosts, ignore S3, and generally assume even more than we are stating we are assuming :-)

                                     /hour             /year
Average Linux                   $4,733,239   $41,490,672,122
Average Windows                 $6,092,939   $53,409,548,382

Median Linux                    $2,591,865   $22,719,794,382
Median Windows                  $4,221,037   $37,000,807,994
 
Warning! fake math, average 
of averages, of averages...     $4,409,770   $38,655,205,720


So in theory, EC2 alone could represent between $22B and $53B a year!  Or $4MM/hour!

Random unconfirmed reports from the internet show AWS as $2B/yr, so factor this against a potential $38B... @ 3,700,000 maximum potential servers (from IP space).... gives (drum roll please!), oh and if you are playing along at home, this is the bit when the math goes from bad to "extremely suspect" and onwards to patent pending "terrible math (tm)"!

so, with logical consequence, # servers in AWS  

194,877

he he he, ho, ho ho!

I'm guessing that we should all just quit guessing! Although it is super fun!

The real facts are that no matter how you look at the numbers for public cloud (and in particular AWS), they are all enormous, staggering and vast. Even more so when you look at the sheer range of capability on offer, it is just fascinating. The only numbers in this game that continue to be small (and the only ones you really need to care about!) are the $/instance/hour.

And yet, these numbers continue to become ever, ever smaller each and every day. Plus [even with "terrible math(tm)"] there are clearly a lot of servers out there. Basically, this is awesome great news for everyone needing to run science and computation at scale and for short $. That's the really cool part of this parlor game!

And that, oh yes - that is the bit that I do use in the day job :-)

p.s. comments about issues with "terrible math (tm)" will be met with mild amusement

Monday, March 25, 2013

how big is the public cloud?

Fun question came up today about cloud resources and IP adresses. Totally randomly, I also spotted a tweet by my pal Pax, and decided to put two and two together to come up with new values of four!


So I decided to get a little crazy!

jcuff@jcuff-virtualbox:~/netaddr$ wget -qO - https://forums.aws.amazon.com/ann.jspa?annID=1701 | grep -Eoh "[0-9.]+{4}/[0-9]+" | xargs -I % ./size.py % | awk '{print sum=sum+$2}' | tail -1

3,702,664

So enough for over 3.7 million public hosts all thanks to netaddr and a pointer from my pal Pax. Oh, here's the code, remember there are always 2 less hosts per "ip.size" so chopped off two...


jcuff@jcuff-virtualbox:~/netaddr$ cat size.py
#!/usr/bin/python
import sys
from netaddr import *
import pprint
ip = IPNetwork(sys.argv[1])
print sys.argv[1], ip.size-2


And the raw output:

jcuff@jcuff-virtualbox:~/netaddr$ wget -qO - https://forums.aws.amazon.com/ann.jspa?annID=1701 | grep -Eoh "[0-9.]+{4}/[0-9]+" | xargs -I % ./size.py %
72.44.32.0/19 8190
67.202.0.0/18 16382
75.101.128.0/17 32766
174.129.0.0/16 65534
204.236.192.0/18 16382
184.73.0.0/16 65534
184.72.128.0/17 32766
184.72.64.0/18 16382
50.16.0.0/15 131070
50.19.0.0/16 65534
107.20.0.0/14 262142
23.20.0.0/14 262142
54.242.0.0/15 131070
54.234.0.0/15 131070
54.236.0.0/15 131070
54.224.0.0/15 131070
54.226.0.0/15 131070
54.208.0.0/15 131070
54.210.0.0/15 131070
50.112.0.0/16 65534
54.245.0.0/16 65534
54.244.0.0/16 65534
54.214.0.0/16 65534
204.236.128.0/18 16382
184.72.0.0/18 16382
50.18.0.0/16 65534
184.169.128.0/17 32766
54.241.0.0/16 65534
54.215.0.0/16 65534
79.125.0.0/17 32766
46.51.128.0/18 16382
46.51.192.0/20 4094
46.137.0.0/17 32766
46.137.128.0/18 16382
176.34.128.0/17 32766
176.34.64.0/18 16382
54.247.0.0/16 65534
54.246.0.0/16 65534
54.228.0.0/16 65534
54.216.0.0/15 131070
54.229.0.0/16 65534
175.41.128.0/18 16382
122.248.192.0/18 16382
46.137.192.0/18 16382
46.51.216.0/21 2046
54.251.0.0/16 65534
54.254.0.0/16 65534
54.255.0.0/16 65534
54.252.0.0/16 65534
54.253.0.0/16 65534
175.41.192.0/18 16382
46.51.224.0/19 8190
176.32.64.0/19 8190
103.4.8.0/21 2046
176.34.0.0/18 16382
54.248.0.0/15 131070
54.250.0.0/16 65534
177.71.128.0/17 32766
54.232.0.0/16 65534
54.233.0.0/18 16382

I make no apologies for the abuse of xargs and python in the making of this movie!

Update: this has been done before, but never with such epic one liners ref:

http://gigaom.com/2012/04/20/just-how-big-is-the-amazon-cloud-anyway/ :-)

Saturday, March 9, 2013

of the pulling of plugs and dead fios connections...

Oh no!  The internet is down!!!

So we have had FiOS for about five years now. It's been great until today. We have a business line, pay good money for it, and it has worked mostly fine, and I've never had to call support until today. More of that later on...

First sign, the TiVo was not connecting... rotroh! How are we going to survive!  I thought nothing much of it, there were after all multiple recorded episodes of Bearing Sea Gold to be watched! :-)

I did eventually surface, and do the regular reboot house routine - power off wifi, pull the little green glass fiber optic. Doh! Still nothing much going on there, still dead, they are probably working on something, no biggy. Went shopping and decided to generally get on with my life.

Came back from the shopping mission and started to look at why things were busted. Very odd, the wifi/wan box actually had an IP address, but things were very still much fail, IPs could resolve, but traffic was like molasses or non existent.  This *has* to be an upstream problem I thought to myself...

Decided to call Verizon - in retrospect that was my first big mistake.

An hour plus of back and forth and many powering off and on of "the router" resulted in nothing more than the technician managing to release my DHCP address. I knew I had IP connectivity, that was not the issue, the network was clearly broken...

I'm not a CCIE, but I know that this response from a ping ain't right! Me trying to explain this to the technician was probably worth hearing, and could make for a good comedy sketch at some point, but I digress... :-)

jcuff-air:~ jcuff$ ping www.google.com
PING www.google.com (173.194.75.103): 56 data bytes
Request timeout for icmp_seq 0
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=120.565 ms
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=122.475 ms (DUP!)
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=122.661 ms (DUP!)
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=122.671 ms (DUP!)
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=122.677 ms (DUP!)
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=122.684 ms (DUP!)
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=122.693 ms (DUP!)
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=122.699 ms (DUP!)
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=122.705 ms (DUP!)

[SNIPPED 80 LINES]

64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=133.318 ms (DUP!)
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=133.322 ms (DUP!)
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=133.326 ms (DUP!)
64 bytes from 173.194.75.103: icmp_seq=1 ttl=250 time=133.422 ms (DUP!)
Request timeout for icmp_seq 2
^C
--- www.google.com ping statistics ---
4 packets transmitted, 1 packets received, +73 duplicates, 75.0% packet loss
round-trip min/avg/max/stddev = 120.565/128.757/133.422/3.811 ms


Ok, so clearly this is wrong.  What really got me (as I was clearly reaching the end of my tether) at the end of a very long phone call to Verizon, having been passed through five departments, each separately asking me for my details, then each also could not find them!  That part alone was particularly awesome, I just do so love repeating myself!

Then finally the awesome service desk tells me...

"Apple" products are not supported!





I hung up.

A nice cup of tea and a sit down later, I decided to take matters into my own hands....

First up... this bad boy:



I'm clearly throwing all caution to the wind here, I'm not qualified... never have been. "Telco Use Only Do Not Remove"... well it is in my house, so I'm pulling the plug.

Next up, I pull the wire on the battery, the machine is beeping quite a lot now because of the removed "Telco Use Only" plug!  I picked the red wire you can see here, hoping it will stop the beeping!



Gave it a tug, and all the lights went out.  I also pulled the fiber optic just incase for added awesomeness.  I'm not qualified, but I've been known to know a little bit about how computers and networks "work".  Then I went off to finish my tea... and left this thing to understand the jolly good lesson I'd just taught it!

As I drink my tea, I'm thinking about how to make double sure that this is going to work.  So I plugged a laptop right into the network jack on the terminal adapter, (by passing any possibly crappyness in the home network, I did wire it after all!) quickly cloned the MAC address from the airport express... I'm not going back to call them again to release the MAC!  ifconfig to the rescue!

jcuff-air:~ jcuff$ ifconfig en0 ether aa:ff:ee:ff:ee:aa

Ok - now time to put the battery back in, reconnect the glass fiber connection (green), plug back in the "naughty boy - do not remove!" plug back into the wall...

Oh look, see what on earth do we have here?  Oh yes, a fully functioning internet!

jcuff-air:~ jcuff$ ping www.google.com
PING www.google.com (173.194.75.99): 56 data bytes
64 bytes from 173.194.75.99: icmp_seq=0 ttl=250 time=35.918 ms
64 bytes from 173.194.75.99: icmp_seq=1 ttl=250 time=40.758 ms
64 bytes from 173.194.75.99: icmp_seq=2 ttl=250 time=39.774 ms
^C
--- www.google.com ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 35.918/38.817/40.758/2.089 ms
jcuff-air:~ jcuff$ 

Disconnected the laptop, plugged the Airport Express back in - all better!

Something in that terminal adapter (Verizon's equipment) clearly got messed up, not that Verizon could tell me.  They were much more concerned that I had an unsupported "router", when in fact it was their equipment that was funky.

Hope this helps any other wayward souls on the internet.

Pull plugs first, ask questions later :-)



Thursday, February 21, 2013

Saving the world with #devops!

Much much fun yesterday with my chums at OpsCode and Mozilla! Interesting story this, albeit rather long, it should give some insight as to why devops is important to HPC and why computing at scale really matters. We talk about granularity, scale, configuration management, the rise of the Linux OS and open source and how all these advances enable bigger and better science and discovery. I mention some of the reasons why I'm over at cyclecomputing also and what we are doing there with advanced technology to manage utility supercomputing at massive scale to solve real world scientific problems.






[any opinions here are all mine, and have absolutely nothing to do with my employer]
(c) 2011 James Cuff